|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef WLANQTUTILSCONMONWRAPPER_H |
|
19 #define WLANQTUTILSCONMONWRAPPER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <QObject> |
|
23 #include <QList> |
|
24 #include <QStringList> |
|
25 |
|
26 QT_BEGIN_HEADER |
|
27 |
|
28 QT_BEGIN_NAMESPACE |
|
29 |
|
30 #include "wlanqtutilscommon.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class WlanQtUtilsWlanAp; |
|
34 class WlanQtUtilsActiveConn; |
|
35 class ConnMonScanWlanAps; |
|
36 class ConnMonConnInfo; |
|
37 class ConnMonConnDisconnect; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * ConMonWrapper class. |
|
43 */ |
|
44 class ConMonWrapper : public QObject |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Constructor. |
|
52 */ |
|
53 ConMonWrapper(QObject *parent = 0); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~ConMonWrapper(); |
|
59 |
|
60 /** |
|
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 |
|
74 /** |
|
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 |
|
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); |
|
117 |
|
118 signals: |
|
119 |
|
120 /** |
|
121 * Signal indicating available WLAN access points. |
|
122 * |
|
123 * @param[in] availableWlans Available WLAN access points found in scan. |
|
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 */ |
|
132 void connCreatedEventFromWrapper(uint connectionId); |
|
133 |
|
134 /** |
|
135 * Signal indicating that a connection has been deleted. |
|
136 * |
|
137 * @param[in] connectionId Connection ID. |
|
138 */ |
|
139 void connDeletedEventFromWrapper(uint connectionId); |
|
140 |
|
141 /** |
|
142 * Signal indicating that status of a connection has changed. |
|
143 * |
|
144 * @param[in] connectionId Connection ID. |
|
145 * @param[in] connectionStatus Connection status. |
|
146 */ |
|
147 void connStatusEventFromWrapper(uint connectionId, WlanQtUtilsConnectionStatus connectionStatus); |
|
148 |
|
149 private: // Data |
|
150 |
|
151 /** |
|
152 * d_ptrScanWlans pointer to ConMonWrapperPrivate |
|
153 * Owned by ConMonWrapper object, instantiated in |
|
154 * constructor. |
|
155 */ |
|
156 ConnMonScanWlanAps *d_ptrScanWlans; |
|
157 |
|
158 /** |
|
159 * d_ptrConnInfo pointer to ConMonWrapperPrivate |
|
160 * Owned by ConMonWrapper object, instantiated in |
|
161 * constructor. |
|
162 */ |
|
163 ConnMonConnInfo *d_ptrConnInfo; |
|
164 |
|
165 /** |
|
166 * d_ptrConnDisconnect pointer to ConMonWrapperPrivate |
|
167 * Owned by ConMonWrapper object, instantiated in |
|
168 * constructor. |
|
169 */ |
|
170 ConnMonConnDisconnect *d_ptrConnDisconnect; |
|
171 |
|
172 private: // Friend classes |
|
173 // TestWlanQtUtils is defined as a friend class in order to be able to |
|
174 // call event handlers of wrappers. |
|
175 friend class TestWlanQtUtils; |
|
176 }; |
|
177 |
|
178 QT_END_HEADER |
|
179 |
|
180 QT_END_NAMESPACE |
|
181 |
|
182 #endif /* WLANQTUTILSCONMONWRAPPER_H */ |
|
183 |
|
184 // End of file |