1 /* |
|
2 * Copyright (c) 2005 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: PhoneUI Publish and Subscriber (Publish & Subscribe). |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPHONEPUBLISHSUBSCRIBERAO_H |
|
20 #define __CPHONEPUBLISHSUBSCRIBERAO_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 #include "mphonepubsubobserver.h" |
|
26 |
|
27 // CLASS DECLARATION |
|
28 /** |
|
29 * This class observes property variable changes. |
|
30 * |
|
31 * @lib Services.dll |
|
32 */ |
|
33 |
|
34 class CPhonePublishSubscriberAO : public CActive |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CPhonePublishSubscriberAO* NewL( |
|
42 MPhonePubSubObserver* aPubSubObserver, |
|
43 const TUid& aCategory, |
|
44 const TUint aKey ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CPhonePublishSubscriberAO(); |
|
50 |
|
51 /** |
|
52 * Subscribe to an RProperty |
|
53 * @param none |
|
54 * @return none |
|
55 */ |
|
56 void Subscribe(); |
|
57 |
|
58 public: // from CActive |
|
59 |
|
60 /** |
|
61 * @param none |
|
62 * @return none |
|
63 */ |
|
64 void RunL(); |
|
65 |
|
66 /** |
|
67 * @param aError the error returned |
|
68 * @return error |
|
69 */ |
|
70 TInt RunError( TInt aError ); |
|
71 |
|
72 /** |
|
73 * @param none |
|
74 * @return none |
|
75 */ |
|
76 void DoCancel(); |
|
77 |
|
78 public: // new methods |
|
79 |
|
80 /** |
|
81 * Return property category that is subscribed to |
|
82 * @param None |
|
83 */ |
|
84 const TUid Category() const; |
|
85 |
|
86 /** |
|
87 * Return property key that is subscribed to |
|
88 * @param None |
|
89 */ |
|
90 TUint Key() const; |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * C++ constructor. |
|
96 */ |
|
97 CPhonePublishSubscriberAO( |
|
98 MPhonePubSubObserver* aPubSubObserver, |
|
99 const TUid& aCategory, |
|
100 const TUint aKey ); |
|
101 |
|
102 private: |
|
103 |
|
104 MPhonePubSubObserver* iPubSubObserver; // NOT OWN |
|
105 RProperty iProperty; |
|
106 TUid iCategory; |
|
107 TUint iKey; |
|
108 }; |
|
109 |
|
110 #endif // __CPHONEPUBLISHSUBSCRIBERAO_H |
|
111 |
|
112 // End of File |
|