zack | 989d0b5 | 2007-05-28 13:53:12 +0000 | [diff] [blame] | 1 | /* |
| 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> |
staikos | cdc883d | 2007-06-22 03:29:41 +0000 | [diff] [blame^] | 29 | #include <QPixmap> |
zack | 989d0b5 | 2007-05-28 13:53:12 +0000 | [diff] [blame] | 30 | #include <QSharedDataPointer> |
| 31 | |
| 32 | class QWebPage; |
| 33 | class QWebSettingsPrivate; |
| 34 | |
| 35 | class QWEBKIT_EXPORT QWebSettings |
| 36 | { |
| 37 | public: |
| 38 | static void setGlobal(const QWebSettings &settings); |
| 39 | static QWebSettings global(); |
| 40 | public: |
| 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 | }; |
staikos | cdc883d | 2007-06-22 03:29:41 +0000 | [diff] [blame^] | 57 | enum WebGraphic { |
| 58 | MissingImageGraphic, |
| 59 | MissingPluginGraphic, |
| 60 | DefaultFaviconGraphic, |
| 61 | TextAreaResizeCornerGraphic |
| 62 | }; |
zack | 989d0b5 | 2007-05-28 13:53:12 +0000 | [diff] [blame] | 63 | |
| 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 | |
staikos | a933d56 | 2007-06-21 05:01:53 +0000 | [diff] [blame] | 90 | void setIconDatabaseEnabled(bool enabled, const QString &location = QString()); |
| 91 | bool iconDatabaseEnabled() const; |
| 92 | |
staikos | cdc883d | 2007-06-22 03:29:41 +0000 | [diff] [blame^] | 93 | void setWebGraphic(WebGraphic type, const QPixmap &graphic); |
| 94 | QPixmap webGraphic(WebGraphic type) const; |
| 95 | |
zack | 989d0b5 | 2007-05-28 13:53:12 +0000 | [diff] [blame] | 96 | private: |
| 97 | QSharedDataPointer<QWebSettingsPrivate> d; |
| 98 | }; |
| 99 | |
| 100 | #endif |