1 /* |
|
2 * =========================================================================== |
|
3 * Name : HgPropListener.h |
|
4 * Part of : Hg |
|
5 * Description : Class to get notifications about changes to a P&S property |
|
6 * |
|
7 * Copyright © 2008 Nokia Corporation. |
|
8 * This material, including documentation and any related |
|
9 * computer programs, is protected by copyright controlled by |
|
10 * Nokia Corporation. All rights are reserved. Copying, |
|
11 * including reproducing, storing, adapting or translating, any |
|
12 * or all of this material requires the prior written consent of |
|
13 * Nokia Corporation. This material also contains confidential |
|
14 * information which may not be disclosed to others without the |
|
15 * prior written consent of Nokia Corporation. |
|
16 * =========================================================================== |
|
17 */ |
|
18 |
|
19 #ifndef __PROPLISTENER_H__ |
|
20 #define __PROPLISTENER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32property.h> |
|
24 |
|
25 /** |
|
26 * Observer interface for getting notifications about a P&S property change. |
|
27 */ |
|
28 class MHgPropertyChangeObserver |
|
29 { |
|
30 public: |
|
31 virtual void PropertyChanged( TUid aCategory, TUint aKey ) = 0; |
|
32 }; |
|
33 |
|
34 /** |
|
35 * Class to get notifications about changes to a P&S property. |
|
36 */ |
|
37 NONSHARABLE_CLASS( CHgPropertyListener ) : public CActive |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Constructor. |
|
42 * Starts listening for the property with the given category/key. |
|
43 */ |
|
44 IMPORT_C CHgPropertyListener( TUid aCategory, |
|
45 TUint aKey, MHgPropertyChangeObserver& aObserver ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 IMPORT_C ~CHgPropertyListener(); |
|
51 |
|
52 private: |
|
53 void DoCancel(); |
|
54 void RunL(); |
|
55 TInt RunError( TInt aError ); |
|
56 |
|
57 MHgPropertyChangeObserver& iObserver; |
|
58 RProperty iProperty; |
|
59 TUid iCategory; |
|
60 TUint iKey; |
|
61 }; |
|
62 |
|
63 #endif |
|
64 |
|
65 // End of file |
|