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: Location Triggering Management Plugin view |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CLBTMGMTPLUGINVIEW_H_ |
|
19 #define CLBTMGMTPLUGINVIEW_H_ |
|
20 |
|
21 // System Includes |
|
22 #include <data_caging_path_literals.hrh> |
|
23 #include <e32base.h> |
|
24 #include <aknview.h> |
|
25 #include <aknViewAppUi.h> |
|
26 #include <ConeResLoader.h> |
|
27 |
|
28 // User Includes |
|
29 #include "lbtmgmtpluginuid.hrh" |
|
30 #include "lbtmgmtplugincmdhdlr.h" |
|
31 #include "lbtmgmtengobserver.h" |
|
32 |
|
33 // Forward Declarations |
|
34 class CLbtMgmtPluginContainer; |
|
35 class MLbtMgmtEngObserver; |
|
36 class MLocSettingsUiObserver; |
|
37 class CLbtMgmtPluginEngine; |
|
38 |
|
39 // Constant Declarations |
|
40 const TUid KLbtMgmtViewPluginUid = { KLbtMgmtPluginUID3 }; |
|
41 _LIT( KLbtMgmtViewResFileName, "lbtmgmtpluginview.rsc" ); |
|
42 |
|
43 // Class Definition |
|
44 |
|
45 /** |
|
46 * Location Triggering Management Plugin view class. |
|
47 */ |
|
48 class CLbtMgmtPluginView : public CAknView, |
|
49 public MLbtMgmtPluginCmdHdlr, |
|
50 public MLbtMgmtEngObserver |
|
51 { |
|
52 public: |
|
53 /** |
|
54 * Creates new Location Triggering Management plug-in view. |
|
55 * |
|
56 * @param aSettingsObsrv Observer to the Settings UI |
|
57 * @return CLbtMgmtPluginView& Reference to the application view |
|
58 */ |
|
59 static CLbtMgmtPluginView* NewL( MLocSettingsUiObserver& aSettingsObsrv ); |
|
60 |
|
61 /** |
|
62 * Creates new Location Triggering Management plug-in view. |
|
63 * Leaves the object on the Clean up stack |
|
64 * |
|
65 * @param aSettingsObsrv Observer to the Settings UI |
|
66 * @return CLbtMgmtPluginView& Reference to the application view |
|
67 */ |
|
68 static CLbtMgmtPluginView* NewLC( MLocSettingsUiObserver& aSettingsObsrv ); |
|
69 |
|
70 /** |
|
71 * Destructor |
|
72 */ |
|
73 ~CLbtMgmtPluginView (); |
|
74 |
|
75 /** |
|
76 * Close the Triggering Management Settings |
|
77 */ |
|
78 void CloseSettings(); |
|
79 |
|
80 /** |
|
81 * From CAknView. |
|
82 */ |
|
83 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
84 TUid aCustomMessageId, |
|
85 const TDesC8& aCustomMessage ); |
|
86 |
|
87 /** |
|
88 * From CAknView. |
|
89 */ |
|
90 void DoDeactivate(); |
|
91 |
|
92 /** |
|
93 * From CAknView. Returns the View Id. Should be chosen to reflect |
|
94 * the Implementation UID of the Plugin |
|
95 */ |
|
96 TUid Id() const; |
|
97 |
|
98 /** |
|
99 * From CAknView. |
|
100 */ |
|
101 void HandleCommandL(TInt aCommand); |
|
102 |
|
103 |
|
104 /** |
|
105 * For CBA Change |
|
106 */ |
|
107 void SetCba( TInt aResourceId ); |
|
108 /* |
|
109 * returns CLbtMgmtPluginEngine |
|
110 */ |
|
111 CLbtMgmtPluginEngine* GetLbtMgmtPluginEngine(); |
|
112 |
|
113 public: |
|
114 /** |
|
115 * Inherited from MLbtMgmtPluginCmdHdlr |
|
116 * Handles commands from the container |
|
117 * |
|
118 * @param aCommand Command ID |
|
119 */ |
|
120 void HandleCmdL( TLbtMgmtPluginCmd aCommand ); |
|
121 |
|
122 public: |
|
123 /** |
|
124 * Inherited from MLbtMgmtEngObserver |
|
125 */ |
|
126 void HandleSettingsChangeEventL(); |
|
127 |
|
128 private: |
|
129 /** |
|
130 * Constructor |
|
131 */ |
|
132 CLbtMgmtPluginView( MLocSettingsUiObserver& aSettingsObsrv ); |
|
133 |
|
134 /** |
|
135 * Second Phase Constructor |
|
136 */ |
|
137 void ConstructL(); |
|
138 |
|
139 /** |
|
140 * Shows or dims help option, depending wheather help feature |
|
141 * is supported or not. |
|
142 * @param aMenuPane |
|
143 */ |
|
144 void HandleHelpFeature( CEikMenuPane& aMenuPane ) const; |
|
145 |
|
146 /** |
|
147 * Handle Settings Change Event |
|
148 * |
|
149 * @param aCmd Settings change command |
|
150 */ |
|
151 void SettingsChangeL( TInt aCmd ); |
|
152 |
|
153 /** |
|
154 * Opens the nearest localized resourcefile using aResourceLoader. |
|
155 * aResourceLoader should be opened only once before closing it. |
|
156 * Otherwise it will raise a panic. Therefore it is better to have |
|
157 * multiple resource loaders. |
|
158 * |
|
159 * @param aResourceFileName Drive and name of resource file in format |
|
160 * <path>:<rsc_file_name> |
|
161 * @param aResourceLoader Resource loader for the resource. The loader |
|
162 * must not be opened allready or it will raise |
|
163 * a panic. It is caller's responsibility to |
|
164 * close the resource loader after using the |
|
165 * resource. |
|
166 */ |
|
167 void OpenLocalizedResourceFileL( const TDesC& aResourceFileName, |
|
168 RConeResourceLoader& aResourceLoader ); |
|
169 |
|
170 private: |
|
171 /** |
|
172 * Reference to the Settings UI Observer. Used to notify the dismissal of the |
|
173 * plug-in |
|
174 */ |
|
175 MLocSettingsUiObserver& iSettingsObserver; |
|
176 |
|
177 /** |
|
178 * Resource loader handle |
|
179 * Owns |
|
180 */ |
|
181 RConeResourceLoader iResourceLoader; |
|
182 |
|
183 /** |
|
184 * Location Trigger Management Container |
|
185 * Owns |
|
186 */ |
|
187 CLbtMgmtPluginContainer* iContainer; |
|
188 |
|
189 /** |
|
190 * Location Trigger Management engine |
|
191 * Owns |
|
192 */ |
|
193 CLbtMgmtPluginEngine* iEngine; |
|
194 |
|
195 }; |
|
196 |
|
197 #endif // CLBTMGMTPLUGINVIEW_H_ |
|
198 |
|