• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KHTML

khtml_settings.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __konq_htmlsettings_h__
00021 #define __konq_htmlsettings_h__
00022 
00023 class KConfig;
00024 class KConfigGroup;
00025 #include <khtml_export.h>
00026 #include <QtGui/QColor>
00027 #include <QtCore/QString>
00028 #include <QtCore/QStringList>
00029 #include <QtGui/QFont>
00030 #include <QtCore/QMap>
00031 #include <QtCore/QPair>
00032 
00033 
00034 struct KPerDomainSettings;
00035 class KHTMLSettingsPrivate;
00036 
00040 class KHTML_EXPORT KHTMLSettings
00041 {
00042 public:
00043 
00047     enum KJavaScriptAdvice {
00048     KJavaScriptDunno=0,
00049     KJavaScriptAccept,
00050     KJavaScriptReject
00051     };
00052 
00053     enum KAnimationAdvice {
00054         KAnimationDisabled=0,
00055         KAnimationLoopOnce,
00056         KAnimationEnabled
00057     };
00058 
00059     enum KSmoothScrollingMode {
00060         KSmoothScrollingDisabled=0,
00061         KSmoothScrollingWhenEfficient,
00062         KSmoothScrollingEnabled
00063     };
00064 
00068     enum KJSWindowOpenPolicy {
00069         KJSWindowOpenAllow=0,
00070         KJSWindowOpenAsk,
00071         KJSWindowOpenDeny,
00072         KJSWindowOpenSmart
00073     };
00074 
00078     enum KJSWindowStatusPolicy {
00079         KJSWindowStatusAllow=0,
00080         KJSWindowStatusIgnore
00081     };
00082 
00086     enum KJSWindowMovePolicy {
00087         KJSWindowMoveAllow=0,
00088         KJSWindowMoveIgnore
00089     };
00090 
00094     enum KJSWindowResizePolicy {
00095         KJSWindowResizeAllow=0,
00096         KJSWindowResizeIgnore
00097     };
00098 
00102     enum KJSWindowFocusPolicy {
00103         KJSWindowFocusAllow=0,
00104         KJSWindowFocusIgnore
00105     };
00106 
00110     KHTMLSettings();
00111     KHTMLSettings(const KHTMLSettings &other);
00112 
00116     void init();
00117 
00123     void init( KConfig * config, bool reset = true );
00124 
00128     virtual ~KHTMLSettings();
00129 
00130     // Behavior settings
00131     bool changeCursor() const;
00132     bool underlineLink() const;
00133     bool hoverLink() const;
00134     bool allowTabulation() const;
00135     bool autoSpellCheck() const;
00136     KAnimationAdvice showAnimations() const;
00137     KSmoothScrollingMode smoothScrolling() const;
00138 
00139     // Font settings
00140     QString stdFontName() const;
00141     QString fixedFontName() const;
00142     QString serifFontName() const;
00143     QString sansSerifFontName() const;
00144     QString cursiveFontName() const;
00145     QString fantasyFontName() const;
00146 
00147     // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...)
00148     void setStdFontName(const QString &n);
00149     void setFixedFontName(const QString &n);
00150 
00151     int minFontSize() const;
00152     int mediumFontSize() const;
00153 
00154     bool jsErrorsEnabled() const;
00155     void setJSErrorsEnabled(bool enabled);
00156 
00157     const QString &encoding() const;
00158 
00159     bool followSystemColors() const;
00160 
00161     // Color settings
00162     const QColor& textColor() const;
00163     const QColor& baseColor() const;
00164     const QColor& linkColor() const;
00165     const QColor& vLinkColor() const;
00166 
00167     // Autoload images
00168     bool autoLoadImages() const;
00169     bool unfinishedImageFrame() const;
00170 
00171     bool isOpenMiddleClickEnabled();
00172     bool isBackRightClickEnabled();
00173 
00174     // Java and JavaScript
00175     bool isJavaEnabled( const QString& hostname = QString() ) const;
00176     bool isJavaScriptEnabled( const QString& hostname = QString() ) const;
00177     bool isJavaScriptDebugEnabled( const QString& hostname = QString() ) const;
00178     bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString() ) const;
00179     bool isPluginsEnabled( const QString& hostname = QString() ) const;
00180 
00181     // AdBlocK Filtering
00182     bool isAdFiltered( const QString &url ) const;
00183     bool isAdFilterEnabled() const;
00184     bool isHideAdsEnabled() const;
00185     void addAdFilter( const QString &url );
00186 
00187     // Access Keys
00188     bool accessKeysEnabled() const;
00189 
00190     KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString() ) const;
00191     KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString() ) const;
00192     KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString() ) const;
00193     KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString() ) const;
00194     KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString() ) const;
00195 
00196     // helpers for parsing domain-specific configuration, used in KControl module as well
00197     static KJavaScriptAdvice strToAdvice(const QString& _str);
00198     static void splitDomainAdvice(const QString& configStr, QString &domain,
00199                   KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice);
00200     static const char* adviceToStr(KJavaScriptAdvice _advice);
00201 
00210     void readDomainSettings(const KConfigGroup &config, bool reset,
00211             bool global, KPerDomainSettings &pd_settings);
00212 
00213     QString settingsToCSS() const;
00214     static const QString &availableFamilies();
00215 
00216     QString userStyleSheet() const;
00217 
00218     // Form completion
00219     bool isFormCompletionEnabled() const;
00220     int maxFormCompletionItems() const;
00221 
00222     // Meta refresh/redirect (http-equiv)
00223     bool isAutoDelayedActionsEnabled () const;
00224 
00225     QList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const;
00226 
00227     // Whether to show passive popup when windows are blocked
00228     void setJSPopupBlockerPassivePopup(bool enabled);
00229     bool jsPopupBlockerPassivePopup() const;
00230 
00231 private:
00232     friend class KHTMLGlobal;
00233     QString lookupFont(int i) const;
00234 
00235     KHTMLSettingsPrivate* const d;
00236     static QString *avFamilies;
00237 };
00238 
00239 #endif

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal