source: trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 4.7 KB
RevLine 
[2]1/*
2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef QWEBSETTINGS_H
21#define QWEBSETTINGS_H
22
23#include "qwebkitglobal.h"
24
25#include <QtCore/qstring.h>
26#include <QtGui/qpixmap.h>
27#include <QtGui/qicon.h>
28#include <QtCore/qshareddata.h>
29
[561]30namespace WebCore {
[2]31 class Settings;
32}
33
34class QWebPage;
[561]35class QWebPluginDatabase;
[2]36class QWebSettingsPrivate;
37QT_BEGIN_NAMESPACE
38class QUrl;
39QT_END_NAMESPACE
40
[561]41class QWEBKIT_EXPORT QWebSettings {
[2]42public:
43 enum FontFamily {
44 StandardFont,
45 FixedFont,
46 SerifFont,
47 SansSerifFont,
48 CursiveFont,
49 FantasyFont
50 };
51 enum WebAttribute {
52 AutoLoadImages,
53 JavascriptEnabled,
54 JavaEnabled,
55 PluginsEnabled,
56 PrivateBrowsingEnabled,
57 JavascriptCanOpenWindows,
58 JavascriptCanAccessClipboard,
59 DeveloperExtrasEnabled,
60 LinksIncludedInFocusChain,
61 ZoomTextOnly,
62 PrintElementBackgrounds,
63 OfflineStorageDatabaseEnabled,
64 OfflineWebApplicationCacheEnabled,
[561]65 LocalStorageEnabled,
[846]66#if defined(QT_DEPRECATED) || defined(qdoc)
[561]67 LocalStorageDatabaseEnabled = LocalStorageEnabled,
68#endif
69 LocalContentCanAccessRemoteUrls,
[846]70 DnsPrefetchEnabled,
71 XSSAuditingEnabled,
72 AcceleratedCompositingEnabled,
73 SpatialNavigationEnabled,
74 LocalContentCanAccessFileUrls,
75 TiledBackingStoreEnabled,
76 FrameFlatteningEnabled,
77 SiteSpecificQuirksEnabled
[2]78 };
79 enum WebGraphic {
80 MissingImageGraphic,
81 MissingPluginGraphic,
82 DefaultFrameIconGraphic,
[846]83 TextAreaSizeGripCornerGraphic,
84 DeleteButtonGraphic
[2]85 };
86 enum FontSize {
87 MinimumFontSize,
88 MinimumLogicalFontSize,
89 DefaultFontSize,
90 DefaultFixedFontSize
91 };
92
93 static QWebSettings *globalSettings();
94
95 void setFontFamily(FontFamily which, const QString &family);
96 QString fontFamily(FontFamily which) const;
97 void resetFontFamily(FontFamily which);
98
99 void setFontSize(FontSize type, int size);
100 int fontSize(FontSize type) const;
101 void resetFontSize(FontSize type);
102
103 void setAttribute(WebAttribute attr, bool on);
104 bool testAttribute(WebAttribute attr) const;
105 void resetAttribute(WebAttribute attr);
106
107 void setUserStyleSheetUrl(const QUrl &location);
108 QUrl userStyleSheetUrl() const;
109
[561]110 void setDefaultTextEncoding(const QString &encoding);
111 QString defaultTextEncoding() const;
112
[2]113 static void setIconDatabasePath(const QString &location);
114 static QString iconDatabasePath();
115 static void clearIconDatabase();
116 static QIcon iconForUrl(const QUrl &url);
117
[561]118 //static QWebPluginDatabase *pluginDatabase();
119
[2]120 static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
121 static QPixmap webGraphic(WebGraphic type);
122
123 static void setMaximumPagesInCache(int pages);
124 static int maximumPagesInCache();
125 static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
126
127 static void setOfflineStoragePath(const QString& path);
128 static QString offlineStoragePath();
129 static void setOfflineStorageDefaultQuota(qint64 maximumSize);
130 static qint64 offlineStorageDefaultQuota();
131
[561]132 static void setOfflineWebApplicationCachePath(const QString& path);
133 static QString offlineWebApplicationCachePath();
134 static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
135 static qint64 offlineWebApplicationCacheQuota();
136
137 void setLocalStoragePath(const QString& path);
138 QString localStoragePath() const;
139
140 static void clearMemoryCaches();
141
142 static void enablePersistentStorage(const QString& path = QString());
143
[2]144 inline QWebSettingsPrivate* handle() const { return d; }
145
146private:
147 friend class QWebPagePrivate;
148 friend class QWebSettingsPrivate;
149
150 Q_DISABLE_COPY(QWebSettings)
151
152 QWebSettings();
153 QWebSettings(WebCore::Settings *settings);
154 ~QWebSettings();
155
156 QWebSettingsPrivate *d;
157};
158
159#endif
Note: See TracBrowser for help on using the repository browser.