Merge "Add a _LocalizedNumParser class and 4 static functions" into tizen_2.1
[platform/framework/native/appfw.git] / src / app / FApp_DataControlManager.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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 /**
18  * @file        FApp_DataControlManager.h
19  * @brief       This is the header file for the _DataControlManager class.
20  */
21
22 #ifndef _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
23 #define _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
24
25 #include <FBaseObject.h>
26 #include <FBaseColHashMap.h>
27 #include <FBaseColLinkedList.h>
28 #include <FBaseRtEvent.h>
29 #include <FAppTypes.h>
30
31 namespace Tizen { namespace App
32 {
33
34 class _DataControlRequestInfo
35         : public Tizen::Base::Object
36 {
37 public:
38         _DataControlRequestInfo(Tizen::Base::Runtime::Event* pEvent)
39         {
40                 __pEvent = pEvent;
41         }
42
43         virtual ~_DataControlRequestInfo(void)
44         {
45         }
46
47         Tizen::Base::Runtime::Event* GetEvent(void)
48         {
49                 return __pEvent;
50         }
51 private:
52         _DataControlRequestInfo(void)
53                 : __pEvent(null)
54         {
55         }
56 private:
57         Tizen::Base::Runtime::Event* __pEvent;
58 };
59
60 class _DataControlManager
61         : public Tizen::Base::Object
62 {
63 public:
64         static _DataControlManager* GetInstance(void);
65
66         result AddRequestInfo(Tizen::Base::Integer* pReqId, _DataControlRequestInfo* pReqInfo);
67
68         _DataControlRequestInfo* GetRequestInfo(Tizen::Base::Integer& reqId);
69
70         int GetRequestCount(void) const;
71
72         void RemoveRequestInfo(Tizen::Base::Integer& reqId);
73
74         void RemoveAllRequests(void);
75
76         int GetUniqueId(void);
77
78         result AllowAccess(const AppId& appId);
79
80 private:
81         _DataControlManager(void);
82
83         virtual ~_DataControlManager(void);
84
85         void Cache(const AppId& appId);
86
87         bool IsCached(const AppId& appId);
88
89         static void InitSingleton(void);
90
91         static void DestroySingleton(void);
92
93 private:
94         static _DataControlManager* __pDataControlManagerInstance;
95         Tizen::Base::Collection::HashMap* __pDataControlRequestList;
96         Tizen::Base::Collection::LinkedList* __pProviderList;
97         int __uniqueId;
98
99 }; // _DataControlManager
100
101 }} // Tizen::App
102
103 #endif // _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
104