1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: The plugin interface of Bluetooth device setting ui |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BTABSTRACTDEVSETTING_H |
|
19 #define BTABSTRACTDEVSETTING_H |
|
20 |
|
21 #include <HbDataForm> |
|
22 #include <btdevsettingglobal.h> |
|
23 |
|
24 /*! |
|
25 \class BtAbstractDevSetting |
|
26 \brief The class BtAbstractDevSetting is the base class |
|
27 for offering a UI to manage certain settings of |
|
28 a remote Bluetooth device, e.g., accessory and keyboard settings. |
|
29 */ |
|
30 class BTDEVSETTINGINTERFACE_EXPORT BtAbstractDevSetting : public QObject |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 |
|
36 /*! |
|
37 Constructs a device setting plugin entry. |
|
38 |
|
39 \param address the BD_ADDR of the remote device which this setting |
|
40 plugin is provided for. Its format is XXXXXXXXXXXX, where X is a |
|
41 hexadecimal digit. Case is insensitive. |
|
42 \parent the parent of this object. |
|
43 */ |
|
44 explicit BtAbstractDevSetting(const QString &address, QObject *parent = 0 ); |
|
45 |
|
46 /*! |
|
47 Destructor of BtAbstractDeviceSetting. |
|
48 */ |
|
49 virtual ~BtAbstractDevSetting(); |
|
50 |
|
51 /*! |
|
52 Gets the BD_ADDR of the remote device which this setting |
|
53 plugin is provided for. |
|
54 |
|
55 \return the device address of the remote device in hex string |
|
56 */ |
|
57 const QString &getRemote() const; |
|
58 |
|
59 /*! |
|
60 Tells if this setting plugin can provide a setting UI |
|
61 for the target device. If the answer is true, this plugin may be |
|
62 requested to create a setting widget by function |
|
63 \code createSettingWidget() \endcode. |
|
64 |
|
65 \return true if a setting is currently available. false, otherwise. |
|
66 |
|
67 The default implementation returns false. |
|
68 */ |
|
69 virtual bool isSettingAvailable(); |
|
70 |
|
71 /*! |
|
72 Gets a \code HbDataForm \endcode instance which consists of the |
|
73 setting UI from this specific plugin. The loader of this plugin will |
|
74 add this dataform into its setting view if its setting is available at |
|
75 the time. |
|
76 |
|
77 The ownership of this widget is transferred to the plugin loader. |
|
78 |
|
79 The default implementation returns 0. |
|
80 |
|
81 \return an \code HbDataForm \endcode instance. |
|
82 */ |
|
83 virtual HbDataForm *getSettingWidget(); |
|
84 |
|
85 /*! |
|
86 Informs that device setting is going to foreground. This |
|
87 implies that the \code HbWidget \endcode from function |
|
88 \code createSettingWidget \endcode will be shown if the setting |
|
89 from this plugin is available. |
|
90 |
|
91 The default implementation does nothing. |
|
92 */ |
|
93 virtual void aboutToForeground(); |
|
94 |
|
95 /*! |
|
96 Informs that device setting is going to background. |
|
97 |
|
98 The default implementation does nothing. |
|
99 */ |
|
100 virtual void aboutToBackground(); |
|
101 |
|
102 /*! |
|
103 Informs that device setting is going to close. |
|
104 |
|
105 The default implementation does nothing. |
|
106 */ |
|
107 virtual void aboutToClose(); |
|
108 |
|
109 signals: |
|
110 |
|
111 /*! |
|
112 The signal the plugin should emit for informing that the |
|
113 availability of this setting is changed. |
|
114 |
|
115 If the setting becomes available, the owner of this plugin may |
|
116 request the plugin to create a setting widget. |
|
117 |
|
118 If the setting becomes unavailable, the owner of this plugin may close and |
|
119 destroy the setting widget. |
|
120 |
|
121 \param setting the pointer of the setting whose status has changed. |
|
122 |
|
123 \param available true if the setting is available; false otherwise. |
|
124 |
|
125 \sa isSettingAvailable(). |
|
126 */ |
|
127 void settingAvailabilityChanged(BtAbstractDevSetting *setting, bool available); |
|
128 |
|
129 private: |
|
130 |
|
131 /*! |
|
132 The remote device address in format XXXXXXXXXXXX where X is a |
|
133 hexadecimal digit. |
|
134 */ |
|
135 QString mRemote; |
|
136 }; |
|
137 |
|
138 #endif /* BTABSTRACTDEVSETTING_H */ |
|