Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_settings_private.h
1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  * Copyright (C) 2012 Intel Corporation. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 #ifndef ewk_settings_private_h
28 #define ewk_settings_private_h
29
30 #include <wtf/PassOwnPtr.h>
31
32 #if OS(TIZEN)
33 #include "WKEinaSharedString.h"
34 #endif
35
36 namespace WebKit {
37 class WebPreferences;
38 }
39 class EwkViewImpl;
40
41 /**
42  * \struct  Ewk_Settings
43  * @brief   Contains the settings data.
44  */
45 class Ewk_Settings {
46 public:
47     static PassOwnPtr<Ewk_Settings> create(EwkViewImpl* viewImpl)
48     {
49         return adoptPtr(new Ewk_Settings(viewImpl));
50     }
51
52     const WebKit::WebPreferences* preferences() const;
53     WebKit::WebPreferences* preferences();
54
55 #if OS(TIZEN)
56     const char* defaultTextEncoding() const { return m_defaultTextEncoding; }
57     void setDefaultTextEncoding(const char*);
58 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
59     bool autofillPasswordForm() const { return m_autofillPasswordForm; }
60     void setAutofillPasswordForm(bool);
61     bool formCandidateData() const { return m_formCandidateData; }
62     void setFormCandidateData(bool);
63 #endif
64 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
65     bool textSelectionEnabled() const { return m_textSelectionEnabled; }
66     void setTextSelectionEnabled(bool enable) { m_textSelectionEnabled = enable; }
67     bool autoClearTextSelection() const { return m_autoClearTextSelection; }
68     void setAutoClearTextSelection(bool enable) { m_autoClearTextSelection = enable; }
69 #endif
70 #endif
71
72 private:
73     explicit Ewk_Settings(EwkViewImpl* viewImpl)
74         : m_viewImpl(viewImpl)
75 #if OS(TIZEN)
76 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
77         , m_autofillPasswordForm(false)
78         , m_formCandidateData(false)
79 #endif
80 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
81         , m_textSelectionEnabled(true)
82         , m_autoClearTextSelection(true)
83 #endif
84 #endif
85     {
86         ASSERT(m_viewImpl);
87     }
88
89     EwkViewImpl* m_viewImpl;
90
91 #if OS(TIZEN)
92     WKEinaSharedString m_defaultTextEncoding;
93 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
94     bool m_autofillPasswordForm;
95     bool m_formCandidateData;
96 #endif
97 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
98     bool m_textSelectionEnabled;
99     bool m_autoClearTextSelection;
100 #endif
101 #endif
102 };
103
104 #endif // ewk_settings_private_h