Fix N_SE-56436 for Screen lock.
[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 class _SystemServiceMessageClient;
54
55 class _DeviceManagerImpl
56         : public Tizen::System::_ICommunicationDispatcherListener
57 {
58 private:
59         _DeviceManagerImpl();
60
61         virtual ~_DeviceManagerImpl();
62
63 public:
64         result GetState(DeviceType deviceType, Tizen::Base::String& state);
65
66         result AddDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
67
68         result RemoveDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
69
70         result RemoveAllDeviceEventListeners(void);
71
72
73         void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
74
75         void SendEvent(runtime_info_key_e key);
76
77         void SendEvent(DeviceType deviceType, Tizen::Base::String& state);
78
79         static _DeviceManagerImpl* GetInstance(void);
80
81 private:
82         _DeviceManagerImpl(const _DeviceManagerImpl& deviceManagerImpl);
83
84         _DeviceManagerImpl& operator =(const _DeviceManagerImpl& deviceManagerImpl);
85
86         result AddOnExistedListener(DeviceType deviceType, const IDeviceEventListener* pListener);
87
88         result RequireBluetoothEvent(void);
89
90         result ReleaseBluetoothEvent(void);
91
92         Tizen::Io::_IpcClient* GetIpcClient(void);
93
94         static void OnDeviceStateChanged(runtime_info_key_e key, void* pData);
95
96         static void DeviceEventVConfCallBack(keynode_t* node, void* userData);
97
98         static void MmcEventVconfCallback(keynode_t* node, void* userData);
99
100         static void InitDeviceManagerImpl(void);
101
102 private:
103         Tizen::Io::_IpcClient*          __pIpcClient;
104         DeviceType                      __headSetType;
105         int                             __bluetoothReferenceCount;
106         Tizen::Base::Collection::ArrayListT<_DeviceEventListenerContainer*>     __deviceEventList;
107         static _DeviceManagerImpl*      __pDeviceManagerImpl;
108         _SystemServiceMessageClient* __pSystemServiceMessageClient;
109 };
110
111 }} // Tizen::System
112
113 #endif  // _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_