webengine/osswebengine/WebKit/qt/Api/qwebsettings.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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., 51 Franklin Street, Fifth Floor,
       
    17     Boston, MA 02110-1301, 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>
       
    29 #include <QPixmap>
       
    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     };
       
    57     enum WebGraphic {
       
    58         MissingImageGraphic,
       
    59         MissingPluginGraphic,
       
    60         DefaultFaviconGraphic,
       
    61         TextAreaResizeCornerGraphic
       
    62     };
       
    63 
       
    64     QWebSettings();
       
    65     ~QWebSettings();
       
    66 
       
    67     QWebSettings(const QWebSettings &);
       
    68     QWebSettings &operator=(const QWebSettings &);
       
    69 
       
    70     void setFontFamily(FontType type, const QString &family);
       
    71     QString fontFamily(FontType type) const;
       
    72 
       
    73     void setMinimumFontSize(int);
       
    74     int minimumFontSize() const;
       
    75 
       
    76     void setMinimumLogicalFontSize(int);
       
    77     int minimumLogicalFontSize() const;
       
    78 
       
    79     void setDefaultFontSize(int);
       
    80     int defaultFontSize() const;
       
    81 
       
    82     void setDefaultFixedFontSize(int);
       
    83     int defaultFixedFontSize() const;
       
    84 
       
    85     void setAttribute(WebAttribute attr, bool on = true);
       
    86     bool testAttribute(WebAttribute attr) const;
       
    87 
       
    88     void setUserStyleSheetLocation(const QString &location);
       
    89     QString userStyleSheetLocation() const;
       
    90 
       
    91     void setIconDatabaseEnabled(bool enabled, const QString &location = QString());
       
    92     bool iconDatabaseEnabled() const;
       
    93 
       
    94     void setWebGraphic(WebGraphic type, const QPixmap &graphic);
       
    95     QPixmap webGraphic(WebGraphic type) const;
       
    96 
       
    97 private:
       
    98     QSharedDataPointer<QWebSettingsPrivate> d;
       
    99 };
       
   100 
       
   101 #endif