|
1 /* |
|
2 * Copyright (c) 2002, 2003 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: Property Observer class for handling property change events. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "PropertyObserver.h" |
|
22 |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CPropertyObserver::RunL |
|
28 // ?implementation_description |
|
29 // (other items were commented in a header). |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 inline void CPropertyObserver::RunL(void) |
|
33 { |
|
34 if( iStatus.Int() == KErrNone ) |
|
35 { |
|
36 Subscribe(); |
|
37 NotifyCurrentValue(); |
|
38 } |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CPropertyObserver::DoCancel |
|
43 // ?implementation_description |
|
44 // (other items were commented in a header). |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 inline void CPropertyObserver::DoCancel(void) |
|
48 { |
|
49 iProperty.Cancel(); |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CPropertyObserver::Subscribe |
|
54 // ?implementation_description |
|
55 // (other items were commented in a header). |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 inline void CPropertyObserver::Subscribe(void) |
|
59 { |
|
60 iProperty.Subscribe( iStatus ); |
|
61 SetActive(); |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CPropertyObserver::NotifyCurrentValue |
|
66 // ?implementation_description |
|
67 // (other items were commented in a header). |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 inline void CPropertyObserver::NotifyCurrentValue(void) |
|
71 { |
|
72 TInt value(0); |
|
73 |
|
74 if( iSkipValue || iProperty.Get( iCategory, iKey, value ) == KErrNone ) |
|
75 { |
|
76 iHandler.HandlePropertyChange( iCategory, iKey, value ); |
|
77 } |
|
78 } |
|
79 |
|
80 |
|
81 // End of File |