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 #include <kparts/htmlextension.h> 00028 00029 #include <QtGui/QColor> 00030 #include <QtGui/QFont> // ### KDE 5: remove 00031 #include <QtCore/QMap> // ### KDE 5: remove 00032 #include <QtCore/QStringList> 00033 #include <QtCore/QPair> 00034 00035 struct KPerDomainSettings; 00036 class KHTMLSettingsPrivate; 00037 00041 class KHTML_EXPORT KHTMLSettings 00042 { 00043 public: 00044 00048 enum KJavaScriptAdvice { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JavaScriptAdvice instead 00049 KJavaScriptDunno=0, 00050 KJavaScriptAccept, 00051 KJavaScriptReject 00052 }; 00053 00054 enum KAnimationAdvice { 00055 KAnimationDisabled=0, 00056 KAnimationLoopOnce, 00057 KAnimationEnabled 00058 }; 00059 00060 enum KSmoothScrollingMode { 00061 KSmoothScrollingDisabled=0, 00062 KSmoothScrollingWhenEfficient, 00063 KSmoothScrollingEnabled 00064 }; 00065 00066 enum KDNSPrefetch { 00067 KDNSPrefetchDisabled=0, 00068 KDNSPrefetchOnlyWWWAndSLD, 00069 KDNSPrefetchEnabled 00070 }; 00071 00075 enum KJSWindowOpenPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowOpenPolicy instead. 00076 KJSWindowOpenAllow=0, 00077 KJSWindowOpenAsk, 00078 KJSWindowOpenDeny, 00079 KJSWindowOpenSmart 00080 }; 00081 00085 enum KJSWindowStatusPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy instead. 00086 KJSWindowStatusAllow=0, 00087 KJSWindowStatusIgnore 00088 }; 00089 00093 enum KJSWindowMovePolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowMovePolicy instead. 00094 KJSWindowMoveAllow=0, 00095 KJSWindowMoveIgnore 00096 }; 00097 00101 enum KJSWindowResizePolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy insead. 00102 KJSWindowResizeAllow=0, 00103 KJSWindowResizeIgnore 00104 }; 00105 00109 enum KJSWindowFocusPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy instead. 00110 KJSWindowFocusAllow=0, 00111 KJSWindowFocusIgnore 00112 }; 00113 00117 KHTMLSettings(); 00118 KHTMLSettings(const KHTMLSettings &other); 00119 00123 void init(); 00124 00130 void init( KConfig * config, bool reset = true ); 00131 00135 virtual ~KHTMLSettings(); 00136 00137 // Behavior settings 00138 bool changeCursor() const; 00139 bool underlineLink() const; 00140 bool hoverLink() const; 00141 bool allowTabulation() const; 00142 bool autoSpellCheck() const; 00143 KAnimationAdvice showAnimations() const; 00144 KSmoothScrollingMode smoothScrolling() const; 00145 KDNSPrefetch dnsPrefetch() const; 00146 00147 // Font settings 00148 QString stdFontName() const; 00149 QString fixedFontName() const; 00150 QString serifFontName() const; 00151 QString sansSerifFontName() const; 00152 QString cursiveFontName() const; 00153 QString fantasyFontName() const; 00154 00155 // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...) 00156 void setStdFontName(const QString &n); 00157 void setFixedFontName(const QString &n); 00158 00159 int minFontSize() const; 00160 int mediumFontSize() const; 00161 00162 bool jsErrorsEnabled() const; 00163 void setJSErrorsEnabled(bool enabled); 00164 00165 const QString &encoding() const; 00166 00167 bool followSystemColors() const; 00168 00169 // Color settings 00170 const QColor& textColor() const; 00171 const QColor& baseColor() const; 00172 const QColor& linkColor() const; 00173 const QColor& vLinkColor() const; 00174 00175 // Autoload images 00176 bool autoLoadImages() const; 00177 bool unfinishedImageFrame() const; 00178 00179 bool isOpenMiddleClickEnabled(); 00181 bool isBackRightClickEnabled(); 00182 00183 // Java and JavaScript 00184 bool isJavaEnabled( const QString& hostname = QString() ) const; 00185 bool isJavaScriptEnabled( const QString& hostname = QString() ) const; 00186 bool isJavaScriptDebugEnabled( const QString& hostname = QString() ) const; 00187 bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString() ) const; 00188 bool isPluginsEnabled( const QString& hostname = QString() ) const; 00189 00190 // AdBlocK Filtering 00191 00196 bool isAdFiltered( const QString &url ) const; 00197 00206 QString adFilteredBy( const QString &url, bool *isWhiteListed = 0 ) const; 00207 00208 bool isAdFilterEnabled() const; 00209 bool isHideAdsEnabled() const; 00210 void addAdFilter( const QString &url ); 00211 00212 // Access Keys 00213 bool accessKeysEnabled() const; 00214 00215 // ### KDE 5: Replace KJSWindowOpenPolicy with KParts::HtmlSettingsInterface::JSWindowOpenPolicy 00216 KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString() ) const; 00217 KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString() ) const; 00218 KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString() ) const; 00219 KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString() ) const; 00220 KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString() ) const; 00221 00222 // helpers for parsing domain-specific configuration, used in KControl module as well 00223 // ### KDE 5: Replace KJavaScriptAdvice with KParts::HtmlSettingsInterface::JavaScriptAdvice. 00224 // ### KDE 5: Remove ? Equivalent functions now exist in KParts::HtmlSettingsInterface. 00225 static KJavaScriptAdvice strToAdvice(const QString& _str); 00226 static void splitDomainAdvice(const QString& configStr, QString &domain, 00227 KJavaScriptAdvice &javaAdvice, 00228 KJavaScriptAdvice& javaScriptAdvice); 00229 static const char* adviceToStr(KJavaScriptAdvice _advice); 00230 00239 void readDomainSettings(const KConfigGroup &config, bool reset, 00240 bool global, KPerDomainSettings &pd_settings); 00241 00242 QString settingsToCSS() const; 00243 static const QString &availableFamilies(); 00244 00245 QString userStyleSheet() const; 00246 00247 // Form completion 00248 bool isFormCompletionEnabled() const; 00249 int maxFormCompletionItems() const; 00250 00251 // Meta refresh/redirect (http-equiv) 00252 bool isAutoDelayedActionsEnabled () const; 00253 00254 QList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const; 00255 00256 // Whether to show passive popup when windows are blocked 00257 void setJSPopupBlockerPassivePopup(bool enabled); 00258 bool jsPopupBlockerPassivePopup() const; 00259 00260 private: 00261 friend class KHTMLGlobal; 00262 QString lookupFont(int i) const; 00263 00264 KHTMLSettingsPrivate* const d; 00265 static QString *avFamilies; 00266 }; 00267 00268 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:38:19 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:38:19 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.