Merge "fix: use EINA_* booleans instread of TRUE/FALSE" into tizen
[platform/framework/web/wrt.git] / src / view / webkit / ewk_context_manager.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * @file    ewk_context_manager.h
18  * @author  Yunchan Cho (yunchan.cho@samsung.com)
19  * @version 0.1
20  * @brief   Declaration of EwkContextManager class.
21  *          This file handles operation regarding Ewk_Context.
22  */
23
24 #ifndef EWK_CONTEXT_MANAGER_H
25 #define EWK_CONTEXT_MANAGER_H
26
27 #include <vconf.h>
28 #include <i_context_manager.h>
29
30 namespace ViewModule {
31
32 class EwkContextManager : public IContextManager {
33     public:
34         EwkContextManager(
35             const std::string& tizenAppId,
36             Ewk_Context* ewkContext,
37             ViewModule::IViewModulePtr viewModule);
38         Ewk_Context * getEwkContext() const;
39         void handleLowMemory();
40         ~EwkContextManager();
41
42     private:
43         bool initialize();
44         void destroy();
45         void setCallbacks();
46         void unsetCallbacks();
47         void setAutoFullscreenMode();
48         void setNetworkProxy();
49
50         // ewk context callback functions
51         static void messageFromInjectedBundleCallback(
52                 const char* name,
53                 const char* body,
54                 char** returnData,
55                 void* clientInfo);
56         static void didStartDownloadCallback(const char* downloadUrl, void* data);
57         static void vibrationClientStartCallback(uint64_t time, void* data);
58         static void vibrationClientStopCallback(void* data);
59
60         // vconf callback functions
61         static void vconfChangedCallback(keynode_t* keynode, void* data);
62
63         // members
64         bool m_initialized;
65         bool m_isInternalContext;
66 };
67 } // namespace ViewModule
68
69 #endif // EWK_CONTEXT_MANAGER_H