|
1 /* |
|
2 * Copyright (c) 2005-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * @file |
|
16 * This contains ActiveCallback.h |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __ACTIVE_CALLBACK_H__ |
|
22 #define __ACTIVE_CALLBACK_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 class MActiveCallback |
|
27 /** |
|
28 * @internalComponent |
|
29 * @test |
|
30 * |
|
31 * Asynchronus completion callback |
|
32 */ |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Method from which CActiveCallback informs the user RunL call |
|
37 * |
|
38 * @param aActive - the object that the RunL has completed on |
|
39 * @param aIndex - asynchronous command index |
|
40 * |
|
41 * @leave system wide error |
|
42 */ |
|
43 virtual void RunL(CActive* aActive, TInt aIndex) = 0; |
|
44 |
|
45 /** |
|
46 * Method from which CActiveCallback informs the user DoCancel call |
|
47 * |
|
48 * @param aActive - the object that the RunL has completed on |
|
49 * @param aIndex - asynchronous command index |
|
50 * |
|
51 * @leave system wide error |
|
52 */ |
|
53 virtual void DoCancel(CActive* aActive, TInt aIndex) = 0; |
|
54 }; |
|
55 |
|
56 class CActiveCallback : public CActive |
|
57 /** |
|
58 * @internalComponent |
|
59 * @test |
|
60 * |
|
61 * @see CActive |
|
62 * |
|
63 * Test Active Notification class |
|
64 * |
|
65 */ |
|
66 { |
|
67 public: |
|
68 IMPORT_C virtual ~CActiveCallback(); |
|
69 IMPORT_C static CActiveCallback* NewL(MActiveCallback& aCallback, TInt aPriority=EPriorityStandard); |
|
70 IMPORT_C static CActiveCallback* NewLC(MActiveCallback& aCallback, TInt aPriority=EPriorityStandard); |
|
71 |
|
72 IMPORT_C void Activate( TInt aIndex ); |
|
73 IMPORT_C void KickState(); |
|
74 IMPORT_C void RunL(); |
|
75 IMPORT_C void DoCancel(); |
|
76 |
|
77 protected: |
|
78 IMPORT_C CActiveCallback(MActiveCallback& aCallback, TInt aPriority); |
|
79 IMPORT_C void ConstructL(); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * This is internal and not intended for use. |
|
84 */ |
|
85 MActiveCallback& iCallback; |
|
86 TInt iIndex; |
|
87 }; |
|
88 |
|
89 #endif /* __ACTIVE_CALLBACK_H__ */ |