37 #include <QtGui/QFontDatabase>
44 struct KPerDomainSettings {
45 bool m_bEnableJava : 1;
46 bool m_bEnableJavaScript : 1;
47 bool m_bEnablePlugins : 1;
57 kDebug() <<
"KPerDomainSettings " << infix <<
" @" <<
this <<
":";
58 kDebug() <<
" m_bEnableJava: " << m_bEnableJava;
59 kDebug() <<
" m_bEnableJavaScript: " << m_bEnableJavaScript;
60 kDebug() <<
" m_bEnablePlugins: " << m_bEnablePlugins;
61 kDebug() <<
" m_windowOpenPolicy: " << m_windowOpenPolicy;
62 kDebug() <<
" m_windowStatusPolicy: " << m_windowStatusPolicy;
63 kDebug() <<
" m_windowFocusPolicy: " << m_windowFocusPolicy;
64 kDebug() <<
" m_windowMovePolicy: " << m_windowMovePolicy;
65 kDebug() <<
" m_windowResizePolicy: " << m_windowResizePolicy;
70 QString *KHTMLSettings::avFamilies = 0;
74 class KHTMLSettingsData
77 bool m_bChangeCursor : 1;
78 bool m_bOpenMiddleClick : 1;
79 bool m_underlineLink : 1;
81 bool m_bEnableJavaScriptDebug : 1;
82 bool m_bEnableJavaScriptErrorReporting : 1;
83 bool enforceCharset : 1;
84 bool m_bAutoLoadImages : 1;
85 bool m_bUnfinishedImageFrame : 1;
86 bool m_formCompletionEnabled : 1;
87 bool m_autoDelayedActionsEnabled : 1;
88 bool m_jsErrorsEnabled : 1;
89 bool m_follow_system_colors : 1;
90 bool m_allowTabulation : 1;
91 bool m_autoSpellCheck : 1;
92 bool m_adFilterEnabled : 1;
93 bool m_hideAdsEnabled : 1;
94 bool m_jsPopupBlockerPassivePopup : 1;
95 bool m_accessKeysEnabled : 1;
98 KPerDomainSettings global;
102 int m_maxFormCompletionItems;
115 PolicyMap domainPolicy;
124 class KHTMLSettingsPrivate :
public QObject,
public KHTMLSettingsData
129 void adblockFilterLoadList(
const QString& filename)
131 kDebug(6000) <<
"Loading filter list from" << filename;
133 QFile file(filename);
134 if (file.open(QIODevice::ReadOnly)) {
135 QTextStream ts(&file);
138 int whiteCounter = 0, blackCounter = 0;
140 while (!line.isEmpty()) {
142 if (line.startsWith(QLatin1String(
"@@")))
147 adWhiteList.addFilter(line);
154 adBlackList.addFilter(line);
157 line = ts.readLine();
162 kDebug(6000) <<
"Filter list loaded" << whiteCounter <<
"white list entries and" << blackCounter <<
"black list entries";
168 void adblockFilterResult(
KJob *job)
173 if ( tJob->
error() ) {
174 kDebug(6000) <<
"Failed to download" << tJob->url() <<
"with message:" << tJob->
errorText();
176 else if ( tJob->isErrorPage() ) {
177 kDebug(6000) <<
"Failed to fetch filter list" << tJob->url();
180 const QByteArray byteArray = tJob->
data();
181 const QString localFileName = tJob->property(
"khtmlsettings_adBlock_filename" ).toString();
183 QFile file(localFileName);
184 if ( file.open(QFile::WriteOnly) ) {
185 bool success = file.write(byteArray) == byteArray.size();
188 adblockFilterLoadList(localFileName);
190 kDebug(6000) <<
"Could not write" << byteArray.size() <<
"to file" << localFileName;
193 kDebug(6000) <<
"Cannot open file" << localFileName <<
"for filter list";
204 KHTMLSettingsPrivate*
const d,
206 if (domain.isEmpty()) {
207 kWarning(6000) <<
"setup_per_domain_policy: domain is empty";
209 const QString ldomain = domain.toLower();
210 PolicyMap::iterator it = d->domainPolicy.find(ldomain);
211 if (it == d->domainPolicy.end()) {
214 it = d->domainPolicy.insert(ldomain,d->global);
241 bool global, KPerDomainSettings &pd_settings) {
243 : QString::fromLatin1(
"javascript.");
244 QString javaPrefix = global ? QString()
245 : QString::fromLatin1(
"java.");
246 QString pluginsPrefix = global ? QString()
247 : QString::fromLatin1(
"plugins.");
250 QString key = javaPrefix + QLatin1String(
"EnableJava");
251 if ( (global && reset) || config.
hasKey( key ) )
252 pd_settings.m_bEnableJava = config.
readEntry( key,
false );
254 pd_settings.m_bEnableJava = d->global.m_bEnableJava;
257 key = pluginsPrefix + QLatin1String(
"EnablePlugins");
258 if ( (global && reset) || config.
hasKey( key ) )
259 pd_settings.m_bEnablePlugins = config.
readEntry( key,
true );
261 pd_settings.m_bEnablePlugins = d->global.m_bEnablePlugins;
264 key = jsPrefix + QLatin1String(
"EnableJavaScript");
265 if ( (global && reset) || config.
hasKey( key ) )
266 pd_settings.m_bEnableJavaScript = config.
readEntry( key,
true );
268 pd_settings.m_bEnableJavaScript = d->global.m_bEnableJavaScript;
271 key = jsPrefix + QLatin1String(
"WindowOpenPolicy");
272 if ( (global && reset) || config.
hasKey( key ) )
276 pd_settings.m_windowOpenPolicy = d->global.m_windowOpenPolicy;
278 key = jsPrefix + QLatin1String(
"WindowMovePolicy");
279 if ( (global && reset) || config.
hasKey( key ) )
283 pd_settings.m_windowMovePolicy = d->global.m_windowMovePolicy;
285 key = jsPrefix + QLatin1String(
"WindowResizePolicy");
286 if ( (global && reset) || config.
hasKey( key ) )
290 pd_settings.m_windowResizePolicy = d->global.m_windowResizePolicy;
292 key = jsPrefix + QLatin1String(
"WindowStatusPolicy");
293 if ( (global && reset) || config.
hasKey( key ) )
297 pd_settings.m_windowStatusPolicy = d->global.m_windowStatusPolicy;
299 key = jsPrefix + QLatin1String(
"WindowFocusPolicy");
300 if ( (global && reset) || config.
hasKey( key ) )
304 pd_settings.m_windowFocusPolicy = d->global.m_windowFocusPolicy;
310 :
d (new KHTMLSettingsPrivate())
316 :
d(new KHTMLSettingsPrivate())
318 KHTMLSettingsData* data = d;
329 return d->m_bChangeCursor;
334 return d->m_underlineLink;
339 return d->m_hoverLink;
345 init( &global,
true );
357 if (reset || cg.
exists() )
359 if ( reset || cg.
hasKey(
"OpenMiddleClick" ) )
360 d->m_bOpenMiddleClick = cg.
readEntry(
"OpenMiddleClick",
true );
364 if (reset || cgAccess.
exists() ) {
365 d->m_accessKeysEnabled = cgAccess.
readEntry(
"Enabled",
true );
370 if (reset || cgFilter.
exists() )
372 d->m_adFilterEnabled = cgFilter.
readEntry(
"Enabled",
false);
373 d->m_hideAdsEnabled = cgFilter.
readEntry(
"Shrink",
false);
375 d->adBlackList.clear();
376 d->adWhiteList.clear();
378 if (d->m_adFilterEnabled) {
381 int htmlFilterListMaxAgeDays = cgFilter.
readEntry(
QString(
"HTMLFilterListMaxAgeDays")).toInt();
382 if (htmlFilterListMaxAgeDays < 1)
383 htmlFilterListMaxAgeDays = 1;
387 for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it )
393 if (name.startsWith(
"Filter"))
395 if (url.startsWith(QLatin1String(
"@@")))
396 d->adWhiteList.addFilter(url);
398 d->adBlackList.addFilter(url);
399 }
else if (name.startsWith(
"HTMLFilterListName-") && (
id = name.mid(19).toInt()) > 0)
402 bool filterEnabled = cgFilter.
readEntry(
QString(
"HTMLFilterListEnabled-").append(QString::number(
id))) != QLatin1String(
"false");
407 if (filterEnabled && url.isValid()) {
413 QFileInfo fileInfo(localFile);
416 if (fileInfo.exists())
417 d->adblockFilterLoadList( localFile );
420 if (!fileInfo.exists() || fileInfo.lastModified().daysTo(QDateTime::currentDateTime()) > htmlFilterListMaxAgeDays)
423 kDebug(6000) <<
"Asynchronously fetching filter list from" << url <<
"to" << localFile;
426 QObject::connect( job, SIGNAL(result(
KJob*)), d, SLOT(adblockFilterResult(
KJob*)) );
428 job->setProperty(
"khtmlsettings_adBlock_filename", localFile);
438 if (reset || cgHtml.
exists() )
449 d->defaultFonts.append(
QString(
"0" ) );
452 if ( reset || cgHtml.
hasKey(
"MinimumFontSize" ) )
455 if ( reset || cgHtml.
hasKey(
"MediumFontSize" ) )
456 d->m_fontSize = cgHtml.
readEntry(
"MediumFontSize", 12 );
460 if ( reset || cgHtml.
hasKey(
"DefaultEncoding" ) )
461 d->m_encoding = cgHtml.
readEntry(
"DefaultEncoding",
"" );
463 if ( reset || cgHtml.
hasKey(
"EnforceDefaultCharset" ) )
464 d->enforceCharset = cgHtml.
readEntry(
"EnforceDefaultCharset",
false );
467 if ( reset || cgHtml.
hasKey(
"ChangeCursor" ) )
470 if ( reset || cgHtml.
hasKey(
"UnderlineLinks") )
471 d->m_underlineLink = cgHtml.
readEntry(
"UnderlineLinks",
true );
473 if ( reset || cgHtml.
hasKey(
"HoverLinks" ) )
475 if ( (d->m_hoverLink = cgHtml.
readEntry(
"HoverLinks",
false )))
476 d->m_underlineLink =
false;
479 if ( reset || cgHtml.
hasKey(
"AllowTabulation" ) )
480 d->m_allowTabulation = cgHtml.
readEntry(
"AllowTabulation",
false );
482 if ( reset || cgHtml.
hasKey(
"AutoSpellCheck" ) )
483 d->m_autoSpellCheck = cgHtml.
readEntry(
"AutoSpellCheck",
true );
486 if ( reset || cgHtml.
hasKey(
"AutoLoadImages" ) )
487 d->m_bAutoLoadImages = cgHtml.
readEntry(
"AutoLoadImages",
true );
489 if ( reset || cgHtml.
hasKey(
"UnfinishedImageFrame" ) )
490 d->m_bUnfinishedImageFrame = cgHtml.
readEntry(
"UnfinishedImageFrame",
true );
492 if ( reset || cgHtml.
hasKey(
"ShowAnimations" ) )
495 if (value ==
"disabled")
497 else if (value ==
"looponce")
503 if ( reset || cgHtml.
hasKey(
"SmoothScrolling" ) )
505 QString value = cgHtml.
readEntry(
"SmoothScrolling",
"whenefficient" ).toLower();
506 if (value ==
"disabled")
508 else if (value ==
"whenefficient")
514 if ( reset || cgHtml.
hasKey(
"DNSPrefetch" ) )
518 if (value ==
"enabled")
520 else if (value ==
"onlywwwandsld")
526 if ( cgHtml.
readEntry(
"UserStyleSheetEnabled",
false ) == true ) {
527 if ( reset || cgHtml.
hasKey(
"UserStyleSheet" ) )
528 d->m_userSheet = cgHtml.
readEntry(
"UserStyleSheet",
"" );
531 d->m_formCompletionEnabled = cgHtml.
readEntry(
"FormCompletion",
true);
532 d->m_maxFormCompletionItems = cgHtml.
readEntry(
"MaxFormCompletionItems", 10);
533 d->m_autoDelayedActionsEnabled = cgHtml.
readEntry (
"AutoDelayedActions",
true);
534 d->m_jsErrorsEnabled = cgHtml.
readEntry(
"ReportJSErrors",
true);
536 d->m_fallbackAccessKeysAssignments.clear();
537 for( QStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it )
538 if( (*it).length() > 2 && (*it)[ 1 ] ==
':' )
539 d->m_fallbackAccessKeysAssignments.append( qMakePair( (*it).mid( 2 ), (*it)[ 0 ] ));
544 if ( reset || cg.
hasKey(
"FollowSystemColors" ) )
545 d->m_follow_system_colors = cg.
readEntry(
"FollowSystemColors",
false );
548 if ( reset || cgGeneral.
exists( ) )
550 if ( reset || cgGeneral.
hasKey(
"foreground" ) ) {
552 d->m_textColor = cgGeneral.
readEntry(
"foreground", def );
555 if ( reset || cgGeneral.
hasKey(
"linkColor" ) ) {
557 d->m_linkColor = cgGeneral.
readEntry(
"linkColor", def );
560 if ( reset || cgGeneral.
hasKey(
"visitedLinkColor" ) ) {
562 d->m_vLinkColor = cgGeneral.
readEntry(
"visitedLinkColor", def);
565 if ( reset || cgGeneral.
hasKey(
"background" ) ) {
567 d->m_baseColor = cgGeneral.
readEntry(
"background", def);
571 KConfigGroup cgJava( config,
"Java/JavaScript Settings" );
572 if( reset || cgJava.
exists() )
576 if ( reset || cgJava.
hasKey(
"EnableJavaScriptDebug" ) )
577 d->m_bEnableJavaScriptDebug = cgJava.
readEntry(
"EnableJavaScriptDebug",
false );
580 if ( reset || cgJava.
hasKey(
"ReportJavaScriptErrors" ) )
581 d->m_bEnableJavaScriptErrorReporting = cgJava.
readEntry(
"ReportJavaScriptErrors",
false );
584 if ( reset || cgJava.
hasKey(
"PopupBlockerPassivePopup" ) )
585 d->m_jsPopupBlockerPassivePopup = cgJava.
readEntry(
"PopupBlockerPassivePopup",
true );
589 #ifdef DEBUG_SETTINGS
590 d->global.dump(
"init global");
595 static const char *
const domain_keys[] = {
596 "ECMADomains",
"JavaDomains",
"PluginDomains"
598 bool check_old_ecma_settings =
true;
599 bool check_old_java_settings =
true;
602 for (
unsigned i = 0; i <
sizeof domain_keys/
sizeof domain_keys[0]; ++i) {
603 if ( reset || cgJava.
hasKey(domain_keys[i]) ) {
604 if (i == 0) check_old_ecma_settings =
false;
605 else if (i == 1) check_old_java_settings =
false;
608 QStringList::ConstIterator it = dl.begin();
609 const QStringList::ConstIterator itEnd = dl.end();
610 for (; it != itEnd; ++it) {
611 const QString domain = (*it).toLower();
613 if (pos == notfound) domainList.insert(domain,0);
619 d->domainPolicy.clear();
624 for ( ; it != itEnd; ++it)
626 const QString domain = it.key();
629 #ifdef DEBUG_SETTINGS
630 d->domainPolicy[domain].dump(
"init "+domain);
635 bool check_old_java =
true;
636 if( ( reset || cgJava.
hasKey(
"JavaDomainSettings" ) )
637 && check_old_java_settings )
639 check_old_java =
false;
641 QStringList::ConstIterator it = domainList.constBegin();
642 const QStringList::ConstIterator itEnd = domainList.constEnd();
643 for ( ; it != itEnd; ++it)
651 #ifdef DEBUG_SETTINGS
657 bool check_old_ecma =
true;
658 if( ( reset || cgJava.
hasKey(
"ECMADomainSettings" ) )
659 && check_old_ecma_settings )
661 check_old_ecma =
false;
663 QStringList::ConstIterator it = domainList.constBegin();
664 const QStringList::ConstIterator itEnd = domainList.constEnd();
665 for ( ; it != itEnd; ++it)
673 #ifdef DEBUG_SETTINGS
679 if( ( reset || cgJava.
hasKey(
"JavaScriptDomainAdvice" ) )
680 && ( check_old_java || check_old_ecma )
681 && ( check_old_ecma_settings || check_old_java_settings ) )
684 QStringList::ConstIterator it = domainList.constBegin();
685 const QStringList::ConstIterator itEnd = domainList.constEnd();
686 for ( ; it != itEnd; ++it)
698 #ifdef DEBUG_SETTINGS
708 PolicyMap::Iterator it;
709 for( it = d->javaDomainPolicy.begin(); it != d->javaDomainPolicy.end(); ++it )
713 domainConfig.append(QString::fromLatin1(
"%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy));
715 cg.
writeEntry(
"JavaDomainSettings", domainConfig );
721 PolicyMap::Iterator it;
722 for( it = d->javaScriptDomainPolicy.begin(); it != d->javaScriptDomainPolicy.end(); ++it )
725 QByteArray javaScriptPolicy =
adviceToStr( it.value() );
726 domainConfig.append(QString::fromLatin1(
"%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy));
728 cg.
writeEntry(
"ECMADomainSettings", domainConfig );
741 const KHTMLSettingsPrivate*
const d,
744 #ifdef DEBUG_SETTINGS
745 kDebug() <<
"lookup_hostname_policy(" << hostname <<
")";
747 if (hostname.isEmpty()) {
748 #ifdef DEBUG_SETTINGS
749 d->global.dump(
"global");
754 const PolicyMap::const_iterator notfound = d->domainPolicy.constEnd();
757 PolicyMap::const_iterator it = d->domainPolicy.find(hostname);
758 if( it != notfound ) {
759 #ifdef DEBUG_SETTINGS
760 kDebug() <<
"perfect match";
761 (*it).dump(hostname);
771 while( (dot_idx = host_part.indexOf(QChar(
'.'))) >= 0 ) {
772 host_part.remove(0,dot_idx);
773 it = d->domainPolicy.find(host_part);
774 Q_ASSERT(notfound == d->domainPolicy.end());
775 if( it != notfound ) {
776 #ifdef DEBUG_SETTINGS
777 kDebug() <<
"partial match";
778 (*it).dump(host_part);
783 host_part.remove(0,1);
787 #ifdef DEBUG_SETTINGS
789 d->global.dump(
"global");
796 return d->m_bOpenMiddleClick;
806 return d->m_accessKeysEnabled;
811 return d->m_adFilterEnabled;
816 return d->m_hideAdsEnabled;
821 if (d->m_adFilterEnabled)
823 if (!url.startsWith(
"data:"))
826 return d->adBlackList.isUrlMatched(url) && !d->adWhiteList.isUrlMatched(url);
834 QString m = d->adWhiteList.urlMatchedBy(url);
837 if (isWhiteListed != 0)
838 *isWhiteListed =
true;
842 m = d->adBlackList.urlMatchedBy(url);
845 if (isWhiteListed != 0)
846 *isWhiteListed =
false;
861 if (url.length()>2 && url[0]==
'/' && url[url.length()-1] ==
'/')
863 QString inside = url.mid(1, url.length()-2);
864 rx.setPattern(inside);
868 rx.setPatternSyntax(QRegExp::Wildcard);
875 QString key =
"Filter-" + QString::number(last);
879 if (url.startsWith(QLatin1String(
"@@")))
880 d->adWhiteList.addFilter(url);
882 d->adBlackList.addFilter(url);
888 i18n(
"Filter error"));
905 return d->m_bEnableJavaScriptDebug;
911 return d->m_bEnableJavaScriptErrorReporting;
920 const QString& hostname)
const {
925 const QString& hostname)
const {
930 const QString& hostname)
const {
935 const QString& hostname)
const {
940 const QString& hostname)
const {
946 return d->m_fontSize;
951 return d->m_minFontSize;
957 QString str =
"a:link {\ncolor: ";
958 str += d->m_linkColor.name();
960 if(d->m_underlineLink)
961 str +=
"\ntext-decoration: underline;";
963 if( d->m_bChangeCursor )
965 str +=
"\ncursor: pointer;";
966 str +=
"\n}\ninput[type=image] { cursor: pointer;";
969 str +=
"a:visited {\ncolor: ";
970 str += d->m_vLinkColor.name();
972 if(d->m_underlineLink)
973 str +=
"\ntext-decoration: underline;";
975 if( d->m_bChangeCursor )
976 str +=
"\ncursor: pointer;";
980 str +=
"a:link:hover, a:visited:hover { text-decoration: underline; }\n";
992 QRegExp foundryExp(
" \\[.+\\]");
995 QStringList::Iterator f = families.begin();
996 const QStringList::Iterator fEnd = families.end();
998 for ( ; f != fEnd; ++f ) {
999 (*f).replace( foundryExp,
"");
1000 if (!s.contains(*f))
1005 *avFamilies =
',' + s.join(
",") +
',';
1011 QString KHTMLSettings::lookupFont(
int i)
const
1014 if (d->fonts.count() > i)
1017 font = d->defaultFonts[i];
1023 return lookupFont(0);
1028 return lookupFont(1);
1033 return lookupFont(2);
1038 return lookupFont(3);
1043 return lookupFont(4);
1048 return lookupFont(5);
1053 while(d->fonts.count() <= 0)
1060 while(d->fonts.count() <= 1)
1067 return d->m_userSheet;
1072 return d->m_formCompletionEnabled;
1077 return d->m_maxFormCompletionItems;
1082 return d->m_encoding;
1087 return d->m_follow_system_colors;
1092 return d->m_textColor;
1097 return d->m_baseColor;
1102 return d->m_linkColor;
1107 return d->m_vLinkColor;
1112 return d->m_bAutoLoadImages;
1117 return d->m_bUnfinishedImageFrame;
1122 return d->m_showAnimations;
1127 return d->m_smoothScrolling;
1132 return d->m_dnsPrefetch;
1137 return d->m_autoDelayedActionsEnabled;
1142 return d->m_jsErrorsEnabled;
1147 d->m_jsErrorsEnabled =
enabled;
1156 return d->m_allowTabulation;
1161 return d->m_autoSpellCheck;
1166 return d->m_fallbackAccessKeysAssignments;
1171 d->m_jsPopupBlockerPassivePopup =
enabled;
1174 cg.
writeEntry(
"PopupBlockerPassivePopup", enabled);
1180 return d->m_jsPopupBlockerPassivePopup;
1183 #include "khtml_settings.moc"
bool isHideAdsEnabled() const
Settings for the HTML view.
QString i18n(const char *text)
QString fantasyFontName() const
bool changeCursor() const
QString sansSerifFontName() const
QList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const
bool isFormCompletionEnabled() const
#define HTML_DEFAULT_VIEW_SERIF_FONT
bool isJavaScriptDebugEnabled(const QString &hostname=QString()) const
void setFixedFontName(const QString &n)
bool isAdFilterEnabled() const
int maxFormCompletionItems() const
void setJSErrorsEnabled(bool enabled)
static void splitDomainAdvice(const QString &text, QString &domain, JavaScriptAdvice &javaAdvice, JavaScriptAdvice &javaScriptAdvice)
static KPerDomainSettings & setup_per_domain_policy(KHTMLSettingsPrivate *const d, const QString &domain)
Returns a writeable per-domains settings instance for the given domain or a deep copy of the global s...
QString adFilteredBy(const QString &url, bool *isWhiteListed=0) const
identify the filter which matches url.
#define HTML_DEFAULT_VLNK_COLOR
QString settingsToCSS() const
static const QString & availableFamilies()
KJSWindowStatusPolicy windowStatusPolicy(const QString &hostname=QString()) const
bool autoLoadImages() const
const char * name(StandardAction id)
void readDomainSettings(const KConfigGroup &config, bool reset, bool global, KPerDomainSettings &pd_settings)
reads from config's current group, forcing initialization if reset is true.
bool isJavaEnabled(const QString &hostname=QString()) const
KConfigGroup group(const QByteArray &group)
const QColor & linkColor() const
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
static const char * adviceToStr(KJavaScriptAdvice _advice)
bool isJavaScriptEnabled(const QString &hostname=QString()) const
const QColor & textColor() const
virtual ~KHTMLSettings()
Destructor.
KJSWindowMovePolicy
This enum specifies the policy for window.moveBy and .moveTo.
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KSmoothScrollingMode smoothScrolling() const
bool followSystemColors() const
void setStdFontName(const QString &n)
QString fixedFontName() const
QString serifFontName() const
const QString & encoding() const
KSharedConfigPtr config()
static const KPerDomainSettings & lookup_hostname_policy(const KHTMLSettingsPrivate *const d, const QString &hostname)
Local helper for retrieving per-domain settings.
bool isBackRightClickEnabled()
KJSWindowOpenPolicy windowOpenPolicy(const QString &hostname=QString()) const
bool isAdFiltered(const QString &url) const
tests whether url is filtered.
#define KDE_DEFAULT_CHANGECURSOR
#define HTML_DEFAULT_VIEW_CURSIVE_FONT
bool isOpenMiddleClickEnabled()
KJSWindowMovePolicy windowMovePolicy(const QString &hostname=QString()) const
if(yyss+yystacksize-1<=yyssp)
bool jsPopupBlockerPassivePopup() const
KJSWindowStatusPolicy
This enum specifies the policy for window.status and .defaultStatus.
StoredTransferJob * storedGet(const KUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
void addAdFilter(const QString &url)
bool isJavaScriptErrorReportingEnabled(const QString &hostname=QString()) const
KAnimationAdvice showAnimations() const
bool accessKeysEnabled() const
bool jsErrorsEnabled() const
bool hasKey(const QString &key) const
static JavaScriptAdvice textToJavascriptAdvice(const QString &text)
bool autoSpellCheck() const
QMap< QString, KPerDomainSettings > PolicyMap
QString userStyleSheet() const
static QFont generalFont()
bool underlineLink() const
#define HTML_DEFAULT_MIN_FONT_SIZE
void setJSPopupBlockerPassivePopup(bool enabled)
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
int mediumFontSize() const
static KJavaScriptAdvice strToAdvice(const QString &_str)
QString stdFontName() const
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
#define HTML_DEFAULT_BASE_COLOR
KJSWindowOpenPolicy
This enum specifies the policy for window.open.
bool allowTabulation() const
static const char * javascriptAdviceToText(JavaScriptAdvice advice)
void init()
Called by constructor and reparseConfiguration.
bool isPluginsEnabled(const QString &hostname=QString()) const
KJSWindowResizePolicy windowResizePolicy(const QString &hostname=QString()) const
const QColor & baseColor() const
#define HTML_DEFAULT_VIEW_SANSSERIF_FONT
#define HTML_DEFAULT_TXT_COLOR
bool unfinishedImageFrame() const
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
const QColor & vLinkColor() const
KJavaScriptAdvice
This enum specifies whether Java/JavaScript execution is allowed.
static void splitDomainAdvice(const QString &configStr, QString &domain, KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice &javaScriptAdvice)
#define HTML_DEFAULT_VIEW_FANTASY_FONT
T readEntry(const QString &key, const T &aDefault) const
bool isAutoDelayedActionsEnabled() const
static bool enabled(KHTMLPart *)
KJSWindowResizePolicy
This enum specifies the policy for window.resizeBy and .resizeTo.
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
QMap< QString, QString > entryMap() const
QString cursiveFontName() const
QString errorText() const
#define HTML_DEFAULT_LNK_COLOR
KJSWindowFocusPolicy
This enum specifies the policy for window.focus.
KDNSPrefetch dnsPrefetch() const
KJSWindowFocusPolicy windowFocusPolicy(const QString &hostname=QString()) const