• Skip to content
  • Skip to link menu
KDE 4.2 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 KHTML_SETTINGS_H
00021 #define KHTML_SETTINGS_H
00022 
00023 class KConfig;
00024 class KConfigGroup;
00025 
00026 #include <khtml_export.h>
00027 
00028 #include <QtGui/QColor>
00029 #include <QtGui/QFont> // ### KDE 5: remove
00030 #include <QtCore/QMap> // ### KDE 5: remove
00031 #include <QtCore/QStringList>
00032 #include <QtCore/QPair>
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 
00065     enum KDNSPrefetch {
00066         KDNSPrefetchDisabled=0,
00067         KDNSPrefetchOnlyWWWAndSLD,
00068         KDNSPrefetchEnabled
00069     };
00070 
00074     enum KJSWindowOpenPolicy {
00075         KJSWindowOpenAllow=0,
00076         KJSWindowOpenAsk,
00077         KJSWindowOpenDeny,
00078         KJSWindowOpenSmart
00079     };
00080 
00084     enum KJSWindowStatusPolicy {
00085         KJSWindowStatusAllow=0,
00086         KJSWindowStatusIgnore
00087     };
00088 
00092     enum KJSWindowMovePolicy {
00093         KJSWindowMoveAllow=0,
00094         KJSWindowMoveIgnore
00095     };
00096 
00100     enum KJSWindowResizePolicy {
00101         KJSWindowResizeAllow=0,
00102         KJSWindowResizeIgnore
00103     };
00104 
00108     enum KJSWindowFocusPolicy {
00109         KJSWindowFocusAllow=0,
00110         KJSWindowFocusIgnore
00111     };
00112 
00116     KHTMLSettings();
00117     KHTMLSettings(const KHTMLSettings &other);
00118 
00122     void init();
00123 
00129     void init( KConfig * config, bool reset = true );
00130 
00134     virtual ~KHTMLSettings();
00135 
00136     // Behavior settings
00137     bool changeCursor() const;
00138     bool underlineLink() const;
00139     bool hoverLink() const;
00140     bool allowTabulation() const;
00141     bool autoSpellCheck() const;
00142     KAnimationAdvice showAnimations() const;
00143     KSmoothScrollingMode smoothScrolling() const;
00144     KDNSPrefetch dnsPrefetch() const;
00145 
00146     // Font settings
00147     QString stdFontName() const;
00148     QString fixedFontName() const;
00149     QString serifFontName() const;
00150     QString sansSerifFontName() const;
00151     QString cursiveFontName() const;
00152     QString fantasyFontName() const;
00153 
00154     // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...)
00155     void setStdFontName(const QString &n);
00156     void setFixedFontName(const QString &n);
00157 
00158     int minFontSize() const;
00159     int mediumFontSize() const;
00160 
00161     bool jsErrorsEnabled() const;
00162     void setJSErrorsEnabled(bool enabled);
00163 
00164     const QString &encoding() const;
00165 
00166     bool followSystemColors() const;
00167 
00168     // Color settings
00169     const QColor& textColor() const;
00170     const QColor& baseColor() const;
00171     const QColor& linkColor() const;
00172     const QColor& vLinkColor() const;
00173 
00174     // Autoload images
00175     bool autoLoadImages() const;
00176     bool unfinishedImageFrame() const;
00177 
00178     bool isOpenMiddleClickEnabled();
00179     bool isBackRightClickEnabled();
00180 
00181     // Java and JavaScript
00182     bool isJavaEnabled( const QString& hostname = QString() ) const;
00183     bool isJavaScriptEnabled( const QString& hostname = QString() ) const;
00184     bool isJavaScriptDebugEnabled( const QString& hostname = QString() ) const;
00185     bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString() ) const;
00186     bool isPluginsEnabled( const QString& hostname = QString() ) const;
00187 
00188     // AdBlocK Filtering
00189     bool isAdFiltered( const QString &url ) const;
00190     bool isAdFilterEnabled() const;
00191     bool isHideAdsEnabled() const;
00192     void addAdFilter( const QString &url );
00193 
00194     // Access Keys
00195     bool accessKeysEnabled() const;
00196 
00197     KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString() ) const;
00198     KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString() ) const;
00199     KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString() ) const;
00200     KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString() ) const;
00201     KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString() ) const;
00202 
00203     // helpers for parsing domain-specific configuration, used in KControl module as well
00204     static KJavaScriptAdvice strToAdvice(const QString& _str);
00205     static void splitDomainAdvice(const QString& configStr, QString &domain,
00206                   KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice);
00207     static const char* adviceToStr(KJavaScriptAdvice _advice);
00208 
00217     void readDomainSettings(const KConfigGroup &config, bool reset,
00218             bool global, KPerDomainSettings &pd_settings);
00219 
00220     QString settingsToCSS() const;
00221     static const QString &availableFamilies();
00222 
00223     QString userStyleSheet() const;
00224 
00225     // Form completion
00226     bool isFormCompletionEnabled() const;
00227     int maxFormCompletionItems() const;
00228 
00229     // Meta refresh/redirect (http-equiv)
00230     bool isAutoDelayedActionsEnabled () const;
00231 
00232     QList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const;
00233 
00234     // Whether to show passive popup when windows are blocked
00235     void setJSPopupBlockerPassivePopup(bool enabled);
00236     bool jsPopupBlockerPassivePopup() const;
00237 
00238 private:
00239     friend class KHTMLGlobal;
00240     QString lookupFont(int i) const;
00241 
00242     KHTMLSettingsPrivate* const d;
00243     static QString *avFamilies;
00244 };
00245 
00246 #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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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