• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

akregator

  • sources
  • kde-4.12
  • kdepim
  • akregator
  • src
openurlrequest.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org>
5 
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.
10 
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.
15 
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.
19 
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.
23 */
24 
25 #include "openurlrequest.h"
26 #include "akregatorconfig.h"
27 
28 
29 namespace Akregator {
30 
31 OpenUrlRequest::OpenUrlRequest(const KUrl& url) : m_frameId(-1), m_url(url),
32  m_options(None), m_part(), m_inBackground(false), m_wasHandled(false)
33 {
34 }
35 
36 int OpenUrlRequest::frameId() const
37 {
38  return m_frameId;
39 }
40 
41 void OpenUrlRequest::setFrameId(int frameId)
42 {
43  m_frameId = frameId;
44 }
45 
46 KUrl OpenUrlRequest::url() const
47 {
48  return m_url;
49 }
50 
51 void OpenUrlRequest::setUrl(const KUrl& url)
52 {
53  m_url = url;
54 }
55 bool OpenUrlRequest::openInBackground() const
56 {
57  return m_inBackground;
58 }
59 
60 void OpenUrlRequest::setOpenInBackground(bool background)
61 {
62  m_inBackground = background;
63 }
64 
65 KParts::OpenUrlArguments OpenUrlRequest::args() const
66 {
67  return m_args;
68 }
69 
70 void OpenUrlRequest::setArgs(const KParts::OpenUrlArguments& args)
71 {
72  //m_hasArgs = true;
73  m_args = args;
74 }
75 
76 KParts::BrowserArguments OpenUrlRequest::browserArgs() const
77 {
78  return m_browserArgs;
79 }
80 
81 void OpenUrlRequest::setBrowserArgs(const KParts::BrowserArguments& args)
82 {
83  m_browserArgs = args;
84 }
85 
86 OpenUrlRequest::Options OpenUrlRequest::options() const
87 {
88  if (m_options == None && m_browserArgs.frameName == QLatin1String("_blank"))
89  {
90  if (Settings::newWindowInTab())
91  return (NewTab);
92  else
93  return (ExternalBrowser);
94  }
95 
96  return m_options;
97 }
98 
99 void OpenUrlRequest::setOptions(OpenUrlRequest::Options options)
100 {
101  m_options = options;
102 }
103 
104 void OpenUrlRequest::setPart(KParts::ReadOnlyPart* part)
105 {
106  m_part = part;
107 }
108 
109 KParts::ReadOnlyPart* OpenUrlRequest::part() const
110 {
111  return m_part;
112 }
113 
114 QString OpenUrlRequest::debugInfo() const
115 {
116  return QString::fromLatin1("url=%1 mimeType=%2 newTab=%3 forcesNewWindow=%4 options=%5")
117  .arg(m_url.url())
118  .arg(m_args.mimeType())
119  .arg(m_browserArgs.newTab())
120  .arg(m_browserArgs.forcesNewWindow())
121  .arg(m_options);
122 }
123 
124 bool OpenUrlRequest::wasHandled() const
125 {
126  return m_wasHandled;
127 }
128 
129 void OpenUrlRequest::setWasHandled( bool handled )
130 {
131  m_wasHandled = handled;
132 }
133 
134 } // namespace Akregator
openurlrequest.h
Akregator::OpenUrlRequest::None
no explicit options, use default
Definition: openurlrequest.h:52
Akregator::OpenUrlRequest::setOpenInBackground
void setOpenInBackground(bool background)
Definition: openurlrequest.cpp:60
Akregator::OpenUrlRequest::url
KUrl url() const
Definition: openurlrequest.cpp:46
Akregator::OpenUrlRequest::debugInfo
QString debugInfo() const
Definition: openurlrequest.cpp:114
Akregator::OpenUrlRequest::options
Options options() const
Definition: openurlrequest.cpp:86
Akregator::OpenUrlRequest::setFrameId
void setFrameId(int frameId)
Definition: openurlrequest.cpp:41
Akregator::OpenUrlRequest::setUrl
void setUrl(const KUrl &url)
Definition: openurlrequest.cpp:51
akregatorconfig.h
Akregator::OpenUrlRequest::setPart
void setPart(KParts::ReadOnlyPart *part)
Definition: openurlrequest.cpp:104
Akregator::OpenUrlRequest::wasHandled
bool wasHandled() const
Definition: openurlrequest.cpp:124
Akregator::OpenUrlRequest::part
KParts::ReadOnlyPart * part() const
The part that was created for a "NewTab" request.
Definition: openurlrequest.cpp:109
Akregator::OpenUrlRequest::setArgs
void setArgs(const KParts::OpenUrlArguments &args)
Definition: openurlrequest.cpp:70
Akregator::OpenUrlRequest::args
KParts::OpenUrlArguments args() const
Definition: openurlrequest.cpp:65
Akregator::OpenUrlRequest::setWasHandled
void setWasHandled(bool handled)
Definition: openurlrequest.cpp:129
Akregator::OpenUrlRequest::setBrowserArgs
void setBrowserArgs(const KParts::BrowserArguments &args)
Definition: openurlrequest.cpp:81
Akregator::OpenUrlRequest::ExternalBrowser
open in external browser
Definition: openurlrequest.h:54
Akregator::OpenUrlRequest::setOptions
void setOptions(Options options)
Definition: openurlrequest.cpp:99
Akregator::Settings::newWindowInTab
static bool newWindowInTab()
Get Open links in new tab instead of in new window.
Definition: akregatorconfig.h:676
Akregator::OpenUrlRequest::openInBackground
bool openInBackground() const
Definition: openurlrequest.cpp:55
Akregator::OpenUrlRequest::Options
Options
Akregator-specific options specifying how a link should be handled.
Definition: openurlrequest.h:50
Akregator::OpenUrlRequest::frameId
int frameId() const
the Id of the frame that sent the request
Definition: openurlrequest.cpp:36
Akregator::OpenUrlRequest::NewTab
open in new tab
Definition: openurlrequest.h:53
Akregator::OpenUrlRequest::browserArgs
KParts::BrowserArguments browserArgs() const
Definition: openurlrequest.cpp:76
m_url
QString m_url
Definition: article.cpp:128
Akregator::OpenUrlRequest::OpenUrlRequest
OpenUrlRequest(const KUrl &url=KUrl())
Definition: openurlrequest.cpp:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal