1 /* |
|
2 * Copyright (c) 2007-2008 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: Implementation of CWsfConnectActiveWrapper. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CWSFCONNECTACTIVEWRAPPER_H |
|
19 #define CWSFCONNECTACTIVEWRAPPER_H |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 // INTERNAL INCLUDES |
|
25 #include "wsfaicontroller.h" |
|
26 #include "wsfcommon.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CWsfModel; |
|
30 |
|
31 /** |
|
32 * Active object that connects WLAN |
|
33 * |
|
34 * @lib wsfaiplugin.lib |
|
35 * @since S60 v5.2 |
|
36 */ |
|
37 class CWsfConnectActiveWrapper : public CActive |
|
38 { |
|
39 public: |
|
40 // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 * @since S60 5.2 |
|
45 */ |
|
46 ~CWsfConnectActiveWrapper(); |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * @since S60 5.2 |
|
51 */ |
|
52 static CWsfConnectActiveWrapper* NewL( CWsfModel* aModel ); |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @since S60 5.2 |
|
57 */ |
|
58 static CWsfConnectActiveWrapper* NewLC( CWsfModel* aModel ); |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * Function for making the initial request |
|
64 * @since S60 5.2 |
|
65 * @param aIapId WLAN IAP id to connect to. |
|
66 * @param aConnectOnly ETrue if Connect selected |
|
67 * @param aPersistence Persistence property of the IAP |
|
68 */ |
|
69 void Start( TUint aIapID, TBool aConnectOnly, |
|
70 TWsfIapPersistence aPersistence ); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * constructor |
|
76 */ |
|
77 CWsfConnectActiveWrapper(); |
|
78 |
|
79 /** |
|
80 * Factory function. |
|
81 * @since S60 5.2 |
|
82 * @param aModel CWsfModel pointer |
|
83 */ |
|
84 void ConstructL( CWsfModel* aModel ); |
|
85 |
|
86 private: |
|
87 // From CActive |
|
88 /** |
|
89 * @see CActive |
|
90 */ |
|
91 void RunL(); |
|
92 |
|
93 /** |
|
94 * @see CActive |
|
95 */ |
|
96 void DoCancel(); |
|
97 |
|
98 /** |
|
99 * @see CActive |
|
100 */ |
|
101 TInt RunError( TInt aError ); |
|
102 |
|
103 private: |
|
104 /** |
|
105 * States of the active object |
|
106 */ |
|
107 enum CWsfConnectActiveWrapperState |
|
108 { |
|
109 EUninitialized, // Uninitialized |
|
110 EInitialized, // Initalized |
|
111 EError |
|
112 // Error condition |
|
113 }; |
|
114 |
|
115 private: |
|
116 |
|
117 /** |
|
118 * State of the active object |
|
119 */ |
|
120 TInt iState; // State of the active object |
|
121 |
|
122 /** |
|
123 * Result |
|
124 */ |
|
125 TPckgBuf<TBool> iPckg; |
|
126 |
|
127 /** |
|
128 * Reference to Model |
|
129 */ |
|
130 CWsfModel* iModel; |
|
131 |
|
132 /** |
|
133 * IAP ID |
|
134 */ |
|
135 TUint iIapID; |
|
136 |
|
137 /** |
|
138 * Indicates whether Connect or Start Web browsing was selected |
|
139 */ |
|
140 TBool iConnectOnly; |
|
141 |
|
142 /** |
|
143 * Persistence value of IAP |
|
144 */ |
|
145 TWsfIapPersistence iPersistence; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif // CWSFCONNECTACTIVEWRAPPER_H |
|