1 // Copyright 2013 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ewk_settings_private_h
6 #define ewk_settings_private_h
11 #include <content/public/common/web_preferences.h>
12 #include "common/web_preferences_efl.h"
13 #include "public/ewk_settings.h"
17 Ewk_Settings(Evas_Object* evas_object, content::WebPreferences preferences)
18 : m_preferences(preferences)
19 , m_autofillPasswordForm(false)
20 , m_formCandidateData(false)
21 , m_autofillProfileForm(false)
22 , m_textSelectionEnabled(true)
23 , m_autoClearTextSelection(true)
24 , m_autoSelectWord(false)
25 , m_edgeEffectEnabled(true)
26 , m_textZoomEnabled(true)
27 , m_loadRemoteImages(true)
28 , m_currentLegacyFontSizeMode(EWK_LEGACY_FONT_SIZE_MODE_ONLY_IF_PIXEL_VALUES_MATCH)
29 , m_pasteImageUriEnabled(true)
30 , m_defaultKeypadEnabled(true)
31 , m_useKeyPadWithoutUserAction(true)
32 , m_textStyleState(true)
33 , m_detectContentsAutomatically(true)
34 , m_evas_object(evas_object)
35 , m_cacheBuilderEnabled(false)
36 , m_longPressEnabled(true)
37 , m_linkMagnifierEnabled(false)
38 , m_detectContentsEnabled(false)
39 , m_webLoginEnabled(false)
40 , m_doubleTapEnabled(true)
42 , m_openPanelEnabled(true)
43 , m_allowRestrictedURL(true)
45 , m_linkEffectEnabled(true)
48 const char* defaultTextEncoding() const {
49 return m_preferences.default_encoding.c_str();
51 void setDefaultTextEncoding(const char*);
52 bool autofillPasswordForm() const { return m_autofillPasswordForm; }
53 void setAutofillPasswordForm(bool enable) { m_autofillPasswordForm = enable; }
54 bool formCandidateData() const { return m_formCandidateData; }
55 void setFormCandidateData(bool enable) { m_formCandidateData = enable; }
56 bool autofillProfileForm() const { return m_autofillProfileForm; }
57 void setAutofillProfileForm(bool enable) { m_autofillProfileForm = enable; }
58 bool textSelectionEnabled() const { return m_textSelectionEnabled; }
59 void setTextSelectionEnabled(bool enable) { m_textSelectionEnabled = enable; }
60 bool autoClearTextSelection() const { return m_autoClearTextSelection; }
61 void setAutoClearTextSelection(bool enable) { m_autoClearTextSelection = enable; }
62 bool autoSelectWord() const { return m_autoSelectWord; }
63 void setAutoSelectWord(bool enable) { m_autoSelectWord = enable; }
64 bool edgeEffectEnabled() const { return m_edgeEffectEnabled; }
65 void setEdgeEffectEnabled(bool enable);
66 void setTextZoomEnabled(bool enable) { m_textZoomEnabled = enable; }
67 bool textZoomEnabled() const { return m_textZoomEnabled; }
68 void setLoadRemoteImages(bool loadRemoteImages) { m_loadRemoteImages = loadRemoteImages; }
69 bool loadRemoteImages() const { return m_loadRemoteImages; }
70 void setCurrentLegacyFontSizeMode(Ewk_Legacy_Font_Size_Mode mode);
71 Ewk_Legacy_Font_Size_Mode currentLegacyFontSizeMode() const { return m_currentLegacyFontSizeMode; }
72 void setPasteImageUriEnabled(bool enable) { m_pasteImageUriEnabled = enable; }
73 bool pasteImageUriEnabled() const {return m_pasteImageUriEnabled;}
74 bool defaultKeypadEnabled() const { return m_defaultKeypadEnabled; }
75 void setEnableDefaultKeypad(bool flag) { m_defaultKeypadEnabled = flag; }
76 bool useKeyPadWithoutUserAction() const { return m_useKeyPadWithoutUserAction; }
77 void setUseKeyPadWithoutUserAction(bool enable) { m_useKeyPadWithoutUserAction = enable; }
78 bool textStyleStateState() const { return m_textStyleState; }
79 void setTextStyleStateState(bool enable) { m_textStyleState = enable; }
80 void setSpdyEnabled(bool flag);
81 void setDetectContentsAutomatically(bool enable) { m_detectContentsAutomatically = enable; }
82 bool detectContentsAutomatically() const { return m_detectContentsAutomatically; }
84 Evas_Object* getEvasObject() { return m_evas_object; }
86 content::WebPreferences& getPreferences() { return m_preferences; }
87 const content::WebPreferences& getPreferences() const { return m_preferences; }
89 WebPreferencesEfl& getPreferencesEfl() { return m_preferences_efl; }
90 const WebPreferencesEfl& getPreferencesEfl() const { return m_preferences_efl; }
92 void setCacheBuilderEnabled(bool enable) { m_cacheBuilderEnabled = enable; }
94 /* ewk_extra_features related */
95 void setLongPressEnabled(bool enable) { m_longPressEnabled = enable; }
96 bool getLongPressEnabled() const { return m_longPressEnabled; }
97 void setLinkMagnifierEnabled(bool enable) { m_linkMagnifierEnabled = enable; }
98 bool getLinkMagnifierEnabled() const { return m_linkMagnifierEnabled; }
99 void setDetectContentsEnabled(bool enable) { m_detectContentsEnabled = enable; }
100 bool getDetectContentsEnabled() const { return m_detectContentsEnabled; }
101 void setWebLoginEnabled(bool enable) { m_webLoginEnabled = enable; }
102 bool getWebLoginEnabled() const { return m_webLoginEnabled; }
103 void setDoubleTapEnabled(bool enable) { m_doubleTapEnabled = enable; }
104 bool getDoubleTapEnabled() const { return m_doubleTapEnabled; }
105 void setZoomEnabled(bool enable) { m_zoomEnabled = enable; }
106 bool getZoomEnabled() const { return m_zoomEnabled; }
107 void setOpenPanelEnabled(bool enable) { m_openPanelEnabled = enable; }
108 bool getOpenPanelEnabled() const { return m_openPanelEnabled; }
109 void setAllowRestrictedURLEnabled(bool enable) { m_allowRestrictedURL = enable; }
110 bool getAllowRestrictedURLEnabled() const { return m_allowRestrictedURL; }
111 void setURLBarHideEnabled(bool enable) { m_URLBarHide = enable; }
112 bool getURLBarHideEnabled() const { return m_URLBarHide; }
113 void setLinkEffectEnabled(bool enable) { m_linkEffectEnabled = enable; }
114 bool getLinkEffectEnabled() const { return m_linkEffectEnabled; }
117 content::WebPreferences m_preferences;
118 WebPreferencesEfl m_preferences_efl;
120 bool m_autofillPasswordForm;
121 bool m_formCandidateData;
122 bool m_autofillProfileForm;
123 bool m_textSelectionEnabled;
124 bool m_autoClearTextSelection;
125 bool m_autoSelectWord;
126 bool m_edgeEffectEnabled;
127 bool m_textZoomEnabled;
128 bool m_loadRemoteImages;
129 Ewk_Legacy_Font_Size_Mode m_currentLegacyFontSizeMode;
130 bool m_pasteImageUriEnabled;
131 bool m_defaultKeypadEnabled;
132 bool m_useKeyPadWithoutUserAction;
133 bool m_textStyleState;
135 bool m_detectContentsAutomatically;
137 Evas_Object* m_evas_object;
138 bool m_cacheBuilderEnabled;
140 /* ewk_extra_features related */
141 bool m_longPressEnabled;
142 bool m_linkMagnifierEnabled;
143 bool m_detectContentsEnabled;
144 bool m_webLoginEnabled;
145 bool m_doubleTapEnabled;
147 bool m_openPanelEnabled;
148 bool m_allowRestrictedURL;
150 bool m_linkEffectEnabled;
153 #endif // ewk_settings_private_h