10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * Wrapper for Symbian Connection Monitor library. |
16 */ |
16 */ |
17 |
17 |
18 #ifndef WLANQTUTILSCONMONWRAPPER_H |
18 #ifndef WLANQTUTILSCONMONWRAPPER_H |
19 #define WLANQTUTILSCONMONWRAPPER_H |
19 #define WLANQTUTILSCONMONWRAPPER_H |
20 |
20 |
21 // INCLUDES |
21 // System includes |
|
22 |
22 #include <QObject> |
23 #include <QObject> |
23 #include <QList> |
24 #include <QList> |
24 #include <QStringList> |
25 #include <QSharedPointer> |
|
26 #include <QScopedPointer> |
25 |
27 |
26 QT_BEGIN_HEADER |
28 // User includes |
27 |
29 |
28 QT_BEGIN_NAMESPACE |
30 #include "wlanqtutils.h" |
29 |
31 |
30 #include "wlanqtutilscommon.h" |
32 // Forward declarations |
31 |
33 |
32 // FORWARD DECLARATIONS |
34 class WlanQtUtilsAp; |
33 class WlanQtUtilsWlanAp; |
35 class WlanQtUtilsConnection; |
34 class WlanQtUtilsActiveConn; |
36 class WlanQtUtilsConMonWrapperInfo; |
35 class ConnMonScanWlanAps; |
37 class WlanQtUtilsConMonWrapperDisconnect; |
36 class ConnMonConnInfo; |
|
37 class ConnMonConnDisconnect; |
|
38 |
38 |
39 // CLASS DECLARATION |
39 // External data types |
40 |
40 |
41 /** |
41 // Constants |
42 * ConMonWrapper class. |
42 |
43 */ |
43 // Class declaration |
44 class ConMonWrapper : public QObject |
44 |
|
45 class WlanQtUtilsConMonWrapper : public QObject |
45 { |
46 { |
46 Q_OBJECT |
47 Q_OBJECT |
47 |
48 |
48 public: |
49 public: |
49 |
50 |
50 /** |
51 // Data types |
51 * Constructor. |
52 |
52 */ |
53 explicit WlanQtUtilsConMonWrapper(QObject *parent = 0); |
53 ConMonWrapper(QObject *parent = 0); |
|
54 |
54 |
55 /** |
55 ~WlanQtUtilsConMonWrapper(); |
56 * Destructor. |
|
57 */ |
|
58 ~ConMonWrapper(); |
|
59 |
56 |
60 /** |
57 WlanQtUtilsConnection *activeConnection() const; |
61 * Requests wlan scanning |
|
62 * |
|
63 * @return ???. |
|
64 */ |
|
65 int scanAvailableWlanAPs(); |
|
66 |
|
67 /** |
|
68 * Emits available WLANs to engine. |
|
69 * |
|
70 * @param[in] availableWlanAPs Available WLAN access points found in scan. |
|
71 */ |
|
72 void emitAvailableWlans(QList<WlanQtUtilsWlanAp *> &availableWlanAPs); |
|
73 |
58 |
74 /** |
59 WlanQtUtilsConnection *connectionInfo(uint connectionId) const; |
75 * Emits signal indicating that a new connection has been created. |
|
76 * |
|
77 * @param[in] connectionId Connection ID. |
|
78 */ |
|
79 void emitConnCreatedEvent(uint connectionId); |
|
80 |
|
81 /** |
|
82 * Emits signal indicating that a connection has been deleted. |
|
83 * |
|
84 * @param[in] connectionId Connection ID. |
|
85 */ |
|
86 void emitConnDeletedEvent(uint connectionId); |
|
87 |
|
88 /** |
|
89 * Emits signal indicating that status of a connection has changed. |
|
90 * |
|
91 * @param[in] connectionId Connection ID. |
|
92 * @param[in] connectionStatus Connection status. |
|
93 */ |
|
94 void emitConnStatusEvent(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); |
|
95 |
60 |
96 /** |
|
97 * Return active connection information. |
|
98 * |
|
99 * @return Information of active connection, if one exists. |
|
100 */ |
|
101 WlanQtUtilsActiveConn *activeConnection(); |
|
102 |
|
103 /** |
|
104 * Returns information of a connection with the given connection ID. |
|
105 * |
|
106 * @param[in] connectionId Connection ID. |
|
107 * @return Information of the given connection, if one exists. |
|
108 */ |
|
109 WlanQtUtilsActiveConn *connectionInfo(uint connectionId); |
|
110 |
|
111 /** |
|
112 * Stops given connection regardless of how many applications are using it. |
|
113 * |
|
114 * @param[in] iapId IAP ID to disconnect. |
|
115 */ |
|
116 void disconnectIap(int iapId); |
61 void disconnectIap(int iapId); |
117 |
62 |
118 signals: |
63 signals: |
119 |
64 |
120 /** |
65 /*! |
121 * Signal indicating available WLAN access points. |
66 Signal indicating that a new connection has been created. |
122 * |
67 |
123 * @param[in] availableWlans Available WLAN access points found in scan. |
68 @param [in] connectionId Connection ID. |
124 */ |
|
125 void availableWlanApsFromWrapper(QList<WlanQtUtilsWlanAp *> &availableWlans); |
|
126 |
|
127 /** |
|
128 * Signal indicating that a new connection has been created. |
|
129 * |
|
130 * @param[in] connectionId Connection ID. |
|
131 */ |
69 */ |
132 void connCreatedEventFromWrapper(uint connectionId); |
70 void connCreatedEventFromWrapper(uint connectionId); |
133 |
71 |
134 /** |
72 /*! |
135 * Signal indicating that a connection has been deleted. |
73 Signal indicating that a connection has been deleted. |
136 * |
74 |
137 * @param[in] connectionId Connection ID. |
75 @param [in] connectionId Connection ID. |
138 */ |
76 */ |
139 void connDeletedEventFromWrapper(uint connectionId); |
77 void connDeletedEventFromWrapper(uint connectionId); |
140 |
78 |
141 /** |
79 /*! |
142 * Signal indicating that status of a connection has changed. |
80 Signal indicating that status of a connection has changed. |
143 * |
81 |
144 * @param[in] connectionId Connection ID. |
82 @param [in] connectionId Connection ID. |
145 * @param[in] connectionStatus Connection status. |
83 @param [in] connectionStatus Connection status. |
146 */ |
84 */ |
147 void connStatusEventFromWrapper(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); |
85 void connStatusEventFromWrapper( |
|
86 uint connectionId, |
|
87 WlanQtUtils::ConnStatus connectionStatus); |
148 |
88 |
149 private: // Data |
89 public slots: |
|
90 |
|
91 protected: |
|
92 |
|
93 protected slots: |
|
94 |
|
95 private: |
|
96 |
|
97 private slots: |
|
98 |
|
99 private: // data |
150 |
100 |
151 /** |
101 // Owned data |
152 * d_ptrScanWlans pointer to ConMonWrapperPrivate |
|
153 * Owned by ConMonWrapper object, instantiated in |
|
154 * constructor. |
|
155 */ |
|
156 ConnMonScanWlanAps *d_ptrScanWlans; |
|
157 |
102 |
158 /** |
103 //! Private implementation of connection info interface |
159 * d_ptrConnInfo pointer to ConMonWrapperPrivate |
104 QScopedPointer<WlanQtUtilsConMonWrapperInfo> d_ptrInfo; |
160 * Owned by ConMonWrapper object, instantiated in |
|
161 * constructor. |
|
162 */ |
|
163 ConnMonConnInfo *d_ptrConnInfo; |
|
164 |
105 |
165 /** |
106 //! Private implementation of connection disconnect interface |
166 * d_ptrConnDisconnect pointer to ConMonWrapperPrivate |
107 QScopedPointer<WlanQtUtilsConMonWrapperDisconnect> d_ptrDisconnect; |
167 * Owned by ConMonWrapper object, instantiated in |
|
168 * constructor. |
|
169 */ |
|
170 ConnMonConnDisconnect *d_ptrConnDisconnect; |
|
171 |
108 |
172 private: // Friend classes |
109 // Friend classes |
173 // TestWlanQtUtils is defined as a friend class in order to be able to |
110 |
174 // call event handlers of wrappers. |
111 // Friend classes in order to be able to emit public signals directly |
|
112 // from private implementation classes. |
|
113 friend class WlanQtUtilsConMonWrapperInfo; |
|
114 |
|
115 // This is defined as a friend class in order to be able to call |
|
116 // event handlers of wrappers from unit tests. |
175 friend class TestWlanQtUtils; |
117 friend class TestWlanQtUtils; |
176 }; |
118 }; |
177 |
119 |
178 QT_END_HEADER |
120 #endif // WLANQTUTILSCONMONWRAPPER_H |
179 |
|
180 QT_END_NAMESPACE |
|
181 |
|
182 #endif /* WLANQTUTILSCONMONWRAPPER_H */ |
|
183 |
|
184 // End of file |
|