QGIS API Documentation  2.12.0-Lyon
qgswebpage.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  ----------------------------------------------------
4  date : 19.5.2015
5  copyright : (C) 2015 by Matthias Kuhn
6  email : matthias (at) opengis.ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSWEBPAGE_H
17 #define QGSWEBPAGE_H
18 
19 #include <QObject>
20 
21 #ifdef WITH_QTWEBKIT
22 #include <QWebPage>
23 #else
24 
25 #include "qgswebframe.h"
26 
27 #include <QMenu>
28 #include <QNetworkAccessManager>
29 #include <QPalette>
30 
31 
36 class CORE_EXPORT QWebSettings : public QObject
37 {
39  Q_OBJECT
40 
41  public:
42 
43  enum WebAttribute
44  {
45  AutoLoadImages,
46  JavascriptEnabled,
47  JavaEnabled,
48  PluginsEnabled,
49  PrivateBrowsingEnabled,
50  JavascriptCanOpenWindows,
51  JavascriptCanAccessClipboard,
52  DeveloperExtrasEnabled,
53  LinksIncludedInFocusChain,
54  ZoomTextOnly,
55  PrintElementBackgrounds,
56  OfflineStorageDatabaseEnabled,
57  OfflineWebApplicationCacheEnabled,
58  LocalStorageEnabled,
59  LocalContentCanAccessRemoteUrls,
60  DnsPrefetchEnabled,
61  XSSAuditingEnabled,
62  AcceleratedCompositingEnabled,
63  SpatialNavigationEnabled,
64  LocalContentCanAccessFileUrls,
65  TiledBackingStoreEnabled,
66  FrameFlatteningEnabled,
67  SiteSpecificQuirksEnabled,
68  JavascriptCanCloseWindows,
69  WebGLEnabled,
70  CSSRegionsEnabled,
71  HyperlinkAuditingEnabled,
72  CSSGridLayoutEnabled,
73  ScrollAnimatorEnabled,
74  CaretBrowsingEnabled,
75  NotificationsEnabled
76  };
77  explicit QWebSettings( QObject* parent = 0 )
78  : QObject( parent )
79  {
80 
81  }
82 
83  void setUserStyleSheetUrl( const QUrl& )
84  {
85 
86  }
87 
88  void setAttribute( WebAttribute, bool on )
89  {
90  Q_UNUSED( on );
91  }
93 };
94 
99 class CORE_EXPORT QWebPage : public QObject
100 {
102  Q_OBJECT
103 
104  public:
105 
106  enum LinkDelegationPolicy
107  {
108  DontDelegateLinks,
109  DelegateExternalLinks,
110  DelegateAllLinks
111  };
112 
113  enum WebWindowType
114  {
115  WebBrowserWindow,
116  WebModalDialog
117  };
118 
119  explicit QWebPage( QObject* parent = 0 )
120  : QObject( parent )
121  , mSettings( new QWebSettings() )
122  , mFrame( new QWebFrame() )
123  {
124  }
125 
126  ~QWebPage()
127  {
128  delete mFrame;
129  delete mSettings;
130  }
131 
132  QPalette palette() const
133  {
134  return QPalette();
135  }
136 
137  void setPalette( const QPalette& palette )
138  {
139  Q_UNUSED( palette );
140  }
141 
142  void setViewportSize( const QSize & size ) const
143  {
144  Q_UNUSED( size );
145  }
146 
147  void setLinkDelegationPolicy( LinkDelegationPolicy linkDelegationPolicy )
148  {
149  Q_UNUSED( linkDelegationPolicy );
150  }
151 
152  void setNetworkAccessManager( QNetworkAccessManager* networkAccessManager )
153  {
154  Q_UNUSED( networkAccessManager );
155  }
156 
157  QWebFrame* mainFrame() const
158  {
159  return mFrame;
160  }
161 
162  QWebSettings* settings() const
163  {
164  return mSettings;
165  }
166 
167  QSize viewportSize() const
168  {
169  return QSize();
170  }
171 
172  QMenu* createStandardContextMenu()
173  {
174  return new QMenu();
175  }
176 
177  signals:
178 
179  public slots:
180 
181  private:
182  QWebSettings* mSettings;
183  QWebFrame* mFrame;
185 };
186 #endif
187 
188 #endif // QGSWEBPAGE_H
The QWebFrame class is a collection of stubs to mimic the API of a QWebFrame on systems where QtWebki...
Definition: qgswebframe.h:31
The QWebPage class is a collection of stubs to mimic the API of a QWebPage on systems where QtWebkit ...
Definition: qgswebpage.h:99
The QWebSettings class is a collection of stubs to mimic the API of a QWebSettings on systems where Q...
Definition: qgswebpage.h:36