|
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: |
|
15 * Handles landmark settings events. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPOSLMSERVERSETTINGSHANDLER_H |
|
21 #define CPOSLMSERVERSETTINGSHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CPosLmServer; |
|
28 class CPosLmSettingsHandler; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Handles landmark settings events. |
|
34 */ |
|
35 class CPosLmServerSettingsHandler : public CActive |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phase constructor |
|
41 * @param aServer The server creating this session. |
|
42 */ |
|
43 static CPosLmServerSettingsHandler* NewL( |
|
44 /* IN */ CPosLmServer& aServer |
|
45 ); |
|
46 |
|
47 /** |
|
48 * C++ Destructor |
|
49 */ |
|
50 ~CPosLmServerSettingsHandler(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * Starts listening for landmark settings events. |
|
56 */ |
|
57 TInt StartListening(); |
|
58 |
|
59 protected: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From CActive. |
|
63 * Active Object event handler. |
|
64 * Restarts the listening for landmark settings events. Then it |
|
65 * notifies listening clients that landmark settings have changed. |
|
66 */ |
|
67 void RunL(); |
|
68 |
|
69 /** |
|
70 * From CActive. |
|
71 * Active Object cancel handler. |
|
72 */ |
|
73 void DoCancel(); |
|
74 |
|
75 /** |
|
76 * From CActive. |
|
77 * If RunL leaves, all listening clients are notified. Only the call to |
|
78 * User::LeaveIfError(StartListening()) can leave. |
|
79 * HandleLandmarkSettingsChangedL does not leave. StartListening returns |
|
80 * an error code if the settings handler in Internal Services could not |
|
81 * be started. |
|
82 * |
|
83 * @return An error code. |
|
84 */ |
|
85 TInt RunError(TInt aError); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * C++ Constructor |
|
91 */ |
|
92 CPosLmServerSettingsHandler( |
|
93 /* IN */ CPosLmServer& aServer |
|
94 ); |
|
95 |
|
96 /** |
|
97 * By default Symbian 2nd phase constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 void HandleLandmarkSettingsChangedL( |
|
102 /* IN */ const TDesC& aUri |
|
103 ); |
|
104 |
|
105 // By default, prohibit copy constructor |
|
106 CPosLmServerSettingsHandler( |
|
107 const CPosLmServerSettingsHandler& ); |
|
108 // Prohibit assigment operator |
|
109 CPosLmServerSettingsHandler& operator= ( |
|
110 const CPosLmServerSettingsHandler& ); |
|
111 |
|
112 private: // Data |
|
113 |
|
114 CPosLmSettingsHandler* iSettingsHandler; |
|
115 CPosLmServer* iLmServer; |
|
116 |
|
117 }; |
|
118 |
|
119 #endif // CPOSLMSERVERSETTINGSHANDLER_H |
|
120 |
|
121 // End of File |