blob: 2ea2202365e567e9f506c4867c6e35ef8c3281d5 [file] [log] [blame]
zack989d0b52007-05-28 13:53:12 +00001/*
2 Copyright (C) 2007 Trolltech ASA
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., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18
19 This class provides all functionality needed for loading images, style sheets and html
20 pages from the web. It has a memory cache for these objects.
21*/
22
23#ifndef QWEBSETTINGS_H
24#define QWEBSETTINGS_H
25
26#include <qwebkitglobal.h>
27
28#include <QString>
staikoscdc883d2007-06-22 03:29:41 +000029#include <QPixmap>
zack989d0b52007-05-28 13:53:12 +000030#include <QSharedDataPointer>
31
32class QWebPage;
33class QWebSettingsPrivate;
34
35class QWEBKIT_EXPORT QWebSettings
36{
37public:
38 static void setGlobal(const QWebSettings &settings);
39 static QWebSettings global();
40public:
41 enum FontType {
42 StandardFont,
43 FixedFont,
44 SerifFont,
45 SansSerifFont,
46 CursiveFont,
47 FantasyFont
48 };
49 enum WebAttribute {
50 AutoLoadImages,
51 JavascriptEnabled,
52 JavaEnabled,
53 PluginsEnabled,
54 PrivateBrowsingEnabled,
55 JavascriptCanOpenWindows
56 };
staikoscdc883d2007-06-22 03:29:41 +000057 enum WebGraphic {
58 MissingImageGraphic,
59 MissingPluginGraphic,
60 DefaultFaviconGraphic,
61 TextAreaResizeCornerGraphic
62 };
zack989d0b52007-05-28 13:53:12 +000063
64 QWebSettings();
65 ~QWebSettings();
66
67 QWebSettings(const QWebSettings &);
68
69 void setFontFamily(FontType type, const QString &family);
70 QString fontFamily(FontType type) const;
71
72 void setMinimumFontSize(int);
73 int minimumFontSize() const;
74
75 void setMinimumLogicalFontSize(int);
76 int minimumLogicalFontSize() const;
77
78 void setDefaultFontSize(int);
79 int defaultFontSize() const;
80
81 void setDefaultFixedFontSize(int);
82 int defaultFixedFontSize() const;
83
84 void setAttribute(WebAttribute attr, bool on = true);
85 bool testAttribute(WebAttribute attr) const;
86
87 void setUserStyleSheetLocation(const QString &location);
88 QString userStyleSheetLocation() const;
89
staikosa933d562007-06-21 05:01:53 +000090 void setIconDatabaseEnabled(bool enabled, const QString &location = QString());
91 bool iconDatabaseEnabled() const;
92
staikoscdc883d2007-06-22 03:29:41 +000093 void setWebGraphic(WebGraphic type, const QPixmap &graphic);
94 QPixmap webGraphic(WebGraphic type) const;
95
zack989d0b52007-05-28 13:53:12 +000096private:
97 QSharedDataPointer<QWebSettingsPrivate> d;
98};
99
100#endif