|
1 /* |
|
2 * Copyright (c) 2006-2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PLUGINSCREENSAVERMONITORAO_H_ |
|
20 #define PLUGINSCREENSAVERMONITORAO_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32property.h> |
|
24 |
|
25 class MGlxTNObserver |
|
26 { |
|
27 public : |
|
28 /* |
|
29 * Constructor |
|
30 */ |
|
31 MGlxTNObserver() {} |
|
32 /* |
|
33 * Call back to get the number is left to create. |
|
34 */ |
|
35 virtual void updateTNCount(int & count) = 0; |
|
36 /* |
|
37 * Destructor |
|
38 */ |
|
39 virtual ~MGlxTNObserver() {} |
|
40 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * Class for monitoring harvester pause. |
|
45 */ |
|
46 class CGlxTNMonitor: public CActive |
|
47 { |
|
48 public: |
|
49 /** Construction */ |
|
50 IMPORT_C static CGlxTNMonitor* NewL( MGlxTNObserver *observer ); |
|
51 |
|
52 /** |
|
53 * Destructor - virtual and class not intended |
|
54 * for derivation, so not exported. |
|
55 */ |
|
56 virtual ~CGlxTNMonitor(); |
|
57 |
|
58 protected: |
|
59 |
|
60 /** |
|
61 * RunL |
|
62 * From CActive. |
|
63 */ |
|
64 virtual void RunL(); |
|
65 |
|
66 /** |
|
67 * DoCancel |
|
68 * From CActive. |
|
69 */ |
|
70 virtual void DoCancel(); |
|
71 |
|
72 /** |
|
73 * RunError. Error handler in case RunL() leaves. |
|
74 * From CActive. |
|
75 * @param aError Leave code from RunL. |
|
76 * @return Error code. KErrNone if error was handled. |
|
77 */ |
|
78 virtual TInt RunError( TInt aError ); |
|
79 |
|
80 private: |
|
81 /** |
|
82 * constructor |
|
83 */ |
|
84 CGlxTNMonitor( MGlxTNObserver *observer ); |
|
85 |
|
86 /** |
|
87 * 2nd phase construction. |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 private: |
|
92 RProperty iScreenSaverProperty; |
|
93 // TTime iStartTime; |
|
94 // TTime iStopTime; |
|
95 MGlxTNObserver *iObserver; |
|
96 }; |
|
97 |
|
98 |
|
99 #endif |
|
100 |