|
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: Declares Registry watcher class for BTUI. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CBTUIREGISTRYWATCHERAO_H |
|
20 #define CBTUIREGISTRYWATCHERAO_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <bt_subscribe.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * A callback interface for informing content change of BT Registry. |
|
30 */ |
|
31 class MBTUIRegistryObserver |
|
32 { |
|
33 public: // New functions |
|
34 |
|
35 /** |
|
36 * Informs the observer that contents of Registry has been changed. |
|
37 * @param None. |
|
38 * @return None. |
|
39 */ |
|
40 virtual void RegistryContentChangedL()=0; |
|
41 }; |
|
42 |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * An active object based class which can used to listen |
|
48 * Registry changes |
|
49 */ |
|
50 class CBTUIRegistryWatcherAO : public CActive |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * C++ default constructor. |
|
56 */ |
|
57 CBTUIRegistryWatcherAO( MBTUIRegistryObserver* aParent ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CBTUIRegistryWatcherAO(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * Starts / continues Registry watching |
|
68 * |
|
69 * @param None. |
|
70 * @return None. |
|
71 */ |
|
72 void WatchL(); |
|
73 |
|
74 /** |
|
75 * Starts / continues Registry watching |
|
76 * |
|
77 * @param None. |
|
78 * @return None. |
|
79 */ |
|
80 void StopWatching(); |
|
81 |
|
82 private: // Functions from base classes |
|
83 |
|
84 /** |
|
85 * From CActive Gets called when CActive::Cancel is called, |
|
86 * cancels Registry watching. |
|
87 * |
|
88 * @param None. |
|
89 * @return None. |
|
90 */ |
|
91 void DoCancel(); |
|
92 |
|
93 /** |
|
94 * From CActive Gets called when content of Registry is changed, |
|
95 * calls MBTUIRegistryObserver::RegistryContentChangedL. |
|
96 * |
|
97 * @param None. |
|
98 * @return None. |
|
99 */ |
|
100 void RunL(); |
|
101 |
|
102 /** |
|
103 * From CActive Handles a leave occurring in the request completion event. |
|
104 * |
|
105 * @param aError The leave code. |
|
106 * @return Symbian OS error code. |
|
107 */ |
|
108 TInt RunError(TInt aError); |
|
109 |
|
110 private: // Data |
|
111 |
|
112 // Reference to observer |
|
113 MBTUIRegistryObserver* iParent; |
|
114 // Database handle |
|
115 RProperty iProperty; |
|
116 }; |
|
117 |
|
118 #endif |
|
119 |
|
120 // End of File |