|
1 /* |
|
2 * Copyright (c) 2002 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: Publish & Subscribe property change observer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VMDETDLGPROPERTYOBSERVER_H |
|
21 #define VMDETDLGPROPERTYOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> // CActive |
|
25 #include <e32property.h> // RProperty |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CVmDetailsDialog; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Implementation of the Publish & Subscribe property change observer |
|
34 * |
|
35 * @lib |
|
36 * @since 2.6 |
|
37 */ |
|
38 class CVmDetDlgPropertyObserver : public CActive |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param aObserver Observer to be informed when observed property |
|
45 * changes |
|
46 */ |
|
47 static CVmDetDlgPropertyObserver* NewL( CVmDetailsDialog& aDetDialog ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CVmDetDlgPropertyObserver(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Starts observing the given key for any changes |
|
58 * Notifies the observer when the property changes |
|
59 * @since 2.6 |
|
60 * @param aCategory, Category of the observed property |
|
61 * @param aKey, Observed property |
|
62 */ |
|
63 void ObservePropertyChangeL( TUid aCategory, TUint aKey ); |
|
64 |
|
65 protected: // Functions from base classes |
|
66 |
|
67 /** |
|
68 * From CActive |
|
69 */ |
|
70 void RunL(); |
|
71 |
|
72 /** |
|
73 * From CActive |
|
74 */ |
|
75 void DoCancel(); |
|
76 |
|
77 /** |
|
78 * From CActive |
|
79 */ |
|
80 TInt RunError( TInt aError ); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 CVmDetDlgPropertyObserver( CVmDetailsDialog& aDetDialog ); |
|
88 |
|
89 /** |
|
90 * Symbian 2nd phase constructor.. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 private: // Data |
|
95 |
|
96 // Owns: Observed property |
|
97 RProperty iProperty; |
|
98 |
|
99 // Observer to be informed when property changes |
|
100 CVmDetailsDialog& iDetDialog; |
|
101 |
|
102 // Observed property |
|
103 TUint iKey; |
|
104 }; |
|
105 |
|
106 #endif // VMDETDLGPROPERTYOBSERVER_H |
|
107 |
|
108 // End of File |