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
53 class _SystemServiceMessageClient;
55 class _DeviceManagerImpl
56 : public Tizen::System::_ICommunicationDispatcherListener
61 virtual ~_DeviceManagerImpl();
64 result GetState(DeviceType deviceType, Tizen::Base::String& state);
66 result AddDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
68 result RemoveDeviceEventListener(DeviceType deviceType, IDeviceEventListener* pListener);
70 result RemoveAllDeviceEventListeners(void);
73 void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
75 void SendEvent(runtime_info_key_e key);
77 void SendEvent(DeviceType deviceType, Tizen::Base::String& state);
79 static _DeviceManagerImpl* GetInstance(void);
82 _DeviceManagerImpl(const _DeviceManagerImpl& deviceManagerImpl);
84 _DeviceManagerImpl& operator =(const _DeviceManagerImpl& deviceManagerImpl);
86 result AddOnExistedListener(DeviceType deviceType, const IDeviceEventListener* pListener);
88 result RequireBluetoothEvent(void);
90 result ReleaseBluetoothEvent(void);
92 Tizen::Io::_IpcClient* GetIpcClient(void);
94 static void OnDeviceStateChanged(runtime_info_key_e key, void* pData);
96 static void DeviceEventVConfCallBack(keynode_t* node, void* userData);
98 static void MmcEventVconfCallback(keynode_t* node, void* userData);
100 static void InitDeviceManagerImpl(void);
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;
113 #endif // _FSYS_INTERNAL_DEVICE_MANAGER_IMPL_H_