|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Helper class for idle wait |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCAIDLEWAIT_H |
|
21 #define CCAIDLEWAIT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CIdle; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * This class gives some helper functions |
|
33 * |
|
34 * @lib chat.app |
|
35 * @since 2.1 |
|
36 */ |
|
37 class CCAIdleWait: public CBase |
|
38 { |
|
39 public: // New functions |
|
40 |
|
41 /** |
|
42 * This method halts the execution until |
|
43 * processor has some idle time |
|
44 * @CallbackFlag. Flag for callback. If |
|
45 * ETrue -> continue idle. |
|
46 * EFalse -> Stop idle. |
|
47 */ |
|
48 static void IdleWaitL( const TInt* aCallbackFlag = NULL ); |
|
49 |
|
50 private: // New methods |
|
51 |
|
52 /** |
|
53 * destructor |
|
54 */ |
|
55 ~CCAIdleWait(); |
|
56 |
|
57 /** |
|
58 * Constructor |
|
59 * @see IdleWaitL method for parameter. |
|
60 */ |
|
61 CCAIdleWait( const TInt* aCallbackFlag ); |
|
62 |
|
63 /** |
|
64 * Does the actual waiting |
|
65 */ |
|
66 void DoIdleWaitL(); |
|
67 |
|
68 /** |
|
69 * Does the actual stopping |
|
70 */ |
|
71 void DoIdleStop(); |
|
72 |
|
73 /** |
|
74 * CIdle callback function |
|
75 * @param aInstance Instance of this class |
|
76 * @return Need for recall |
|
77 */ |
|
78 static TBool Callback( TAny* aInstance ); |
|
79 |
|
80 |
|
81 private: // Data |
|
82 |
|
83 // Owns |
|
84 CIdle* iIdle; |
|
85 |
|
86 // active object wait |
|
87 CActiveSchedulerWait iWait; |
|
88 |
|
89 /// Callback flag for knowing when to stop idle. |
|
90 const TInt* iCallbackFlag; |
|
91 |
|
92 }; |
|
93 |
|
94 #endif // CCAIDLEWAIT_H |
|
95 |
|
96 // End of File |