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

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
khtml_settings.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 1999 David Faure <faure@kde.org>
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 
20 #ifndef KHTML_SETTINGS_H
21 #define KHTML_SETTINGS_H
22 
23 class KConfig;
24 class KConfigGroup;
25 
26 #include <khtml_export.h>
27 #include <kparts/htmlextension.h>
28 
29 #include <QtGui/QColor>
30 #include <QtGui/QFont> // ### KDE 5: remove
31 #include <QtCore/QMap> // ### KDE 5: remove
32 #include <QtCore/QStringList>
33 #include <QtCore/QPair>
34 
35 struct KPerDomainSettings;
36 class KHTMLSettingsPrivate;
37 
41 class KHTML_EXPORT KHTMLSettings
42 {
43 public:
44 
48  enum KJavaScriptAdvice { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JavaScriptAdvice instead
49  KJavaScriptDunno=0,
50  KJavaScriptAccept,
51  KJavaScriptReject
52  };
53 
54  enum KAnimationAdvice {
55  KAnimationDisabled=0,
56  KAnimationLoopOnce,
57  KAnimationEnabled
58  };
59 
60  enum KSmoothScrollingMode {
61  KSmoothScrollingDisabled=0,
62  KSmoothScrollingWhenEfficient,
63  KSmoothScrollingEnabled
64  };
65 
66  enum KDNSPrefetch {
67  KDNSPrefetchDisabled=0,
68  KDNSPrefetchOnlyWWWAndSLD,
69  KDNSPrefetchEnabled
70  };
71 
75  enum KJSWindowOpenPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowOpenPolicy instead.
76  KJSWindowOpenAllow=0,
77  KJSWindowOpenAsk,
78  KJSWindowOpenDeny,
79  KJSWindowOpenSmart
80  };
81 
85  enum KJSWindowStatusPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy instead.
86  KJSWindowStatusAllow=0,
87  KJSWindowStatusIgnore
88  };
89 
93  enum KJSWindowMovePolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowMovePolicy instead.
94  KJSWindowMoveAllow=0,
95  KJSWindowMoveIgnore
96  };
97 
101  enum KJSWindowResizePolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy insead.
102  KJSWindowResizeAllow=0,
103  KJSWindowResizeIgnore
104  };
105 
109  enum KJSWindowFocusPolicy { // ### KDE 5: Remove. Use KParts::HtmlSettingsInterface::JSWindowStatusPolicy instead.
110  KJSWindowFocusAllow=0,
111  KJSWindowFocusIgnore
112  };
113 
117  KHTMLSettings();
118  KHTMLSettings(const KHTMLSettings &other);
119 
123  void init();
124 
130  void init( KConfig * config, bool reset = true );
131 
135  virtual ~KHTMLSettings();
136 
137  // Behavior settings
138  bool changeCursor() const;
139  bool underlineLink() const;
140  bool hoverLink() const;
141  bool allowTabulation() const;
142  bool autoSpellCheck() const;
143  KAnimationAdvice showAnimations() const;
144  KSmoothScrollingMode smoothScrolling() const;
145  KDNSPrefetch dnsPrefetch() const;
146 
147  // Font settings
148  QString stdFontName() const;
149  QString fixedFontName() const;
150  QString serifFontName() const;
151  QString sansSerifFontName() const;
152  QString cursiveFontName() const;
153  QString fantasyFontName() const;
154 
155  // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...)
156  void setStdFontName(const QString &n);
157  void setFixedFontName(const QString &n);
158 
159  int minFontSize() const;
160  int mediumFontSize() const;
161 
162  bool jsErrorsEnabled() const;
163  void setJSErrorsEnabled(bool enabled);
164 
165  const QString &encoding() const;
166 
167  bool followSystemColors() const;
168 
169  // Color settings
170  const QColor& textColor() const;
171  const QColor& baseColor() const;
172  const QColor& linkColor() const;
173  const QColor& vLinkColor() const;
174 
175  // Autoload images
176  bool autoLoadImages() const;
177  bool unfinishedImageFrame() const;
178 
179  bool isOpenMiddleClickEnabled();
181  bool isBackRightClickEnabled();
182 
183  // Java and JavaScript
184  bool isJavaEnabled( const QString& hostname = QString() ) const;
185  bool isJavaScriptEnabled( const QString& hostname = QString() ) const;
186  bool isJavaScriptDebugEnabled( const QString& hostname = QString() ) const;
187  bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString() ) const;
188  bool isPluginsEnabled( const QString& hostname = QString() ) const;
189 
190  // AdBlocK Filtering
191 
196  bool isAdFiltered( const QString &url ) const;
197 
206  QString adFilteredBy( const QString &url, bool *isWhiteListed = 0 ) const;
207 
208  bool isAdFilterEnabled() const;
209  bool isHideAdsEnabled() const;
210  void addAdFilter( const QString &url );
211 
212  // Access Keys
213  bool accessKeysEnabled() const;
214 
215  // ### KDE 5: Replace KJSWindowOpenPolicy with KParts::HtmlSettingsInterface::JSWindowOpenPolicy
216  KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString() ) const;
217  KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString() ) const;
218  KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString() ) const;
219  KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString() ) const;
220  KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString() ) const;
221 
222  // helpers for parsing domain-specific configuration, used in KControl module as well
223  // ### KDE 5: Replace KJavaScriptAdvice with KParts::HtmlSettingsInterface::JavaScriptAdvice.
224  // ### KDE 5: Remove ? Equivalent functions now exist in KParts::HtmlSettingsInterface.
225  static KJavaScriptAdvice strToAdvice(const QString& _str);
226  static void splitDomainAdvice(const QString& configStr, QString &domain,
227  KJavaScriptAdvice &javaAdvice,
228  KJavaScriptAdvice& javaScriptAdvice);
229  static const char* adviceToStr(KJavaScriptAdvice _advice);
230 
239  void readDomainSettings(const KConfigGroup &config, bool reset,
240  bool global, KPerDomainSettings &pd_settings);
241 
242  QString settingsToCSS() const;
243  static const QString &availableFamilies();
244 
245  QString userStyleSheet() const;
246 
247  // Form completion
248  bool isFormCompletionEnabled() const;
249  int maxFormCompletionItems() const;
250 
251  // Meta refresh/redirect (http-equiv)
252  bool isAutoDelayedActionsEnabled () const;
253 
254  QList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const;
255 
256  // Whether to show passive popup when windows are blocked
257  void setJSPopupBlockerPassivePopup(bool enabled);
258  bool jsPopupBlockerPassivePopup() const;
259 
260 private:
261  friend class KHTMLGlobal;
262  QString lookupFont(int i) const;
263 
264  KHTMLSettingsPrivate* const d;
265  static QString *avFamilies;
266 };
267 
268 #endif
KHTMLSettings
Settings for the HTML view.
Definition: khtml_settings.h:41
QColor
KHTMLSettings::KSmoothScrollingWhenEfficient
Definition: khtml_settings.h:62
WebCore::SVGNames::init
void init()
Definition: SVGNames.cpp:350
d
#define d
Definition: khtmlfind.cpp:42
KHTMLSettings::KAnimationAdvice
KAnimationAdvice
Definition: khtml_settings.h:54
KHTMLGlobal
Definition: khtml_global.h:49
QString
KHTMLSettings::KJSWindowMovePolicy
KJSWindowMovePolicy
This enum specifies the policy for window.moveBy and .moveTo.
Definition: khtml_settings.h:93
htmlextension.h
KHTMLSettings::KDNSPrefetch
KDNSPrefetch
Definition: khtml_settings.h:66
KHTMLSettings::KJavaScriptAccept
Definition: khtml_settings.h:50
KHTMLSettings::KAnimationLoopOnce
Definition: khtml_settings.h:56
KHTMLSettings::KDNSPrefetchOnlyWWWAndSLD
Definition: khtml_settings.h:68
KHTMLSettings::KJSWindowStatusPolicy
KJSWindowStatusPolicy
This enum specifies the policy for window.status and .defaultStatus.
Definition: khtml_settings.h:85
KConfigGroup
KConfig
khtml_export.h
KHTMLSettings::KSmoothScrollingMode
KSmoothScrollingMode
Definition: khtml_settings.h:60
KHTMLSettings::KJSWindowOpenPolicy
KJSWindowOpenPolicy
This enum specifies the policy for window.open.
Definition: khtml_settings.h:75
KHTMLSettings::KJSWindowOpenDeny
Definition: khtml_settings.h:78
KHTMLSettings::KJSWindowOpenAsk
Definition: khtml_settings.h:77
KHTMLSettings::KJavaScriptAdvice
KJavaScriptAdvice
This enum specifies whether Java/JavaScript execution is allowed.
Definition: khtml_settings.h:48
DOM::enabled
static bool enabled(KHTMLPart *)
Definition: jsediting.cpp:383
KHTMLSettings::KJSWindowResizePolicy
KJSWindowResizePolicy
This enum specifies the policy for window.resizeBy and .resizeTo.
Definition: khtml_settings.h:101
QList
KHTMLSettings::KJSWindowFocusPolicy
KJSWindowFocusPolicy
This enum specifies the policy for window.focus.
Definition: khtml_settings.h:109
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal