Fix the boiler plate codes
[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 <FBaseRtEvent.h>
28
29 namespace Tizen { namespace App
30 {
31
32 class _DataControlRequestInfo
33         : public Tizen::Base::Object
34 {
35 public:
36         _DataControlRequestInfo(Tizen::Base::Runtime::Event* pEvent)
37         {
38                 __pEvent = pEvent;
39         }
40
41         virtual ~_DataControlRequestInfo(void)
42         {
43         }
44
45         Tizen::Base::Runtime::Event* GetEvent(void)
46         {
47                 return __pEvent;
48         }
49 private:
50         _DataControlRequestInfo(void)
51                 : __pEvent(null)
52         {
53         }
54 private:
55         Tizen::Base::Runtime::Event* __pEvent;
56 };
57
58 class _DataControlManager
59         : public Tizen::Base::Object
60 {
61 public:
62         static _DataControlManager* GetInstance(void);
63
64         result AddRequestInfo(Tizen::Base::Integer* pReqId, _DataControlRequestInfo* pReqInfo);
65
66         _DataControlRequestInfo* GetRequestInfo(Tizen::Base::Integer& reqId);
67
68         void RemoveRequestInfo(Tizen::Base::Integer& reqId);
69
70         int GetUniqueId(void);
71
72 private:
73         _DataControlManager(void);
74
75         virtual ~_DataControlManager(void);
76
77         static void InitSingleton(void);
78
79         static void DestroySingleton(void);
80
81 private:
82         static _DataControlManager* __pDataControlManagerInstance;
83         Tizen::Base::Collection::HashMap* __pDataControlRequestList;
84         int __uniqueId;
85
86 }; // _DataControlManager
87
88 }} // Tizen::App
89
90 #endif // _FAPP_INTERNAL_DATA_CONTROL_MANAGER_H_
91