khtml Library API Documentation

khtml_settings.h

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., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef __konq_htmlsettings_h__ 00021 #define __konq_htmlsettings_h__ 00022 00023 class KConfig; 00024 #include <qcolor.h> 00025 #include <qstring.h> 00026 #include <qstringlist.h> 00027 #include <qfont.h> 00028 #include <qmap.h> 00029 00030 struct KPerDomainSettings; 00031 class KHTMLSettingsPrivate; 00032 00036 class KHTMLSettings 00037 { 00038 public: 00039 00043 enum KJavaScriptAdvice { 00044 KJavaScriptDunno=0, 00045 KJavaScriptAccept, 00046 KJavaScriptReject 00047 }; 00048 00049 enum KAnimationAdvice { 00050 KAnimationDisabled=0, 00051 KAnimationLoopOnce, 00052 KAnimationEnabled 00053 }; 00054 00058 enum KJSWindowOpenPolicy { 00059 KJSWindowOpenAllow=0, 00060 KJSWindowOpenAsk, 00061 KJSWindowOpenDeny, 00062 KJSWindowOpenSmart 00063 }; 00064 00068 enum KJSWindowStatusPolicy { 00069 KJSWindowStatusAllow=0, 00070 KJSWindowStatusIgnore 00071 }; 00072 00076 enum KJSWindowMovePolicy { 00077 KJSWindowMoveAllow=0, 00078 KJSWindowMoveIgnore 00079 }; 00080 00084 enum KJSWindowResizePolicy { 00085 KJSWindowResizeAllow=0, 00086 KJSWindowResizeIgnore 00087 }; 00088 00092 enum KJSWindowFocusPolicy { 00093 KJSWindowFocusAllow=0, 00094 KJSWindowFocusIgnore 00095 }; 00096 00100 KHTMLSettings(); 00101 KHTMLSettings(const KHTMLSettings &other); 00102 00106 void init(); 00107 00112 void init( KConfig * config, bool reset = true ); 00113 00117 virtual ~KHTMLSettings(); 00118 00119 // Behavior settings 00120 bool changeCursor() const; 00121 bool underlineLink() const; 00122 bool hoverLink() const; 00123 KAnimationAdvice showAnimations() const; 00124 00125 // Font settings 00126 QString stdFontName() const; 00127 QString fixedFontName() const; 00128 QString serifFontName() const; 00129 QString sansSerifFontName() const; 00130 QString cursiveFontName() const; 00131 QString fantasyFontName() const; 00132 00133 // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...) 00134 void setStdFontName(const QString &n); 00135 void setFixedFontName(const QString &n); 00136 00137 int minFontSize() const; 00138 int mediumFontSize() const; 00139 00140 bool jsErrorsEnabled() const; 00141 void setJSErrorsEnabled(bool enabled); 00142 00143 const QString &encoding() const; 00144 00145 // Color settings 00146 const QColor& textColor() const; 00147 const QColor& linkColor() const; 00148 const QColor& vLinkColor() const; 00149 00150 // Autoload images 00151 bool autoLoadImages() const; 00152 00153 bool isBackRightClickEnabled(); 00154 00155 // Java and JavaScript 00156 // ### BIC make these const 00157 bool isJavaEnabled( const QString& hostname = QString::null ); 00158 bool isJavaScriptEnabled( const QString& hostname = QString::null ); 00159 bool isJavaScriptDebugEnabled( const QString& hostname = QString::null ); 00160 bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString::null ) const; 00161 bool isPluginsEnabled( const QString& hostname = QString::null ); 00162 KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString::null ) const; 00163 KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString::null ) const; 00164 KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString::null ) const; 00165 KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString::null ) const; 00166 KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString::null ) const; 00167 00168 // helpers for parsing domain-specific configuration, used in KControl module as well 00169 static KJavaScriptAdvice strToAdvice(const QString& _str); 00170 static void splitDomainAdvice(const QString& configStr, QString &domain, 00171 KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice); 00172 static const char* adviceToStr(KJavaScriptAdvice _advice); 00173 00180 void readDomainSettings(KConfig *config, bool reset, 00181 bool global, KPerDomainSettings &pd_settings); 00182 00183 QString settingsToCSS() const; 00184 static const QString &availableFamilies(); 00185 00186 QString userStyleSheet() const; 00187 00188 // Form completion 00189 bool isFormCompletionEnabled() const; 00190 int maxFormCompletionItems() const; 00191 00192 // Meta refresh/redirect (http-equiv) 00193 bool isAutoDelayedActionsEnabled () const; 00194 00195 private: 00196 friend class KHTMLFactory; 00197 QString lookupFont(int i) const; 00198 00199 KHTMLSettingsPrivate *d; 00200 static QString *avFamilies; 00201 }; 00202 00203 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:09:57 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003