|
1 // Copyright (c) 2008-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __SSMPROPERTYOBSERVER_H__ |
|
17 #define __SSMPROPERTYOBSERVER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <e32property.h> |
|
21 #include <ssm/ssmutility.h> |
|
22 |
|
23 /** |
|
24 * Provide an abstract class for observing RProperty value changes from the SSM Utility Server. |
|
25 * |
|
26 * @publishedPartner |
|
27 * @released |
|
28 */ |
|
29 class CSsmPropertyObserver : public CActive, public MSsmUtility |
|
30 { |
|
31 public: |
|
32 |
|
33 IMPORT_C CSsmPropertyObserver(TUid aCategory, TUint aKey); |
|
34 |
|
35 /** |
|
36 * Function that is called everytime the property for this observer changes. |
|
37 * |
|
38 * This is also called once when the observation is first started using StartL(). |
|
39 * |
|
40 * @param aValue The new value for the observed property. |
|
41 * |
|
42 * @return ETrue if this observer should continue to monitor, EFalse otherwise. |
|
43 * |
|
44 * @note If EFalse is returned from this object then this object is not destroyed. |
|
45 * |
|
46 * @publishedPartner |
|
47 * @released |
|
48 */ |
|
49 virtual TBool PropertyChangedL(TInt aValue) = 0; |
|
50 |
|
51 // From MSsmUtility |
|
52 IMPORT_C virtual void InitializeL(); |
|
53 IMPORT_C virtual void StartL(); |
|
54 IMPORT_C virtual void Release(); |
|
55 |
|
56 protected: |
|
57 void doRunL(); |
|
58 |
|
59 IMPORT_C virtual ~CSsmPropertyObserver(); |
|
60 |
|
61 // From CActive |
|
62 IMPORT_C virtual void RunL(); |
|
63 IMPORT_C virtual void DoCancel(); |
|
64 IMPORT_C virtual TInt RunError(TInt aError); |
|
65 |
|
66 protected: |
|
67 const TUid iCategory; |
|
68 const TUint iKey; |
|
69 |
|
70 RProperty iProperty; |
|
71 |
|
72 TInt iReserved[2]; |
|
73 }; |
|
74 |
|
75 #endif // __SSMPROPERTYOBSERVER_H__ |