|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the QtDeclarative module of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef QDECLARATIVEWEBVIEW_P_H |
|
43 #define QDECLARATIVEWEBVIEW_P_H |
|
44 |
|
45 #include <qdeclarative.h> |
|
46 |
|
47 #include <QtWebKit/QWebPage> |
|
48 |
|
49 QT_BEGIN_HEADER |
|
50 |
|
51 QT_BEGIN_NAMESPACE |
|
52 |
|
53 QT_MODULE(Declarative) |
|
54 |
|
55 class QDeclarativeWebSettings : public QObject { |
|
56 Q_OBJECT |
|
57 |
|
58 Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily) |
|
59 Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily) |
|
60 Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily) |
|
61 Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily) |
|
62 Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily) |
|
63 Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily) |
|
64 |
|
65 Q_PROPERTY(int minimumFontSize READ minimumFontSize WRITE setMinimumFontSize) |
|
66 Q_PROPERTY(int minimumLogicalFontSize READ minimumLogicalFontSize WRITE setMinimumLogicalFontSize) |
|
67 Q_PROPERTY(int defaultFontSize READ defaultFontSize WRITE setDefaultFontSize) |
|
68 Q_PROPERTY(int defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize) |
|
69 |
|
70 Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages) |
|
71 Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled) |
|
72 Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled) |
|
73 Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled) |
|
74 Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled) |
|
75 Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows) |
|
76 Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard) |
|
77 Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled) |
|
78 Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain) |
|
79 Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly) |
|
80 Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds) |
|
81 Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled) |
|
82 Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled) |
|
83 Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled) |
|
84 Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls) |
|
85 |
|
86 public: |
|
87 QDeclarativeWebSettings() {} |
|
88 |
|
89 QString standardFontFamily() const { return s->fontFamily(QWebSettings::StandardFont); } |
|
90 void setStandardFontFamily(const QString& f) { s->setFontFamily(QWebSettings::StandardFont,f); } |
|
91 QString fixedFontFamily() const { return s->fontFamily(QWebSettings::FixedFont); } |
|
92 void setFixedFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FixedFont,f); } |
|
93 QString serifFontFamily() const { return s->fontFamily(QWebSettings::SerifFont); } |
|
94 void setSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SerifFont,f); } |
|
95 QString sansSerifFontFamily() const { return s->fontFamily(QWebSettings::SansSerifFont); } |
|
96 void setSansSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SansSerifFont,f); } |
|
97 QString cursiveFontFamily() const { return s->fontFamily(QWebSettings::CursiveFont); } |
|
98 void setCursiveFontFamily(const QString& f) { s->setFontFamily(QWebSettings::CursiveFont,f); } |
|
99 QString fantasyFontFamily() const { return s->fontFamily(QWebSettings::FantasyFont); } |
|
100 void setFantasyFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FantasyFont,f); } |
|
101 |
|
102 int minimumFontSize() const { return s->fontSize(QWebSettings::MinimumFontSize); } |
|
103 void setMinimumFontSize(int size) { s->setFontSize(QWebSettings::MinimumFontSize,size); } |
|
104 int minimumLogicalFontSize() const { return s->fontSize(QWebSettings::MinimumLogicalFontSize); } |
|
105 void setMinimumLogicalFontSize(int size) { s->setFontSize(QWebSettings::MinimumLogicalFontSize,size); } |
|
106 int defaultFontSize() const { return s->fontSize(QWebSettings::DefaultFontSize); } |
|
107 void setDefaultFontSize(int size) { s->setFontSize(QWebSettings::DefaultFontSize,size); } |
|
108 int defaultFixedFontSize() const { return s->fontSize(QWebSettings::DefaultFixedFontSize); } |
|
109 void setDefaultFixedFontSize(int size) { s->setFontSize(QWebSettings::DefaultFixedFontSize,size); } |
|
110 |
|
111 bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); } |
|
112 void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); } |
|
113 bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); } |
|
114 void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); } |
|
115 bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); } |
|
116 void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); } |
|
117 bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); } |
|
118 void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); } |
|
119 bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); } |
|
120 void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); } |
|
121 bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); } |
|
122 void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); } |
|
123 bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); } |
|
124 void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); } |
|
125 bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); } |
|
126 void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); } |
|
127 bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); } |
|
128 void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); } |
|
129 bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); } |
|
130 void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); } |
|
131 bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); } |
|
132 void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); } |
|
133 bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); } |
|
134 void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); } |
|
135 bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); } |
|
136 void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); } |
|
137 bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); } |
|
138 void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); } |
|
139 bool localContentCanAccessRemoteUrls() const { return s->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); } |
|
140 void setLocalContentCanAccessRemoteUrls(bool on) { s->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, on); } |
|
141 |
|
142 QWebSettings *s; |
|
143 }; |
|
144 |
|
145 QT_END_NAMESPACE |
|
146 |
|
147 QML_DECLARE_TYPE(QDeclarativeWebSettings) |
|
148 |
|
149 QT_END_HEADER |
|
150 |
|
151 #endif |