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 FSysDeviceManager.h
19 * @brief This is the header file for the %DeviceManager class.
21 * This header file contains the declarations of the %DeviceManager class.
26 #ifndef _FSYS_DEVICE_MANAGER_H_
27 #define _FSYS_DEVICE_MANAGER_H_
29 #include <FBaseObject.h>
31 namespace Tizen { namespace System
34 class IDeviceEventListener;
38 * Defines the type of the supported devices.
45 BluetoothHeadset, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_BLUETOOTH_HEADSET.
46 Charger, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_CHARGER.
47 UsbClient, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_USB_CLIENT.
48 TvOut, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_TV_OUT.
49 WiredHeadset, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_WIRED_HEADSET.
50 WiredHeadphone, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_WIRED_HEADPHONE.
51 StorageCard, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_STORAGE_CARD.
52 Keyboard, // This enum value is deprecated. Instead of using this enum value, use DEVICE_TYPE_KEYBOARD.
53 DEVICE_TYPE_BLUETOOTH_HEADSET = BluetoothHeadset, /**< Bluetooth headset */
54 DEVICE_TYPE_CHARGER = Charger, /**< Charger*/
55 DEVICE_TYPE_USB_CLIENT = UsbClient, /**< USB client */
56 DEVICE_TYPE_TV_OUT = TvOut, /**< TV out */
57 DEVICE_TYPE_WIRED_HEADSET = WiredHeadset, /**< Wired headset */
58 DEVICE_TYPE_WIRED_HEADPHONE = WiredHeadphone, /**< Wired headphone */
59 DEVICE_TYPE_STORAGE_CARD = StorageCard, /**< Storage card */
60 DEVICE_TYPE_KEYBOARD = Keyboard, /**< Hardware Built-in keyboard */
61 DEVICE_TYPE_HDMI, /**< HDMI */
65 * @class DeviceManager
66 * @brief This class provides methods for device management.
70 * @final This class is not intended for extension.
72 * The %DeviceManager class provides listener to handle events for various external device,
73 * such as a Bluetooth headset, HDMI, and headphone.
74 * This class also gets the current state of the device. You cannot create an instance of this class directly.
76 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/device_management.htm">External Device Management</a>.
78 * @see IDeviceEventListener
81 class _OSP_EXPORT_ DeviceManager
82 : public Tizen::Base::Object
87 * Gets the specific device state.
90 * @brief <i> [Compatibility] </i>
94 * @compatibility This method has compatibility issues with %Tizen API versions @b prior @b to @b 2.0. @n
95 * For more information, see @ref DeviceManagerGetStatePage "here".
98 * @param[in] deviceType The value from the enumerator DeviceType indicating the device
99 * @param[out] state The device <a href="../org.tizen.native.appprogramming/html/guide/system/device_management.htm">state</a> of type Tizen::Base::String
101 * @return An error code
102 * @exception E_SUCCESS The method is successful.
103 * @exception E_SYSTEM A system error has occurred.
104 * @exception E_INVALID_ARG The specified @c deviceType is not valid.
105 * @exception E_UNSUPPORTED_OPERATION The specified @c deviceType is not supported on this model.
107 static result GetState(DeviceType deviceType, Tizen::Base::String& state);
111 * @page DeviceManagerGetStatePage Compatibility for GetState()
112 * @section DeviceManagerGetStatePageIssueSection Issues
113 * Implementation of this method in OSP compatible applications has the following issue: @n
114 * The GetState() method does not return E_DEVICE_UNAVAILABLE anymore. The E_DEVICE_UNAVAILABLE exception is removed.
115 * @section DeviceManagerGetStatePageIssueSection Resolutions
116 * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE.
121 * Adds a device event listener.
124 * @brief <i> [Compatibility] </i>
128 * @compatibility This method has compatibility issues with %Tizen API versions @b prior @b to @b 2.0. @n
129 * For more information, see @ref DeviceManagerAddDeviceEventListenerPage "here".
132 * @return An error code
133 * @param[in] deviceType The types of a device
134 * @param[in] listener The device event listener
135 * @exception E_SUCCESS The method is successful.
136 * @exception E_SYSTEM A system error has occurred.
137 * @exception E_INVALID_ARG The specified @c deviceType is not valid.
138 * @exception E_OBJ_ALREADY_EXIST The specified @c deviceType and @c listener are already registered.
139 * @exception E_UNSUPPORTED_OPERATION The specified @c deviceType is not supported on this model.
141 static result AddDeviceEventListener(DeviceType deviceType, IDeviceEventListener& listener);
145 * @page DeviceManagerAddDeviceEventListenerPage Compatibility for AddDeviceEventListener()
146 * @section DeviceManagerAddDeviceEventListenerPageIssueSection Issues
147 * Implementation of this method in OSP compatible applications has the following issue: @n
148 * This AddDeviceEventListener() method does not return E_DEVICE_UNAVAILABLE anymore. The E_DEVICE_UNAVAILABLE exception is removed.
149 * @section DeviceManagerAddDeviceEventListenerPageIssueSection Resolutions
150 * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE.
155 * Removes a device event listener from all types of devices.
159 * @return An error code
160 * @param[in] deviceType The types of a device
161 * @param[in] listener The device event listener
162 * @exception E_SUCCESS The method is successful.
163 * @exception E_SYSTEM A system error has occurred.
164 * @exception E_INVALID_ARG The specified @c deviceType is not valid.
165 * @exception E_OBJ_NOT_FOUND The specified @c deviceType and @c listener are not registered.
166 * @exception E_UNSUPPORTED_OPERATION The specified @c deviceType is not supported on this model.
168 static result RemoveDeviceEventListener(DeviceType deviceType, IDeviceEventListener& listener);
172 * @page DeviceManagerRemoveDeviceEventListenerPage Compatibility for RemoveDeviceEventListener()
173 * @section DeviceManagerRemoveDeviceEventListenerPageIssueSection Issues
174 * Implementation of this method in OSP compatible applications has the following issue: @n
175 * This RemoveDeviceEventListener() method does not return E_DEVICE_UNAVAILABLE anymore. The E_DEVICE_UNAVAILABLE exception is removed.
176 * @section DeviceManagerRemoveDeviceEventListenerPageIssueSection Resolutions
177 * The E_UNSUPPORTED_OPERATION exception is added since Tizen. So, use E_UNSUPPORTED_OPERATION instead of E_DEVICE_UNAVAILABLE.
182 * Removes all device event listeners.
186 * @return An error code
187 * @exception E_SUCCESS The method is successful.
188 * @exception E_SYSTEM A system error has occurred.
190 static result RemoveAllDeviceEventListeners(void);
194 * This is the default constructor for this class. This default constructor is intentionally declared as private so that only the platform can create an instance.
199 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object(). @n
201 virtual ~DeviceManager(void);
204 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
206 DeviceManager(const DeviceManager& value);
209 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
211 DeviceManager& operator =(const DeviceManager& value);
214 friend class _DeviceManagerImpl;
215 class _DeviceManagerImpl* __pDeviceManagerImpl;
220 #endif // _FSYS_DEVICE_MANAGER_H_