|
1 /* |
|
2 * Copyright (c) 2006-2009 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: Location Settings implementation of Location UIs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_LOCATIONSETTINGS_H_ |
|
20 #define C_LOCATIONSETTINGS_H_ |
|
21 |
|
22 // System Include |
|
23 #include <e32base.h> |
|
24 |
|
25 // User Includes |
|
26 #include "locationui.h" |
|
27 #include "locsettingsuiobserver.h" |
|
28 |
|
29 // Forward Declarations |
|
30 class CLocSettingsUi; |
|
31 class CAknViewAppUi; |
|
32 |
|
33 // Class Definition |
|
34 /** |
|
35 * Location Settings implementation of Location UIs. This class extends the |
|
36 * Location UI interface for Location sub-settings plug-ins. This class acts as |
|
37 * the container class for the Location sub-settings plug-ins and takes up |
|
38 * complete ownership of these classes. |
|
39 * |
|
40 * @lib locsysuiview.lib |
|
41 * @since S60 v3.2 |
|
42 */ |
|
43 class CLocationSettings : public CBase, |
|
44 public MLocationUI, |
|
45 public MLocSettingsUiObserver |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Two Phase Constructor. |
|
50 * |
|
51 * @param aImplementationId Implementation UID of the settings plug-in. |
|
52 * @param aAppUi Application's AppUi reference. |
|
53 * @return CLocationSettings* Pointer to the created object |
|
54 */ |
|
55 static CLocationSettings* NewL( const TUid aImplementationId, |
|
56 CAknViewAppUi& aAppUi ); |
|
57 |
|
58 /** |
|
59 * Two Phase Constructor. The funcion leaves the CLocationSettings object |
|
60 * on the CleanupStack |
|
61 * |
|
62 * @param aImplementationId Implementation UID of the settings plug-in. |
|
63 * @param aAppUi Application's AppUi reference. |
|
64 * @return CLocationSettings* Pointer to the created object |
|
65 */ |
|
66 static CLocationSettings* NewLC( const TUid aImplementationId, |
|
67 CAknViewAppUi& aAppUi ); |
|
68 |
|
69 /** |
|
70 * C++ Destructor |
|
71 */ |
|
72 virtual ~CLocationSettings(); |
|
73 |
|
74 /** |
|
75 * Accessor Function for the Setings Ui Caption. The function does not |
|
76 * allocate any buffer but returns its internal buffer. This buffer |
|
77 * should not be deleted/modified by the callee. |
|
78 * |
|
79 * @return const TPtrC Caption String |
|
80 */ |
|
81 TPtrC Caption(); |
|
82 |
|
83 /** |
|
84 * Returns the priority of the UI module. |
|
85 * |
|
86 * @return TInt Priority of the Settings UI |
|
87 */ |
|
88 TInt Priority(); |
|
89 |
|
90 /** |
|
91 * Accessor Function for the Settings Ui Implementation UID |
|
92 * |
|
93 * @return TUid Settings UI Plug In's implementation UID |
|
94 */ |
|
95 const TUid ImplementationUid(); |
|
96 |
|
97 public: // Inherited from MLocationUI |
|
98 |
|
99 /** |
|
100 * Launches a Location UI component. |
|
101 * |
|
102 * @param aUiInputParams Flags that define specific configuration of the |
|
103 * Location UI, that the user of the API wants to |
|
104 * launch. If more than one functionality is |
|
105 * requested then the various combinations are to be |
|
106 * ORed. The interpretation of these flag values is |
|
107 * a part of the understanding between the API user |
|
108 * and the corresponding Location UI. |
|
109 * @param aObserver Observer where the termination of the Launch call |
|
110 * needs to be notified. |
|
111 * |
|
112 */ |
|
113 virtual void LaunchLocationUIL( TInt aUiInputParams, |
|
114 MLocationUIObserver* aObserver ); |
|
115 |
|
116 /** |
|
117 * Launches a Location UI component. |
|
118 * |
|
119 * @param aUiInputParams String passed as a parameter to the |
|
120 * Location UI, that the user of the API wants to |
|
121 * launch. The interpretation of this string is |
|
122 * a part of the understanding between the API user |
|
123 * and the corresponding Location UI. |
|
124 * @param aObserver Observer where the termination of the Launch call |
|
125 * needs to be notified. |
|
126 * |
|
127 */ |
|
128 virtual void LaunchLocationUIL( const TDesC& aUiInputParams, |
|
129 MLocationUIObserver* aObserver ); |
|
130 |
|
131 /** |
|
132 * Closes the running Location UI prematurely. |
|
133 */ |
|
134 virtual void Close(); |
|
135 |
|
136 public:// Inherited from MLocSettingsUiObserver |
|
137 /** |
|
138 * Inherited from MLocSettingsUiObserver. Notification from the Settings UI |
|
139 * to indicate the termination of the Settings UI application |
|
140 * |
|
141 * @param aErrorCode The termination reason. KErrNone for normal |
|
142 * terminations. In case of error or pre-mature aborting |
|
143 * System wide Error codes. |
|
144 */ |
|
145 void SettingClosed( TInt aErrorCode ); |
|
146 |
|
147 private: |
|
148 /** |
|
149 * C++ Constructor |
|
150 * |
|
151 * @param aLocationSettings Pointer to the Location sub-settings UI |
|
152 * plug-in. The ownership of the plug-in is |
|
153 * transferred to the constructed class. |
|
154 */ |
|
155 CLocationSettings( const TUid aImplementationId ); |
|
156 |
|
157 /** |
|
158 * Second Phase of the two phase constructor |
|
159 * |
|
160 */ |
|
161 void ConstructL( CAknViewAppUi& aAppUi ); |
|
162 |
|
163 private: |
|
164 /** |
|
165 * Buffer holding the localized caption string that is used to descibe |
|
166 * the Settings UI |
|
167 * Owns |
|
168 */ |
|
169 HBufC* iCaption; |
|
170 |
|
171 /** |
|
172 * Pointer to the Location Sub-settings UI object |
|
173 * Owns |
|
174 */ |
|
175 CLocSettingsUi* iLocationSettings; |
|
176 |
|
177 /** |
|
178 * Implementation UID of the Location sub-settings UI object |
|
179 */ |
|
180 const TUid iImplementationId; |
|
181 |
|
182 /** |
|
183 * Location UI Observer |
|
184 * Reference |
|
185 */ |
|
186 MLocationUIObserver* iObserver; |
|
187 |
|
188 }; |
|
189 |
|
190 #endif // C_LOCATIONSETTINGS_H_ |
|
191 |