QtWebKit/qwebsettings.h Source File

qwebsettings.h
Go to the documentation of this file.
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 
30 namespace WebCore {
31  class Settings;
32 }
33 
34 class QWebPage;
35 class QWebPluginDatabase;
36 class QWebSettingsPrivate;
38 class QUrl;
40 
42 public:
43  enum FontFamily {
49  FantasyFont
50  };
51  enum WebAttribute {
66 #if defined(QT_DEPRECATED) || defined(qdoc)
67  LocalStorageDatabaseEnabled = LocalStorageEnabled,
68 #endif
80  HyperlinkAuditingEnabled
81  };
82  enum WebGraphic {
90  SearchCancelButtonPressedGraphic
91  };
92  enum FontSize {
96  DefaultFixedFontSize
97  };
98 
99  static QWebSettings *globalSettings();
100 
101  void setFontFamily(FontFamily which, const QString &family);
102  QString fontFamily(FontFamily which) const;
103  void resetFontFamily(FontFamily which);
104 
105  void setFontSize(FontSize type, int size);
106  int fontSize(FontSize type) const;
107  void resetFontSize(FontSize type);
108 
109  void setAttribute(WebAttribute attr, bool on);
110  bool testAttribute(WebAttribute attr) const;
111  void resetAttribute(WebAttribute attr);
112 
113  void setUserStyleSheetUrl(const QUrl &location);
114  QUrl userStyleSheetUrl() const;
115 
116  void setDefaultTextEncoding(const QString &encoding);
117  QString defaultTextEncoding() const;
118 
119  static void setIconDatabasePath(const QString &location);
120  static QString iconDatabasePath();
121  static void clearIconDatabase();
122  static QIcon iconForUrl(const QUrl &url);
123 
124  //static QWebPluginDatabase *pluginDatabase();
125 
126  static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
127  static QPixmap webGraphic(WebGraphic type);
128 
129  static void setMaximumPagesInCache(int pages);
130  static int maximumPagesInCache();
131  static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity);
132 
133  static void setOfflineStoragePath(const QString& path);
134  static QString offlineStoragePath();
135  static void setOfflineStorageDefaultQuota(qint64 maximumSize);
136  static qint64 offlineStorageDefaultQuota();
137 
138  static void setOfflineWebApplicationCachePath(const QString& path);
139  static QString offlineWebApplicationCachePath();
140  static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
141  static qint64 offlineWebApplicationCacheQuota();
142 
143  void setLocalStoragePath(const QString& path);
144  QString localStoragePath() const;
145 
146  static void clearMemoryCaches();
147 
148  static void enablePersistentStorage(const QString& path = QString());
149 
150  inline QWebSettingsPrivate* handle() const { return d; }
151 
152 private:
153  friend class QWebPagePrivate;
154  friend class QWebSettingsPrivate;
155 
156  Q_DISABLE_COPY(QWebSettings)
157 
158  QWebSettings();
159  QWebSettings(WebCore::Settings *settings);
160  ~QWebSettings();
161 
162  QWebSettingsPrivate *d;
163 };
164 
165 #endif
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
#define QT_END_NAMESPACE
Definition: qglobal.h:128
long long qint64
Definition: qglobal.h:947
Definition: qicon.h:60
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
Definition: qurl.h:61
QWebSettingsPrivate * handle() const
Definition: qwebsettings.h:150
GLint location
Definition: GLee.h:1723
GLsizeiptr size
Definition: GLee.h:1561
#define QWEBKIT_EXPORT
Definition: qwebkitglobal.h:45