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() )
450 d->defaultFonts.append( cgHtml.
readEntry(
"SerifFont", serifFont ) );
451 d->defaultFonts.append( cgHtml.
readEntry(
"SansSerifFont", sansSerifFont ) );
452 d->defaultFonts.append( cgHtml.
readEntry(
"CursiveFont", cursiveFont ) );
453 d->defaultFonts.append( cgHtml.
readEntry(
"FantasyFont", fantasyFont ) );
454 d->defaultFonts.append(
QString(
"0" ) );
457 if ( reset || cgHtml.
hasKey(
"MinimumFontSize" ) )
460 if ( reset || cgHtml.
hasKey(
"MediumFontSize" ) )
461 d->m_fontSize = cgHtml.
readEntry(
"MediumFontSize", 12 );
464 const int fontsListLength = d->fonts.length();
466 for (
int i = 0; i < fontsListLength; ++i) {
467 const QString fontFamily = d->fonts.at(i);
468 if (!fontFamily.isEmpty()) {
469 d->fonts[i] = QFontInfo(
QFont(fontFamily)).family();
474 if ( reset || cgHtml.
hasKey(
"DefaultEncoding" ) )
475 d->m_encoding = cgHtml.
readEntry(
"DefaultEncoding",
"" );
477 if ( reset || cgHtml.
hasKey(
"EnforceDefaultCharset" ) )
478 d->enforceCharset = cgHtml.
readEntry(
"EnforceDefaultCharset",
false );
481 if ( reset || cgHtml.
hasKey(
"ChangeCursor" ) )
484 if ( reset || cgHtml.
hasKey(
"UnderlineLinks") )
485 d->m_underlineLink = cgHtml.
readEntry(
"UnderlineLinks",
true );
487 if ( reset || cgHtml.
hasKey(
"HoverLinks" ) )
489 if ( (d->m_hoverLink = cgHtml.
readEntry(
"HoverLinks",
false )))
490 d->m_underlineLink =
false;
493 if ( reset || cgHtml.
hasKey(
"AllowTabulation" ) )
494 d->m_allowTabulation = cgHtml.
readEntry(
"AllowTabulation",
false );
496 if ( reset || cgHtml.
hasKey(
"AutoSpellCheck" ) )
497 d->m_autoSpellCheck = cgHtml.
readEntry(
"AutoSpellCheck",
true );
500 if ( reset || cgHtml.
hasKey(
"AutoLoadImages" ) )
501 d->m_bAutoLoadImages = cgHtml.
readEntry(
"AutoLoadImages",
true );
503 if ( reset || cgHtml.
hasKey(
"UnfinishedImageFrame" ) )
504 d->m_bUnfinishedImageFrame = cgHtml.
readEntry(
"UnfinishedImageFrame",
true );
506 if ( reset || cgHtml.
hasKey(
"ShowAnimations" ) )
509 if (value ==
"disabled")
511 else if (value ==
"looponce")
517 if ( reset || cgHtml.
hasKey(
"SmoothScrolling" ) )
519 QString value = cgHtml.
readEntry(
"SmoothScrolling",
"whenefficient" ).toLower();
520 if (value ==
"disabled")
522 else if (value ==
"whenefficient")
528 if ( reset || cgHtml.
hasKey(
"DNSPrefetch" ) )
532 if (value ==
"enabled")
534 else if (value ==
"onlywwwandsld")
540 if ( cgHtml.
readEntry(
"UserStyleSheetEnabled",
false ) == true ) {
541 if ( reset || cgHtml.
hasKey(
"UserStyleSheet" ) )
542 d->m_userSheet = cgHtml.
readEntry(
"UserStyleSheet",
"" );
545 d->m_formCompletionEnabled = cgHtml.
readEntry(
"FormCompletion",
true);
546 d->m_maxFormCompletionItems = cgHtml.
readEntry(
"MaxFormCompletionItems", 10);
547 d->m_autoDelayedActionsEnabled = cgHtml.
readEntry (
"AutoDelayedActions",
true);
548 d->m_jsErrorsEnabled = cgHtml.
readEntry(
"ReportJSErrors",
true);
550 d->m_fallbackAccessKeysAssignments.clear();
551 for( QStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it )
552 if( (*it).length() > 2 && (*it)[ 1 ] ==
':' )
553 d->m_fallbackAccessKeysAssignments.append( qMakePair( (*it).mid( 2 ), (*it)[ 0 ] ));
558 if ( reset || cg.
hasKey(
"FollowSystemColors" ) )
559 d->m_follow_system_colors = cg.
readEntry(
"FollowSystemColors",
false );
562 if ( reset || cgGeneral.
exists( ) )
564 if ( reset || cgGeneral.
hasKey(
"foreground" ) ) {
566 d->m_textColor = cgGeneral.
readEntry(
"foreground", def );
569 if ( reset || cgGeneral.
hasKey(
"linkColor" ) ) {
571 d->m_linkColor = cgGeneral.
readEntry(
"linkColor", def );
574 if ( reset || cgGeneral.
hasKey(
"visitedLinkColor" ) ) {
576 d->m_vLinkColor = cgGeneral.
readEntry(
"visitedLinkColor", def);
579 if ( reset || cgGeneral.
hasKey(
"background" ) ) {
581 d->m_baseColor = cgGeneral.
readEntry(
"background", def);
585 KConfigGroup cgJava( config,
"Java/JavaScript Settings" );
586 if( reset || cgJava.
exists() )
590 if ( reset || cgJava.
hasKey(
"EnableJavaScriptDebug" ) )
591 d->m_bEnableJavaScriptDebug = cgJava.
readEntry(
"EnableJavaScriptDebug",
false );
594 if ( reset || cgJava.
hasKey(
"ReportJavaScriptErrors" ) )
595 d->m_bEnableJavaScriptErrorReporting = cgJava.
readEntry(
"ReportJavaScriptErrors",
false );
598 if ( reset || cgJava.
hasKey(
"PopupBlockerPassivePopup" ) )
599 d->m_jsPopupBlockerPassivePopup = cgJava.
readEntry(
"PopupBlockerPassivePopup",
true );
603 #ifdef DEBUG_SETTINGS
604 d->global.dump(
"init global");
609 static const char *
const domain_keys[] = {
610 "ECMADomains",
"JavaDomains",
"PluginDomains"
612 bool check_old_ecma_settings =
true;
613 bool check_old_java_settings =
true;
616 for (
unsigned i = 0; i <
sizeof domain_keys/
sizeof domain_keys[0]; ++i) {
617 if ( reset || cgJava.
hasKey(domain_keys[i]) ) {
618 if (i == 0) check_old_ecma_settings =
false;
619 else if (i == 1) check_old_java_settings =
false;
622 QStringList::ConstIterator it = dl.begin();
623 const QStringList::ConstIterator itEnd = dl.end();
624 for (; it != itEnd; ++it) {
625 const QString domain = (*it).toLower();
627 if (pos == notfound) domainList.insert(domain,0);
633 d->domainPolicy.clear();
638 for ( ; it != itEnd; ++it)
640 const QString domain = it.key();
643 #ifdef DEBUG_SETTINGS
644 d->domainPolicy[domain].dump(
"init "+domain);
649 bool check_old_java =
true;
650 if( ( reset || cgJava.
hasKey(
"JavaDomainSettings" ) )
651 && check_old_java_settings )
653 check_old_java =
false;
655 QStringList::ConstIterator it = domainList.constBegin();
656 const QStringList::ConstIterator itEnd = domainList.constEnd();
657 for ( ; it != itEnd; ++it)
665 #ifdef DEBUG_SETTINGS
671 bool check_old_ecma =
true;
672 if( ( reset || cgJava.
hasKey(
"ECMADomainSettings" ) )
673 && check_old_ecma_settings )
675 check_old_ecma =
false;
677 QStringList::ConstIterator it = domainList.constBegin();
678 const QStringList::ConstIterator itEnd = domainList.constEnd();
679 for ( ; it != itEnd; ++it)
687 #ifdef DEBUG_SETTINGS
693 if( ( reset || cgJava.
hasKey(
"JavaScriptDomainAdvice" ) )
694 && ( check_old_java || check_old_ecma )
695 && ( check_old_ecma_settings || check_old_java_settings ) )
698 QStringList::ConstIterator it = domainList.constBegin();
699 const QStringList::ConstIterator itEnd = domainList.constEnd();
700 for ( ; it != itEnd; ++it)
712 #ifdef DEBUG_SETTINGS
722 PolicyMap::Iterator it;
723 for( it = d->javaDomainPolicy.begin(); it != d->javaDomainPolicy.end(); ++it )
727 domainConfig.append(QString::fromLatin1(
"%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy));
729 cg.
writeEntry(
"JavaDomainSettings", domainConfig );
735 PolicyMap::Iterator it;
736 for( it = d->javaScriptDomainPolicy.begin(); it != d->javaScriptDomainPolicy.end(); ++it )
739 QByteArray javaScriptPolicy =
adviceToStr( it.value() );
740 domainConfig.append(QString::fromLatin1(
"%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy));
742 cg.
writeEntry(
"ECMADomainSettings", domainConfig );
755 const KHTMLSettingsPrivate*
const d,
758 #ifdef DEBUG_SETTINGS
759 kDebug() <<
"lookup_hostname_policy(" << hostname <<
")";
761 if (hostname.isEmpty()) {
762 #ifdef DEBUG_SETTINGS
763 d->global.dump(
"global");
768 const PolicyMap::const_iterator notfound = d->domainPolicy.constEnd();
771 PolicyMap::const_iterator it = d->domainPolicy.find(hostname);
772 if( it != notfound ) {
773 #ifdef DEBUG_SETTINGS
774 kDebug() <<
"perfect match";
775 (*it).dump(hostname);
785 while( (dot_idx = host_part.indexOf(QChar(
'.'))) >= 0 ) {
786 host_part.remove(0,dot_idx);
787 it = d->domainPolicy.find(host_part);
788 Q_ASSERT(notfound == d->domainPolicy.end());
789 if( it != notfound ) {
790 #ifdef DEBUG_SETTINGS
791 kDebug() <<
"partial match";
792 (*it).dump(host_part);
797 host_part.remove(0,1);
801 #ifdef DEBUG_SETTINGS
803 d->global.dump(
"global");
810 return d->m_bOpenMiddleClick;
820 return d->m_accessKeysEnabled;
825 return d->m_adFilterEnabled;
830 return d->m_hideAdsEnabled;
835 if (d->m_adFilterEnabled)
837 if (!url.startsWith(
"data:"))
840 return d->adBlackList.isUrlMatched(url) && !d->adWhiteList.isUrlMatched(url);
848 QString m = d->adWhiteList.urlMatchedBy(url);
851 if (isWhiteListed != 0)
852 *isWhiteListed =
true;
856 m = d->adBlackList.urlMatchedBy(url);
859 if (isWhiteListed != 0)
860 *isWhiteListed =
false;
875 if (url.length()>2 && url[0]==
'/' && url[url.length()-1] ==
'/')
877 QString inside = url.mid(1, url.length()-2);
878 rx.setPattern(inside);
882 rx.setPatternSyntax(QRegExp::Wildcard);
889 QString key =
"Filter-" + QString::number(last);
893 if (url.startsWith(QLatin1String(
"@@")))
894 d->adWhiteList.addFilter(url);
896 d->adBlackList.addFilter(url);
902 i18n(
"Filter error"));
919 return d->m_bEnableJavaScriptDebug;
925 return d->m_bEnableJavaScriptErrorReporting;
934 const QString& hostname)
const {
939 const QString& hostname)
const {
944 const QString& hostname)
const {
949 const QString& hostname)
const {
954 const QString& hostname)
const {
960 return d->m_fontSize;
965 return d->m_minFontSize;
971 QString str =
"a:link {\ncolor: ";
972 str += d->m_linkColor.name();
974 if(d->m_underlineLink)
975 str +=
"\ntext-decoration: underline;";
977 if( d->m_bChangeCursor )
979 str +=
"\ncursor: pointer;";
980 str +=
"\n}\ninput[type=image] { cursor: pointer;";
983 str +=
"a:visited {\ncolor: ";
984 str += d->m_vLinkColor.name();
986 if(d->m_underlineLink)
987 str +=
"\ntext-decoration: underline;";
989 if( d->m_bChangeCursor )
990 str +=
"\ncursor: pointer;";
994 str +=
"a:link:hover, a:visited:hover { text-decoration: underline; }\n";
1001 if ( !avFamilies ) {
1006 QRegExp foundryExp(
" \\[.+\\]");
1009 QStringList::Iterator f = families.begin();
1010 const QStringList::Iterator fEnd = families.end();
1012 for ( ; f != fEnd; ++f ) {
1013 (*f).replace( foundryExp,
"");
1014 if (!s.contains(*f))
1019 *avFamilies =
',' + s.join(
",") +
',';
1025 QString KHTMLSettings::lookupFont(
int i)
const
1028 if (d->fonts.count() > i)
1031 font = d->defaultFonts[i];
1037 return lookupFont(0);
1042 return lookupFont(1);
1047 return lookupFont(2);
1052 return lookupFont(3);
1057 return lookupFont(4);
1062 return lookupFont(5);
1067 while(d->fonts.count() <= 0)
1074 while(d->fonts.count() <= 1)
1081 return d->m_userSheet;
1086 return d->m_formCompletionEnabled;
1091 return d->m_maxFormCompletionItems;
1096 return d->m_encoding;
1101 return d->m_follow_system_colors;
1106 return d->m_textColor;
1111 return d->m_baseColor;
1116 return d->m_linkColor;
1121 return d->m_vLinkColor;
1126 return d->m_bAutoLoadImages;
1131 return d->m_bUnfinishedImageFrame;
1136 return d->m_showAnimations;
1141 return d->m_smoothScrolling;
1146 return d->m_dnsPrefetch;
1151 return d->m_autoDelayedActionsEnabled;
1156 return d->m_jsErrorsEnabled;
1161 d->m_jsErrorsEnabled =
enabled;
1170 return d->m_allowTabulation;
1175 return d->m_autoSpellCheck;
1180 return d->m_fallbackAccessKeysAssignments;
1185 d->m_jsPopupBlockerPassivePopup =
enabled;
1188 cg.
writeEntry(
"PopupBlockerPassivePopup", enabled);
1194 return d->m_jsPopupBlockerPassivePopup;
1197 #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
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