patch for rc20
[framework/osp/web.git] / src / controls / FWebCtrl_WebManager.h
1 //\r
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
3 //\r
4 // Licensed under the Apache License, Version 2.0 (the License);\r
5 // you may not use this file except in compliance with the License.\r
6 // You may obtain a copy of the License at\r
7 //\r
8 //     http://www.apache.org/licenses/LICENSE-2.0\r
9 //\r
10 // Unless required by applicable law or agreed to in writing, software\r
11 // distributed under the License is distributed on an "AS IS" BASIS,\r
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 // See the License for the specific language governing permissions and\r
14 // limitations under the License.\r
15 //\r
16 \r
17 /**\r
18  * @file        FWebCtrl_WebManager.h\r
19  * @brief       This is the header file for the %_WebManager class.\r
20  *\r
21  * This header file contains the declarations of the %_WebManager class.\r
22  */\r
23  \r
24 #ifndef _FWEB_CTRL_INTERNAL_WEB_MANAGER_H_\r
25 #define _FWEB_CTRL_INTERNAL_WEB_MANAGER_H_\r
26 \r
27 #include <unique_ptr.h>\r
28 #include <FBaseColArrayListT.h>\r
29 #include <FBaseColMultiHashMapT.h>\r
30 \r
31 namespace Tizen { namespace Web { namespace Controls\r
32 {\r
33 \r
34 _OSP_EXPORT_ extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[];\r
35 _OSP_EXPORT_ extern const wchar_t USER_CONFIRM_DB_NAME[];\r
36 _OSP_EXPORT_ extern const wchar_t GEOLOCATION_TABLE_NAME[];\r
37 _OSP_EXPORT_ extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[];\r
38 _OSP_EXPORT_ extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[];\r
39 _OSP_EXPORT_ extern const wchar_t CERTIFICATE_TABLE_NAME[];\r
40 \r
41 class _WebImpl;\r
42 class _WebPopup;\r
43 \r
44 class _WebManager\r
45         : public Tizen::Base::Object\r
46 {\r
47 public:\r
48         virtual ~_WebManager(void);\r
49         \r
50         result AddWeb(int webAdress);\r
51         result RemoveWeb(int webAdress);\r
52         bool IsValidWeb(int webAdress) const;\r
53 \r
54         result AddCallback(int callerAdress, int callbackAdress);\r
55         result RemoveCallback(int callerAdress, int callbackAdress);\r
56         bool IsValidCallback(int callerAdress, int callbackAdress) const;\r
57 \r
58         void SetActiveWeb(Tizen::Web::Controls::_WebImpl* pWebAddress);\r
59         void RemoveActiveWeb(Tizen::Web::Controls::_WebImpl* pWebAddress);\r
60         result SetActivePopup(int popupAddress);\r
61         result RemoveActivePopup(int popupAddress);\r
62 \r
63         static _WebManager* GetInstance(void);\r
64 \r
65 private:\r
66         _WebManager(void);\r
67         _WebManager(const _WebManager& rhs);\r
68 \r
69         result Construct(void);\r
70 \r
71         static void InitWebManager(void);\r
72         static void DestroyWebManager(void);\r
73 \r
74         void ClearCertificateDb(void);\r
75         result InitializeProxyAddress(void);\r
76         result CreateResourceDirectory(void) const;\r
77         result InitializeCustomDb(void) const;\r
78 \r
79         _WebManager& operator=(const _WebManager& rhs);\r
80 \r
81 private:\r
82         std::unique_ptr<Tizen::Base::Collection::ArrayListT< int > > __pWebList;\r
83         std::unique_ptr<Tizen::Base::Collection::MultiHashMapT< int, int > > __pCallbackList;\r
84         std::unique_ptr<Tizen::Base::Collection::ArrayListT< int > > __pActivePopupList;\r
85 \r
86         _WebImpl* __pActiveWeb;\r
87         char* __pProxy;\r
88 \r
89         static _WebManager* __pInstance;\r
90 };\r
91 \r
92 } } }\r
93 #endif\r
94 \r
95  \r