QString QWebPreferencesPrivate::fontFamily(QWebPreferencesPrivate::FontFamily which) const { switch (which) { case StandardFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyStandardFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } case FixedFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyFixedFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } case SerifFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopySerifFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } case SansSerifFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopySansSerifFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } case CursiveFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyCursiveFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } case FantasyFont: { WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyFantasyFontFamily(preferencesRef())); return WKStringCopyQString(stringRef.get()); } default: return QString(); } }
void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute attr, bool enable) { switch (attr) { case AutoLoadImages: WKPreferencesSetLoadsImagesAutomatically(preferencesRef(), enable); break; case JavascriptEnabled: WKPreferencesSetJavaScriptEnabled(preferencesRef(), enable); break; case PluginsEnabled: WKPreferencesSetPluginsEnabled(preferencesRef(), enable); break; case OfflineWebApplicationCacheEnabled: WKPreferencesSetOfflineWebApplicationCacheEnabled(preferencesRef(), enable); break; case LocalStorageEnabled: WKPreferencesSetLocalStorageEnabled(preferencesRef(), enable); break; case XSSAuditingEnabled: WKPreferencesSetXSSAuditorEnabled(preferencesRef(), enable); break; case PrivateBrowsingEnabled: WKPreferencesSetPrivateBrowsingEnabled(preferencesRef(), enable); break; case DnsPrefetchEnabled: WKPreferencesSetDNSPrefetchingEnabled(preferencesRef(), enable); break; case AcceleratedCompositingEnabled: WKPreferencesSetAcceleratedCompositingEnabled(preferencesRef(), enable); break; default: ASSERT_NOT_REACHED(); } }
bool QWebPreferencesPrivate::testAttribute(QWebPreferencesPrivate::WebAttribute attr) const { switch (attr) { case AutoLoadImages: return WKPreferencesGetLoadsImagesAutomatically(preferencesRef()); case JavascriptEnabled: return WKPreferencesGetJavaScriptEnabled(preferencesRef()); case PluginsEnabled: return WKPreferencesGetPluginsEnabled(preferencesRef()); case OfflineWebApplicationCacheEnabled: return WKPreferencesGetOfflineWebApplicationCacheEnabled(preferencesRef()); case LocalStorageEnabled: return WKPreferencesGetLocalStorageEnabled(preferencesRef()); case XSSAuditingEnabled: return WKPreferencesGetXSSAuditorEnabled(preferencesRef()); case PrivateBrowsingEnabled: return WKPreferencesGetPrivateBrowsingEnabled(preferencesRef()); case DnsPrefetchEnabled: return WKPreferencesGetDNSPrefetchingEnabled(preferencesRef()); case AcceleratedCompositingEnabled: return WKPreferencesGetAcceleratedCompositingEnabled(preferencesRef()); default: ASSERT_NOT_REACHED(); return false; } }
unsigned QWebPreferencesPrivate::fontSize(QWebPreferencesPrivate::FontSizeType type) const { switch (type) { case MinimumFontSize: return WKPreferencesGetMinimumFontSize(preferencesRef()); case DefaultFontSize: return WKPreferencesGetDefaultFontSize(preferencesRef()); case DefaultFixedFontSize: return WKPreferencesGetDefaultFixedFontSize(preferencesRef()); default: ASSERT_NOT_REACHED(); return false; } }
void QWebPreferencesPrivate::setFontSize(QWebPreferencesPrivate::FontSizeType type, unsigned size) { switch (type) { case MinimumFontSize: WKPreferencesSetMinimumFontSize(preferencesRef(), size); break; case DefaultFontSize: WKPreferencesSetDefaultFontSize(preferencesRef(), size); break; case DefaultFixedFontSize: WKPreferencesSetDefaultFixedFontSize(preferencesRef(), size); break; default: ASSERT_NOT_REACHED(); } }
void QWebPreferencesPrivate::setFontFamily(QWebPreferencesPrivate::FontFamily which, const QString& family) { switch (which) { case StandardFont: WKPreferencesSetStandardFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; case FixedFont: WKPreferencesSetFixedFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; case SerifFont: WKPreferencesSetSerifFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; case SansSerifFont: WKPreferencesSetSansSerifFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; case CursiveFont: WKPreferencesSetCursiveFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; case FantasyFont: WKPreferencesSetFantasyFontFamily(preferencesRef(), WKStringCreateWithQString(family)); break; default: break; } }
void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute attr, bool enable) { switch (attr) { case AutoLoadImages: WKPreferencesSetLoadsImagesAutomatically(preferencesRef(), enable); break; #if ENABLE(FULLSCREEN_API) case FullScreenEnabled: WKPreferencesSetFullScreenEnabled(preferencesRef(), enable); break; #endif case JavascriptEnabled: WKPreferencesSetJavaScriptEnabled(preferencesRef(), enable); break; case PluginsEnabled: WKPreferencesSetPluginsEnabled(preferencesRef(), enable); break; case OfflineWebApplicationCacheEnabled: WKPreferencesSetOfflineWebApplicationCacheEnabled(preferencesRef(), enable); break; case LocalStorageEnabled: WKPreferencesSetLocalStorageEnabled(preferencesRef(), enable); break; case XSSAuditingEnabled: WKPreferencesSetXSSAuditorEnabled(preferencesRef(), enable); break; case PrivateBrowsingEnabled: WKPreferencesSetPrivateBrowsingEnabled(preferencesRef(), enable); break; case DnsPrefetchEnabled: WKPreferencesSetDNSPrefetchingEnabled(preferencesRef(), enable); break; case FrameFlatteningEnabled: WKPreferencesSetFrameFlatteningEnabled(preferencesRef(), enable); case DeveloperExtrasEnabled: WKPreferencesSetDeveloperExtrasEnabled(preferencesRef(), enable); break; #if ENABLE(WEBGL) case WebGLEnabled: WKPreferencesSetWebGLEnabled(preferencesRef(), enable); break; #endif default: ASSERT_NOT_REACHED(); } }