1 /* |
|
2 * Copyright (c) 2007-2008 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: Class header for CWsfScreenSaverWatcher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_WSFSCREENSAVERWACTHER_H |
|
21 #define C_WSFSCREENSAVERWACTHER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MWsfScreenSaverStateObserver; |
|
29 |
|
30 /** |
|
31 * Active object class which monitors screen saver activity and notifies |
|
32 * the observer when changes occur. |
|
33 * |
|
34 * @lib wsfmodel.lib |
|
35 * @since S60 5.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CWsfScreenSaverWatcher ): public CActive |
|
38 { |
|
39 public: // Constructors |
|
40 /** |
|
41 * Factory function. |
|
42 * @since S60 5.0 |
|
43 * @param aObserver The object to notify when changes occur. |
|
44 * @return Class instance. |
|
45 */ |
|
46 static CWsfScreenSaverWatcher* NewL( |
|
47 MWsfScreenSaverStateObserver& aObserver ); |
|
48 |
|
49 /** |
|
50 * Factory function. |
|
51 * @since S60 5.0 |
|
52 * @param aObserver The object to notify when changes occur. |
|
53 * @return Class instance. |
|
54 */ |
|
55 static CWsfScreenSaverWatcher* NewLC( |
|
56 MWsfScreenSaverStateObserver& aObserver ); |
|
57 |
|
58 ~CWsfScreenSaverWatcher(); |
|
59 |
|
60 private: // Constructors |
|
61 |
|
62 /** |
|
63 * Constructor. |
|
64 * @since S60 5.0 |
|
65 * @param aObserver The object to notify when changes occur. |
|
66 */ |
|
67 CWsfScreenSaverWatcher( MWsfScreenSaverStateObserver& aObserver ); |
|
68 |
|
69 void ConstructL(); |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Start receiving events from screensaver |
|
75 * @since S60 5.0 |
|
76 */ |
|
77 void StartStatusScanning(); |
|
78 |
|
79 protected: // from CActive |
|
80 void RunL(); |
|
81 void DoCancel(); |
|
82 TInt RunError( TInt aError ); |
|
83 |
|
84 private: // Data |
|
85 |
|
86 /** |
|
87 * Handle to the screen saver property value |
|
88 */ |
|
89 RProperty iProperty; |
|
90 |
|
91 /** |
|
92 * The object to notify when changes occur. Not owned. |
|
93 */ |
|
94 MWsfScreenSaverStateObserver* iObserver; |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // C_WSFSCREENSAVERWACTHER_H |
|
99 |
|