Fix the boiler plate codes
[platform/framework/native/appfw.git] / src / system / FSys_DeviceManagerImpl.h
1 //
2 // Copyright (c) 2012 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                FSys_DeviceManagerImpl.h
19  * @brief               This is the header file for the _DeviceManagerImpl class.
20  */
21
22 #ifndef _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_
23 #define _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_
24
25 #include <runtime_info.h>
26 #include <vconf.h>
27
28 #include <FBaseColArrayListT.h>
29 #include <FBaseColHashMap.h>
30 #include <FBaseResult.h>
31 #include <FBaseString.h>
32 #include <FBaseUuId.h>
33 #include <FSysDeviceManager.h>
34
35 #include <FIo_IpcClient.h>
36 #include <FSys_ICommunicationDispatcherListener.h>
37 #include <FSys_DeviceEventListenerContainer.h>
38
39 namespace Tizen { namespace Base
40 {
41 namespace Collection {
42 class ArrayList;
43 }
44 }}
45
46 namespace Tizen { namespace Io
47 {
48 class _IpcClient;
49 }}
50
51 namespace Tizen { namespace System
52 {
53
54 class _DeviceManagerImpl
55         : public Tizen::System::_ICommunicationDispatcherListener
56 {
57 private:
58         _DeviceManagerImpl();
59
60         virtual ~_DeviceManagerImpl();
61
62 public:
63         result GetState(DeviceType deviceType, Tizen::Base::String& state);
64
65         result AddDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
66
67         result RemoveDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
68
69         result RemoveAllDeviceEventListeners(void);
70
71
72         void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
73
74         void SendEvent(runtime_info_key_e key);
75
76         void SendEvent(DeviceType deviceType, Tizen::Base::String& state);
77
78         static _DeviceManagerImpl* GetInstance(void);
79
80 private:
81         _DeviceManagerImpl(const _DeviceManagerImpl& deviceManagerImpl);
82
83         _DeviceManagerImpl& operator =(const _DeviceManagerImpl& deviceManagerImpl);
84
85         result AddOnExistedListener(DeviceType deviceType, const IDeviceEventListener* pListener);
86
87         result RequireBluetoothEvent(void);
88
89         result ReleaseBluetoothEvent(void);
90
91         static void OnDeviceStateChanged(runtime_info_key_e key, void* pData);
92
93         static void DeviceEventVConfCallBack(keynode_t* node, void* userData);
94
95         static void MmcEventVconfCallback(keynode_t* node, void* userData);
96
97         static void InitDeviceManagerImpl(void);
98
99 private:
100         Tizen::Io::_IpcClient*          __pIpcClient;
101
102         DeviceType                      __headSetType;
103
104         int                             __bluetoothReferenceCount;
105
106         Tizen::Base::Collection::ArrayListT<_DeviceEventListenerContainer*>     __deviceEventList;
107
108         static _DeviceManagerImpl*      __pDeviceManagerImpl;
109 };
110
111 }} // Tizen::System
112
113 #endif  // _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_