|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This contains CTestActive |
|
15 // |
|
16 // |
|
17 |
|
18 #if (!defined __SMOKETEST_ACTIVE_H__) |
|
19 #define __SMOKETEST_ACTIVE_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 /** |
|
24 * Multimedia test timer completion callback |
|
25 */ |
|
26 class MTestActiveCallback |
|
27 { |
|
28 public: |
|
29 /** |
|
30 * Method from which CTestActive informs the user RunL call |
|
31 */ |
|
32 virtual void RunL() = 0; |
|
33 /** |
|
34 * Method from which CTestActive informs the user DoCancel call |
|
35 */ |
|
36 virtual void DoCancel() = 0; |
|
37 }; |
|
38 |
|
39 /** |
|
40 * Test Active Notification class |
|
41 * |
|
42 */ |
|
43 class CTestActive : public CActive |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Destructor |
|
48 */ |
|
49 IMPORT_C virtual ~CTestActive(); |
|
50 |
|
51 /** |
|
52 * Two phase constructor that allocates and constructs |
|
53 * a new Active object whos actions are performed by a callback |
|
54 * |
|
55 * \param aTestActiveCallback object to inform on RunL. |
|
56 * \param aPriority priority of active object. |
|
57 * \return New Callback active object. |
|
58 */ |
|
59 IMPORT_C static CTestActive* NewL(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard); |
|
60 |
|
61 /** |
|
62 * Two phase constructor that allocates and constructs |
|
63 * a new Active object whos actions are performed by a callback |
|
64 * |
|
65 * \param aTestActiveCallback object to inform on RunL. |
|
66 * \param aPriority priority of active object. |
|
67 * \return New Callback active object. |
|
68 */ |
|
69 IMPORT_C static CTestActive* NewLC(MTestActiveCallback& aTestActiveCallback, TInt aPriority=EPriorityStandard); |
|
70 |
|
71 /** |
|
72 * Activate the object |
|
73 */ |
|
74 IMPORT_C void Activate(); |
|
75 |
|
76 /** |
|
77 * Active object RunL implementation. |
|
78 * |
|
79 * Calls the MTestActiveCallback::RunL to inform user that the RunL has been reached. |
|
80 */ |
|
81 void RunL(); |
|
82 /** |
|
83 * Active object DoCancel implementation. |
|
84 * |
|
85 * Calls the MTestActiveCallback::DoCancel to inform user that the DoCancel has been reached. |
|
86 */ |
|
87 void DoCancel(); |
|
88 |
|
89 protected: |
|
90 /** |
|
91 * Protected constructor with timer completion callback and priority. |
|
92 * |
|
93 * Called by two phase constructor. |
|
94 * |
|
95 * \param aTestTimerCallback object to inform on timer completion. |
|
96 * \param aPriority priority of active object. |
|
97 */ |
|
98 CTestActive(MTestActiveCallback& aTestActiveCallback, TInt aPriority); |
|
99 |
|
100 private: |
|
101 /** |
|
102 * This is internal and not intended for use. |
|
103 * |
|
104 * Second phase of two phase constructor. |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 private: |
|
109 /** |
|
110 * This is internal and not intended for use. |
|
111 */ |
|
112 MTestActiveCallback& iTestActiveCallback; |
|
113 }; |
|
114 |
|
115 #endif /* __SMOKETEST_ACTIVE_H__ */ |