⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webpreferences.cpp

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 CPP
📖 第 1 页 / 共 3 页
字号:
    /* [in] */ BOOL enabled){    setBoolValue(CFSTR(WebKitShouldPrintBackgroundsPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::shouldPrintBackgrounds(     /* [retval][out] */ BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitShouldPrintBackgroundsPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setPrivateBrowsingEnabled(     /* [in] */ BOOL enabled){    setBoolValue(CFSTR(WebKitPrivateBrowsingEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::privateBrowsingEnabled(     /* [retval][out] */ BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitPrivateBrowsingEnabledPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setTabsToLinks(     /* [in] */ BOOL enabled){    setBoolValue(CFSTR(WebKitTabToLinksPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::tabsToLinks(     /* [retval][out] */ BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitTabToLinksPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setUsesPageCache(         /* [in] */ BOOL usesPageCache){    setBoolValue(CFSTR(WebKitUsesPageCachePreferenceKey), usesPageCache);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::usesPageCache(     /* [retval][out] */ BOOL* usesPageCache){    *usesPageCache = boolValueForKey(CFSTR(WebKitUsesPageCachePreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::textAreasAreResizable(     /* [retval][out] */ BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitTextAreasAreResizablePreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setTextAreasAreResizable(     /* [in] */ BOOL enabled){    setBoolValue(CFSTR(WebKitTextAreasAreResizablePreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::historyItemLimit(int* limit){    *limit = integerValueForKey(CFSTR(WebKitHistoryItemLimitKey));    return S_OK;}HRESULT WebPreferences::setHistoryItemLimit(int limit){    setIntegerValue(CFSTR(WebKitHistoryItemLimitKey), limit);    return S_OK;}HRESULT WebPreferences::historyAgeInDaysLimit(int* limit){    *limit = integerValueForKey(CFSTR(WebKitHistoryAgeInDaysLimitKey));    return S_OK;}HRESULT WebPreferences::setHistoryAgeInDaysLimit(int limit){    setIntegerValue(CFSTR(WebKitHistoryAgeInDaysLimitKey), limit);    return S_OK;}HRESULT WebPreferences::unused1(){    ASSERT_NOT_REACHED();    return E_FAIL;}HRESULT WebPreferences::unused2(){    ASSERT_NOT_REACHED();    return E_FAIL;}HRESULT WebPreferences::iconDatabaseLocation(    /* [out] */ BSTR* location){    *location = stringValueForKey(CFSTR(WebKitIconDatabaseLocationKey));    return (*location) ? S_OK : E_FAIL;}HRESULT WebPreferences::setIconDatabaseLocation(    /* [in] */ BSTR location){    setStringValue(CFSTR(WebKitIconDatabaseLocationKey), location);    return S_OK;}HRESULT WebPreferences::iconDatabaseEnabled(BOOL* enabled)//location){    *enabled = boolValueForKey(CFSTR(WebKitIconDatabaseEnabledPreferenceKey));    return S_OK;}HRESULT WebPreferences::setIconDatabaseEnabled(BOOL enabled )//location){    setBoolValue(CFSTR(WebKitIconDatabaseEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::fontSmoothing(     /* [retval][out] */ FontSmoothingType* smoothingType){    *smoothingType = (FontSmoothingType) integerValueForKey(CFSTR(WebKitFontSmoothingTypePreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothing(     /* [in] */ FontSmoothingType smoothingType){    setIntegerValue(CFSTR(WebKitFontSmoothingTypePreferenceKey), smoothingType);    if (smoothingType == FontSmoothingTypeWindows)        smoothingType = FontSmoothingTypeMedium;#if PLATFORM(CG)    wkSetFontSmoothingLevel((int)smoothingType);#endif    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::fontSmoothingContrast(     /* [retval][out] */ float* contrast){    *contrast = floatValueForKey(CFSTR(WebKitFontSmoothingContrastPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothingContrast(     /* [in] */ float contrast){    setFloatValue(CFSTR(WebKitFontSmoothingContrastPreferenceKey), contrast);#if PLATFORM(CG)    wkSetFontSmoothingContrast(contrast);#endif    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::editableLinkBehavior(    /* [out, retval] */ WebKitEditableLinkBehavior* editableLinkBehavior){    WebKitEditableLinkBehavior value = (WebKitEditableLinkBehavior) integerValueForKey(CFSTR(WebKitEditableLinkBehaviorPreferenceKey));    switch (value) {        case WebKitEditableLinkDefaultBehavior:        case WebKitEditableLinkAlwaysLive:        case WebKitEditableLinkOnlyLiveWithShiftKey:        case WebKitEditableLinkLiveWhenNotFocused:        case WebKitEditableLinkNeverLive:            *editableLinkBehavior = value;            break;        default: // ensure that a valid result is returned            *editableLinkBehavior = WebKitEditableLinkDefaultBehavior;            break;    }    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setEditableLinkBehavior(    /* [in] */ WebKitEditableLinkBehavior behavior){    setIntegerValue(CFSTR(WebKitEditableLinkBehaviorPreferenceKey), behavior);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::cookieStorageAcceptPolicy(         /* [retval][out] */ WebKitCookieStorageAcceptPolicy *acceptPolicy ){    if (!acceptPolicy)        return E_POINTER;    *acceptPolicy = (WebKitCookieStorageAcceptPolicy)integerValueForKey(CFSTR(WebKitCookieStorageAcceptPolicyPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setCookieStorageAcceptPolicy(         /* [in] */ WebKitCookieStorageAcceptPolicy acceptPolicy){    setIntegerValue(CFSTR(WebKitCookieStorageAcceptPolicyPreferenceKey), acceptPolicy);    return S_OK;}HRESULT WebPreferences::continuousSpellCheckingEnabled(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebContinuousSpellCheckingEnabledPreferenceKey));    return S_OK;}HRESULT WebPreferences::setContinuousSpellCheckingEnabled(BOOL enabled){    setBoolValue(CFSTR(WebContinuousSpellCheckingEnabledPreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::grammarCheckingEnabled(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebGrammarCheckingEnabledPreferenceKey));    return S_OK;}HRESULT WebPreferences::setGrammarCheckingEnabled(BOOL enabled){    setBoolValue(CFSTR(WebGrammarCheckingEnabledPreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::allowContinuousSpellChecking(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(AllowContinuousSpellCheckingPreferenceKey));    return S_OK;}HRESULT WebPreferences::setAllowContinuousSpellChecking(BOOL enabled){    setBoolValue(CFSTR(AllowContinuousSpellCheckingPreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::isDOMPasteAllowed(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitDOMPasteAllowedPreferenceKey));    return S_OK;}    HRESULT WebPreferences::setDOMPasteAllowed(BOOL enabled){    setBoolValue(CFSTR(WebKitDOMPasteAllowedPreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::cacheModel(WebCacheModel* cacheModel){    if (!cacheModel)        return E_POINTER;    *cacheModel = (WebCacheModel)integerValueForKey(CFSTR(WebKitCacheModelPreferenceKey));    return S_OK;}HRESULT WebPreferences::setCacheModel(WebCacheModel cacheModel){    setIntegerValue(CFSTR(WebKitCacheModelPreferenceKey), cacheModel);    return S_OK;}HRESULT WebPreferences::setShouldPaintCustomScrollbars(BOOL shouldPaint){    setBoolValue(CFSTR(WebKitPaintCustomScrollbarsPreferenceKey), shouldPaint);    return S_OK;}HRESULT WebPreferences::shouldPaintCustomScrollbars(BOOL* shouldPaint){    *shouldPaint = boolValueForKey(CFSTR(WebKitPaintCustomScrollbarsPreferenceKey));    return S_OK;}HRESULT WebPreferences::shouldPaintNativeControls(BOOL* shouldPaint){    *shouldPaint = boolValueForKey(CFSTR(WebKitPaintNativeControlsPreferenceKey));    return S_OK;}HRESULT WebPreferences::setShouldPaintNativeControls(BOOL shouldPaint){    setBoolValue(CFSTR(WebKitPaintNativeControlsPreferenceKey), shouldPaint);    return S_OK;}HRESULT WebPreferences::setDeveloperExtrasEnabled(BOOL enabled){    setBoolValue(CFSTR(WebKitDeveloperExtrasEnabledPreferenceKey), enabled);    return S_OK;}HRESULT WebPreferences::developerExtrasEnabled(BOOL* enabled){    if (!enabled)        return E_POINTER;    *enabled = boolValueForKey(CFSTR(WebKitDeveloperExtrasEnabledPreferenceKey));    return S_OK;}bool WebPreferences::developerExtrasDisabledByOverride(){    return !!boolValueForKey(CFSTR(DisableWebKitDeveloperExtrasPreferenceKey));}HRESULT WebPreferences::setAutomaticallyDetectsCacheModel(BOOL automaticallyDetectsCacheModel){    m_automaticallyDetectsCacheModel = !!automaticallyDetectsCacheModel;    return S_OK;}HRESULT WebPreferences::automaticallyDetectsCacheModel(BOOL* automaticallyDetectsCacheModel){    if (!automaticallyDetectsCacheModel)        return E_POINTER;    *automaticallyDetectsCacheModel = m_automaticallyDetectsCacheModel;    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setAuthorAndUserStylesEnabled(BOOL enabled){    setBoolValue(CFSTR(WebKitAuthorAndUserStylesEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::authorAndUserStylesEnabled(BOOL* enabled){    if (!enabled)        return E_POINTER;    *enabled = boolValueForKey(CFSTR(WebKitAuthorAndUserStylesEnabledPreferenceKey));    return S_OK;}HRESULT WebPreferences::inApplicationChromeMode(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitApplicationChromeModePreferenceKey));    return S_OK;}    HRESULT WebPreferences::setApplicationChromeMode(BOOL enabled){    setBoolValue(CFSTR(WebKitApplicationChromeModePreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setOfflineWebApplicationCacheEnabled(BOOL enabled){    setBoolValue(CFSTR(WebKitOfflineWebApplicationCacheEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::offlineWebApplicationCacheEnabled(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitOfflineWebApplicationCacheEnabledPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setDatabasesEnabled(BOOL enabled){    setBoolValue(CFSTR(WebKitDatabasesEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::databasesEnabled(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitDatabasesEnabledPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::setLocalStorageEnabled(BOOL enabled){    setBoolValue(CFSTR(WebKitLocalStorageEnabledPreferenceKey), enabled);    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::localStorageEnabled(BOOL* enabled){    *enabled = boolValueForKey(CFSTR(WebKitLocalStorageEnabledPreferenceKey));    return S_OK;}HRESULT STDMETHODCALLTYPE WebPreferences::localStorageDatabasePath(BSTR* location){    *location = stringValueForKey(CFSTR(WebKitLocalStorageDatabasePathPreferenceKey));    return (*location) ? S_OK : E_FAIL;}HRESULT STDMETHODCALLTYPE WebPreferences::setLocalStorageDatabasePath(BSTR location){    setStringValue(CFSTR(WebKitLocalStorageDatabasePathPreferenceKey), location);    return S_OK;}HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly){    setBoolValue(CFSTR(WebKitZoomsTextOnlyPreferenceKey), zoomsTextOnly);    return S_OK;}HRESULT WebPreferences::zoomsTextOnly(BOOL* zoomsTextOnly){    *zoomsTextOnly = boolValueForKey(CFSTR(WebKitZoomsTextOnlyPreferenceKey));    return S_OK;}void WebPreferences::willAddToWebView(){    ++m_numWebViews;}void WebPreferences::didRemoveFromWebView(){    ASSERT(m_numWebViews);    if (--m_numWebViews == 0) {        IWebNotificationCenter* nc = WebNotificationCenter::defaultCenterInternal();        nc->postNotificationName(webPreferencesRemovedNotification(), static_cast<IWebPreferences*>(this), 0);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -