2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSys_DeviceManagerImpl.h
19 * @brief This is the header file for the _DeviceManagerImpl class.
22 #ifndef _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_
23 #define _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_
25 #include <runtime_info.h>
28 #include <FBaseColArrayListT.h>
29 #include <FBaseColHashMap.h>
30 #include <FBaseResult.h>
31 #include <FBaseString.h>
32 #include <FBaseUuId.h>
33 #include <FSysDeviceManager.h>
35 #include <FIo_IpcClient.h>
36 #include <FSys_ICommunicationDispatcherListener.h>
37 #include <FSys_DeviceEventListenerContainer.h>
39 namespace Tizen { namespace Base
41 namespace Collection {
46 namespace Tizen { namespace Io
51 namespace Tizen { namespace System
54 class _DeviceManagerImpl
55 : public Tizen::System::_ICommunicationDispatcherListener
60 virtual ~_DeviceManagerImpl();
63 result GetState(DeviceType deviceType, Tizen::Base::String& state);
65 result AddDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
67 result RemoveDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
69 result RemoveAllDeviceEventListeners(void);
72 void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
74 void SendEvent(runtime_info_key_e key);
76 void SendEvent(DeviceType deviceType, Tizen::Base::String& state);
78 static _DeviceManagerImpl* GetInstance(void);
81 _DeviceManagerImpl(const _DeviceManagerImpl& deviceManagerImpl);
83 _DeviceManagerImpl& operator =(const _DeviceManagerImpl& deviceManagerImpl);
85 result AddOnExistedListener(DeviceType deviceType, const IDeviceEventListener* pListener);
87 result RequireBluetoothEvent(void);
89 result ReleaseBluetoothEvent(void);
91 static void OnDeviceStateChanged(runtime_info_key_e key, void* pData);
93 static void DeviceEventVConfCallBack(keynode_t* node, void* userData);
95 static void MmcEventVconfCallback(keynode_t* node, void* userData);
97 static void InitDeviceManagerImpl(void);
100 Tizen::Io::_IpcClient* __pIpcClient;
102 DeviceType __headSetType;
104 int __bluetoothReferenceCount;
106 Tizen::Base::Collection::ArrayListT<_DeviceEventListenerContainer*> __deviceEventList;
108 static _DeviceManagerImpl* __pDeviceManagerImpl;
113 #endif // _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_