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 the License "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: This class implements an active object with callback functionality. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WLANCBWAITER_H |
|
20 #define WLANCBWAITER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * This class implements an active object with callback functionality. |
|
26 * |
|
27 * @since S60 v3.2 |
|
28 */ |
|
29 NONSHARABLE_CLASS( CWlanCbWaiter ) : public CActive |
|
30 { |
|
31 |
|
32 public: |
|
33 |
|
34 /** |
|
35 * Factory for creating an instance of CWlanTestWaiter. |
|
36 * |
|
37 * @param aCallback Callback to call when active object completes. |
|
38 * @return NULL if unable create an instance, a pointer to the instance otherwise. |
|
39 */ |
|
40 static CWlanCbWaiter* NewL( |
|
41 const TCallBack& aCallback ); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CWlanCbWaiter(); |
|
47 |
|
48 /** |
|
49 * Issue an asynchronous request. |
|
50 * |
|
51 * @since S60 v3.2 |
|
52 */ |
|
53 void IssueRequest(); |
|
54 |
|
55 /** |
|
56 * Return the status of the request. |
|
57 * |
|
58 * @return Reference to status of the request. |
|
59 */ |
|
60 TRequestStatus& RequestStatus(); |
|
61 |
|
62 // from base class CActive |
|
63 |
|
64 /** |
|
65 * From CActive. |
|
66 * Called by the active object framework when the request has been completed. |
|
67 */ |
|
68 void RunL(); |
|
69 |
|
70 /** |
|
71 * From CActive. |
|
72 * Called by the framework if RunL leaves. |
|
73 * |
|
74 * @param aError The error code RunL leaved with. |
|
75 * @return KErrNone if leave was handled, one of the system-wide error codes otherwise. |
|
76 */ |
|
77 TInt RunError( |
|
78 TInt aError ); |
|
79 |
|
80 /** |
|
81 * From CActive. |
|
82 * Called by the framework when Cancel() has been called. |
|
83 */ |
|
84 void DoCancel(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * Constructor. |
|
90 * |
|
91 * @param aCallback Callback to call when active object completes. |
|
92 */ |
|
93 CWlanCbWaiter( |
|
94 const TCallBack& aCallback ); |
|
95 |
|
96 /** |
|
97 * By default Symbian 2nd phase constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 private: // data |
|
102 |
|
103 /** Function to call once request has been completed. */ |
|
104 TCallBack iCallback; |
|
105 |
|
106 }; |
|
107 |
|
108 #endif // WLANCBWAITER_H |
|