|
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: This file contains the header file of the |
|
15 * CTestCallBack class. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef TESTCALLBACK_H |
|
20 #define TESTCALLBACK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // CONSTANTS |
|
26 // None |
|
27 |
|
28 // MACROS |
|
29 // None |
|
30 |
|
31 // DATA TYPES |
|
32 // None |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 // None |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 // None |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 // DESCRIPTION |
|
43 // Simple class for callbacks. |
|
44 |
|
45 class CCallBack |
|
46 :public CAsyncCallBack |
|
47 { |
|
48 public: // Enumerations |
|
49 |
|
50 private: // Enumerations |
|
51 |
|
52 public: // Constructors and destructor |
|
53 /** |
|
54 * C++ constructor. |
|
55 */ |
|
56 //CCallBack( TInt aPriority ):CAsyncCallBack( aPriority ) {} |
|
57 |
|
58 /** |
|
59 * C++ constructor. |
|
60 */ |
|
61 CCallBack( TCallBack& aCallBack, TInt aPriority ): |
|
62 CAsyncCallBack( aCallBack, aPriority ) {} |
|
63 |
|
64 /** |
|
65 * C++ destructor. |
|
66 */ |
|
67 ~CCallBack(){ Cancel(); } |
|
68 |
|
69 public: // New functions |
|
70 /** |
|
71 * Return reference to TRequestStatus member. |
|
72 */ |
|
73 TRequestStatus& Status(){ return iStatus; } |
|
74 |
|
75 /** |
|
76 * Set CCallBack active. |
|
77 */ |
|
78 void SetActive() |
|
79 { |
|
80 iStatus = KRequestPending; |
|
81 CActive::SetActive(); |
|
82 }; |
|
83 |
|
84 public: // Functions from base classes |
|
85 |
|
86 /** |
|
87 * Handle completion. |
|
88 */ |
|
89 void RunL(){ iCallBack.CallBack(); } |
|
90 |
|
91 protected: // New functions |
|
92 |
|
93 protected: // Functions from base classes |
|
94 |
|
95 private: |
|
96 |
|
97 public: // Data |
|
98 |
|
99 protected: // Data |
|
100 |
|
101 private: // Data |
|
102 |
|
103 public: // Friend classes |
|
104 |
|
105 protected: // Friend classes |
|
106 |
|
107 private: // Friend classes |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // TESTCALLBACK_H |
|
112 |
|
113 // End of File |