|
1 /* |
|
2 * Copyright (c) 2004 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: LandmarksUi Content File - Utils class for ui classes. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CLMKUIUTILS_H |
|
25 #define CLMKUIUTILS_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <e32base.h> |
|
29 #include <aknnavide.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CEikStatusPane; |
|
33 class CAknTitlePane; |
|
34 class CAknContextPane; |
|
35 class CEikImage; |
|
36 class CPosLandmark; |
|
37 |
|
38 // Added for testing |
|
39 class MLmkEditorUiBuilder; |
|
40 class MLmkFieldData; |
|
41 class CEikonEnv; |
|
42 |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * CLmkUiUtils class |
|
47 * - Store and restore navipane. |
|
48 * - Store and restore titlepane. |
|
49 * - Read resource file. |
|
50 * - etc. |
|
51 */ |
|
52 class CLmkUiUtils : public CBase |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 /** |
|
56 * C++ default constructor. |
|
57 * @return created CLmkCategoryContentsView object |
|
58 */ |
|
59 static CLmkUiUtils* NewL(); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 ~CLmkUiUtils(); |
|
65 |
|
66 private: // Constructors |
|
67 /** |
|
68 * C++ default constructor. |
|
69 * @return newly instantiated object |
|
70 */ |
|
71 CLmkUiUtils(); |
|
72 |
|
73 /** |
|
74 * By default Symbian 2nd phase constructor is private. |
|
75 */ |
|
76 void ConstructL(); |
|
77 |
|
78 public: // New functions |
|
79 /** |
|
80 * Change title pane |
|
81 * @param aTitle, take ownership |
|
82 */ |
|
83 IMPORT_C static void ChangeTitlePaneL( HBufC* aTitle ); |
|
84 |
|
85 /** |
|
86 * Change title pane. If KZeroResourceId is given then |
|
87 * title pane is not changed. |
|
88 * @param aResourceText resource containing title text |
|
89 */ |
|
90 IMPORT_C static void ChangeTitlePaneL( TInt aResourceText ); |
|
91 |
|
92 /** |
|
93 * Find file from a correct drive, i.e. from drive where dll |
|
94 * being executed is located. |
|
95 * @param aFileName, file name which is updated to contain drive |
|
96 */ |
|
97 IMPORT_C static void GetFileWithCorrectDriveL( TFileName& aFileName ); |
|
98 |
|
99 |
|
100 |
|
101 // Added for testing |
|
102 /** |
|
103 * Change the icon in Landmark's name label field on a need basis |
|
104 * |
|
105 */ |
|
106 |
|
107 IMPORT_C static void ChangeLmNameLabelIconL ( MLmkEditorUiBuilder& aUiBuilder, |
|
108 MLmkFieldData& nameField); |
|
109 |
|
110 |
|
111 /** |
|
112 * Method for getting Avkon icon file name with correct |
|
113 * path information. |
|
114 * @return file name |
|
115 */ |
|
116 static TFileName* AvkonIconFileLC(); |
|
117 |
|
118 /** |
|
119 * Method for getting LmkUi icon file name with correct |
|
120 * path information. |
|
121 * @return file name |
|
122 */ |
|
123 static TFileName* LmkUiIconFileLC(); |
|
124 |
|
125 /** |
|
126 * Store current title pane. |
|
127 */ |
|
128 void StoreTitlePaneL(); |
|
129 |
|
130 /** |
|
131 * Restore old title pane. |
|
132 * |
|
133 */ |
|
134 void RestoreOldTitlePane(); |
|
135 |
|
136 /** |
|
137 * Read LmkUi resource file. |
|
138 */ |
|
139 void ReadLmkUiResourceFileL(); |
|
140 |
|
141 /** |
|
142 * Store current navi pane. |
|
143 */ |
|
144 void StoreNaviPaneL(); |
|
145 |
|
146 /** |
|
147 * Create empty/default navipane. |
|
148 */ |
|
149 void CreateDefaultNaviPaneL(); |
|
150 |
|
151 /** |
|
152 * Create navi label. |
|
153 * @param aLabel |
|
154 */ |
|
155 void CreateNaviLabelL( const TDesC& aLabel ); |
|
156 |
|
157 /** |
|
158 * Restore old navi pane. |
|
159 */ |
|
160 void RestoreOldNaviPaneL(); |
|
161 |
|
162 /** |
|
163 * Swap new context icon and save old icon. |
|
164 * @param aNewImage |
|
165 */ |
|
166 void SwapNewContextIconL( CEikImage* aNewImage ); |
|
167 |
|
168 /** |
|
169 * Set old context icon. |
|
170 */ |
|
171 void SetOldContextIcon(); |
|
172 |
|
173 /** |
|
174 * Update new context image. |
|
175 * @param aNewImage |
|
176 */ |
|
177 void UpdateContextIconL( CEikImage* aNewImage ); |
|
178 |
|
179 /** |
|
180 * Finds if web url field is empty. Ignored http:// |
|
181 * @param aUrl web url. |
|
182 */ |
|
183 static TBool FindIfWebAddrFieldIsEmpty (const TDes& aUrl); |
|
184 |
|
185 private: // New functions |
|
186 /** |
|
187 * Return status pane. |
|
188 * @return status pane, ownership is not transferred |
|
189 */ |
|
190 static CEikStatusPane* StatusPane(); |
|
191 |
|
192 /** |
|
193 * Set context pane. |
|
194 * @param aContextPane |
|
195 */ |
|
196 void SetContextPaneL(); |
|
197 |
|
198 private: // Data |
|
199 ///Ref: |
|
200 CAknContextPane* iContextPane; |
|
201 |
|
202 ///Own: |
|
203 CEikImage* iOldImage; |
|
204 |
|
205 /// TInt variable |
|
206 TInt iResourceOffset; |
|
207 |
|
208 /// Own: Title pane text to restore on exit |
|
209 HBufC* iStoredTitlePaneText; |
|
210 |
|
211 ///Ref: |
|
212 CAknTitlePane* iTitlePane; |
|
213 |
|
214 ///Own: |
|
215 CAknNavigationDecorator* iStoredDecorator; |
|
216 |
|
217 //Own: |
|
218 CAknNavigationDecorator* iNaviLabel; |
|
219 |
|
220 //Ref: |
|
221 CAknNavigationControlContainer* iNaviPane; |
|
222 |
|
223 }; |
|
224 |
|
225 #endif // CLMKUIUTILS_H |
|
226 |
|
227 // End of File |