1 /* |
|
2 * Copyright (c) 2006 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: Manages the E-Comm Plugin handling for the Settings UI. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_LOCSETTINGSUIPLUGINLOADER_H_ |
|
19 #define C_LOCSETTINGSUIPLUGINLOADER_H_ |
|
20 |
|
21 // System Include |
|
22 #include <e32base.h> |
|
23 #include <ecom/ecom.h> |
|
24 |
|
25 // Forward Declarations |
|
26 class CLocationSettings; |
|
27 class CAknViewAppUi; |
|
28 class MLocSettingsUiEcomNotifer; |
|
29 |
|
30 // Class Declarations |
|
31 |
|
32 /** |
|
33 * Plugin loader class. |
|
34 * Loads all the Settings related ECom plugins and also registers itself for |
|
35 * notfication from the ECOM server. It takes up complete onus of the creation |
|
36 * of the CSettingsUi objects. |
|
37 * |
|
38 * @lib locsysuiview.lib |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CLocSettingsUiPluginLoader ) : public CActive |
|
42 { |
|
43 private: |
|
44 /** |
|
45 * Overloaded Constructor |
|
46 * |
|
47 * @param aAppUi App UI Reference |
|
48 */ |
|
49 CLocSettingsUiPluginLoader( CAknViewAppUi& aAppUi ); |
|
50 public: |
|
51 /** |
|
52 * Creates an instance of the Settings UI Plug-in Loader. |
|
53 * |
|
54 * @param aObserver Observer to the CLocSettingsUiPluginLoader |
|
55 * class |
|
56 * @param aAppUi App Ui Reference |
|
57 * @return CLocSettingsUiPluginLoader* Reference to the instantiated class |
|
58 */ |
|
59 static CLocSettingsUiPluginLoader* NewL( CAknViewAppUi& aAppUi ); |
|
60 |
|
61 /** |
|
62 * Creates an instance of the Settings UI Plug-in Loader. |
|
63 * |
|
64 * @param aObserver Observer to the CLocSettingsUiPluginLoader |
|
65 * class |
|
66 * @param aAppUi App Ui Reference |
|
67 * @return CLocSettingsUiPluginLoader* Reference to the instantiated class |
|
68 */ |
|
69 static CLocSettingsUiPluginLoader* NewLC( CAknViewAppUi& aAppUi ); |
|
70 |
|
71 /** |
|
72 * Destructor |
|
73 */ |
|
74 virtual ~CLocSettingsUiPluginLoader(); |
|
75 |
|
76 /** |
|
77 * Creates all the settings UI currently available in the system. The |
|
78 * user if this interface should ensure that he passes an empty |
|
79 * Settings Array structure. |
|
80 * |
|
81 * @param aDescArray Array of Settings UI. |
|
82 */ |
|
83 void CreateAvailableSettingsUisL( |
|
84 RPointerArray<CLocationSettings>& aSettingsArray ); |
|
85 |
|
86 /** |
|
87 * Creates the Settings UI and the corresponding description entry. This |
|
88 * function creates a new Setting UI ECOM plug-in and a Location Settings |
|
89 * object. the created object is appended to the existing list and a reference to |
|
90 * it returned. The ownership of the created Settings object is retained with |
|
91 * the Settings array. This function assumes that the object doesnt already exists |
|
92 * |
|
93 * @param aImplementationUid The Implementation UID of the plug-in that |
|
94 * has to be created |
|
95 * @param aSettingsArray Array of Settings UIs |
|
96 * @return CLocationSettings& Reference to the created object. The ownership is not |
|
97 * by the return value. |
|
98 */ |
|
99 CLocationSettings& CreateSettingsUiL( |
|
100 TUid aImplementationUid, |
|
101 RPointerArray<CLocationSettings>& aSettingsArray ); |
|
102 /** |
|
103 * Updates the Settings UI list and the description structures. The new |
|
104 * additions are appened in-order. The interface does not |
|
105 * delete any instances if they are not in the current implementation |
|
106 * list |
|
107 * |
|
108 * @param aSettingsArray Array of Settings UIs. |
|
109 */ |
|
110 void UpdateAvailableSettingsUisL( |
|
111 RPointerArray<CLocationSettings>& aSettingsArray ); |
|
112 |
|
113 /** |
|
114 * Initiates a notify request on the ECom Session |
|
115 * |
|
116 * @param aSettingsNotifer Notifier for communication of changes in the |
|
117 * Ecom loading and unloading for sub-settings |
|
118 * plug-ins. The default value is used if the |
|
119 * caller of this API intends to obtain a |
|
120 * notification on the previously set observer. |
|
121 */ |
|
122 void StartEComNotifyL( MLocSettingsUiEcomNotifer* aNotifier = NULL ); |
|
123 |
|
124 /** |
|
125 * Stop the outstanding EComNotification |
|
126 */ |
|
127 void StopEComNotify(); |
|
128 |
|
129 protected: |
|
130 /** |
|
131 * Inherited from CActive |
|
132 */ |
|
133 void RunL(); |
|
134 |
|
135 /** |
|
136 * Inherited from CActive |
|
137 */ |
|
138 void DoCancel(); |
|
139 |
|
140 /** |
|
141 * Inherited from CActive |
|
142 */ |
|
143 TInt RunError( TInt aError ); |
|
144 |
|
145 private: |
|
146 /** |
|
147 * Reference to the Application Ui to which all the Settings UI would |
|
148 * belong to |
|
149 */ |
|
150 CAknViewAppUi& iAppUi; |
|
151 |
|
152 /** |
|
153 * Handle to the ECom Session |
|
154 */ |
|
155 REComSession* iSession; |
|
156 |
|
157 /** |
|
158 * ECom notifier |
|
159 */ |
|
160 MLocSettingsUiEcomNotifer* iNotifier; |
|
161 |
|
162 }; |
|
163 |
|
164 #endif // C_LOCSETTINGSUIPLUGINLOADER_H_ |
|
165 |
|