• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef WKPreferencesPrivate_h
27 #define WKPreferencesPrivate_h
28 
29 #include <WebKit2/WKBase.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 enum WKFontSmoothingLevel {
36     kWKFontSmoothingLevelNoSubpixelAntiAliasing = 0,
37     kWKFontSmoothingLevelLight = 1,
38     kWKFontSmoothingLevelMedium = 2,
39     kWKFontSmoothingLevelStrong = 3,
40 #if defined(WIN32) || defined(_WIN32)
41     kWKFontSmoothingLevelWindows = 4,
42 #endif
43 };
44 typedef enum WKFontSmoothingLevel WKFontSmoothingLevel;
45 
46 enum WKEditableLinkBehavior {
47     kWKEditableLinkBehaviorDefault,
48     kWKEditableLinkBehaviorAlwaysLive,
49     kWKEditableLinkBehaviorOnlyLiveWithShiftKey,
50     kWKEditableLinkBehaviorLiveWhenNotFocused,
51     kWKEditableLinkBehaviorNeverLive
52 };
53 typedef enum WKEditableLinkBehavior WKEditableLinkBehavior;
54 
55 // Defaults to kWKFontSmoothingLevelMedium.
56 WK_EXPORT void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef, WKFontSmoothingLevel);
57 WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef);
58 
59 // Defaults to EditableLinkNeverLive.
60 WK_EXPORT void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior);
61 WK_EXPORT WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef);
62 
63 // Defaults to false.
64 WK_EXPORT void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef, bool);
65 WK_EXPORT bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef);
66 
67 // Defaults to true.
68 WK_EXPORT void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef, bool);
69 WK_EXPORT bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef);
70 
71 // Defaults to true.
72 WK_EXPORT void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef, bool);
73 WK_EXPORT bool WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef);
74 
75 // Defaults to false.
76 WK_EXPORT void WKPreferencesSetCompositingBordersVisible(WKPreferencesRef, bool);
77 WK_EXPORT bool WKPreferencesGetCompositingBordersVisible(WKPreferencesRef);
78 
79 // Defaults to false.
80 WK_EXPORT void WKPreferencesSetCompositingRepaintCountersVisible(WKPreferencesRef, bool);
81 WK_EXPORT bool WKPreferencesGetCompositingRepaintCountersVisible(WKPreferencesRef);
82 
83 // Defaults to false.
84 WK_EXPORT void WKPreferencesSetWebGLEnabled(WKPreferencesRef, bool);
85 WK_EXPORT bool WKPreferencesGetWebGLEnabled(WKPreferencesRef);
86 
87 // Defaults to false.
88 WK_EXPORT void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef, bool);
89 WK_EXPORT bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef);
90 
91 // Defaults to false.
92 WK_EXPORT void WKPreferencesSetForceFTPDirectoryListings(WKPreferencesRef preferences, bool force);
93 WK_EXPORT bool WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef preferences);
94 
95 // Defaults to the empty string.
96 WK_EXPORT void WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferences, WKStringRef path);
97 WK_EXPORT WKStringRef WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferences);
98 
99 // Defaults to false.
100 WK_EXPORT void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferences, bool enabled);
101 WK_EXPORT bool WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferences);
102 
103 // Defaults to false.
104 WK_EXPORT void WKPreferencesSetLocalFileContentSniffingEnabled(WKPreferencesRef preferences, bool enabled);
105 WK_EXPORT bool WKPreferencesGetLocalFileContentSniffingEnabled(WKPreferencesRef preferences);
106 
107 // Defaults to true.
108 WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bool enabled);
109 WK_EXPORT bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferences);
110 
111 // Defaults to false.
112 WK_EXPORT void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferences, bool enabled);
113 WK_EXPORT bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef preferences);
114 
115 // Defaults to false.
116 WK_EXPORT void WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferences, bool enabled);
117 WK_EXPORT bool WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferences);
118 
119 // Defaults to true.
120 WK_EXPORT void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferences, bool enabled);
121 WK_EXPORT bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferences);
122 
123 // Defaults to false.
124 WK_EXPORT void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed);
125 WK_EXPORT bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferences);
126 
127 // Defaults to false.
128 WK_EXPORT void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed);
129 WK_EXPORT bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences);
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* WKPreferencesPrivate_h */
136 
137