Merge remote-tracking branch 'origin/Applications/16.08'
[kdepim.git] / akregator / src / openurlrequest.h
blob3dab24a0c8e73db040710e9678d937e3fa1ab518
1 /*
2 This file is part of Akregator.
4 Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
25 #ifndef AKREGATOR_OPENURLREQUEST_H
26 #define AKREGATOR_OPENURLREQUEST_H
28 #include <kparts/browserextension.h>
30 #include <QUrl>
32 #include <QPointer>
34 #include "akregator_export.h"
36 namespace Akregator
39 class AKREGATOR_EXPORT OpenUrlRequest
41 public:
43 /**
44 * Akregator-specific options specifying how a link should be handled.
45 * TODO: check what can be done by overriding KURLArgs flags.
47 enum Options {
48 None = 0, /**< no explicit options, use default */
49 NewTab, /**< open in new tab */
50 ExternalBrowser /**< open in external browser */
53 explicit OpenUrlRequest(const QUrl &url = QUrl());
55 /**
56 * the Id of the frame that sent the request */
57 int frameId() const;
58 void setFrameId(int frameId);
60 QUrl url() const;
61 void setUrl(const QUrl &url);
63 KParts::OpenUrlArguments args() const;
64 void setArgs(const KParts::OpenUrlArguments &args);
66 KParts::BrowserArguments browserArgs() const;
67 void setBrowserArgs(const KParts::BrowserArguments &args);
69 Options options() const;
70 void setOptions(Options options);
72 bool openInBackground() const;
73 void setOpenInBackground(bool background);
75 QString debugInfo() const;
77 bool wasHandled() const;
78 void setWasHandled(bool handled);
80 private:
82 int m_frameId;
83 QUrl m_url;
84 KParts::OpenUrlArguments m_args;
85 KParts::BrowserArguments m_browserArgs;
86 Options m_options;
87 bool m_inBackground;
88 bool m_wasHandled;
91 } // namespace Akregator
93 #endif // AKREGATOR_OPENURLREQUEST_H