|
1 /* |
|
2 * Copyright (c) 2005-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: Header for CIRAddManuallyContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IRADDMANUALLYSTATIONCONTAINER_H |
|
20 #define IRADDMANUALLYSTATIONCONTAINER_H |
|
21 |
|
22 #include <aknlists.h> |
|
23 #include <AknsBasicBackgroundControlContext.h> |
|
24 #include <aknsdrawutils.h> |
|
25 #include <aknscontrolcontext.h> |
|
26 #include <AknsSkinInstance.h> |
|
27 #include <aknsutils.h> |
|
28 #include <aknform.h> |
|
29 #include <eikedwin.h> |
|
30 #include <eikdialg.h> |
|
31 class CIRBaseView; |
|
32 class CIRDialogLauncher; |
|
33 //class CEikEdwin; |
|
34 #include <akntoolbarobserver.h> |
|
35 #include <aknbutton.h> |
|
36 #include <baclipb.h> |
|
37 #include <f32file.h> |
|
38 class CEikEdwin; |
|
39 class CGulIcon; |
|
40 |
|
41 class CIRAddManuallyStationView; |
|
42 |
|
43 class CIRDialogLauncher; |
|
44 class CAknNavigationControlContainer; |
|
45 class CAknNavigationDecorator; |
|
46 |
|
47 class Stateind_uid : public TUid |
|
48 { |
|
49 public: |
|
50 Stateind_uid(int stateind) |
|
51 { |
|
52 iUid = stateind; |
|
53 } |
|
54 }; |
|
55 |
|
56 |
|
57 |
|
58 /** |
|
59 * Container class for Add Manually View. |
|
60 */ |
|
61 class CIRAddManuallyStationContainer : public CAknForm,public MCoeControlObserver |
|
62 { |
|
63 |
|
64 public: // Methods |
|
65 |
|
66 /** |
|
67 * CIRAddManuallyStationContainer::NewL(const TRect& aRect) |
|
68 * Two phased constructor |
|
69 * Creates a CIRAddManuallyStationViewContainer object which |
|
70 * will draw itself to aRect |
|
71 * @param aRect. The rectangle to which this view will be drawn to |
|
72 * @return. A pointer to the created instance of |
|
73 * CIRAddManuallyStationViewContainer. |
|
74 */ |
|
75 static CIRAddManuallyStationContainer* NewL(CIRAddManuallyStationView* aView); //(CAknToolbar* aToolbar) |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 ~CIRAddManuallyStationContainer(); |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 * |
|
85 * @param aView View of this container. |
|
86 */ |
|
87 CIRAddManuallyStationContainer( CIRAddManuallyStationView* aView ); |
|
88 |
|
89 |
|
90 /** |
|
91 * From CCoeControl |
|
92 * |
|
93 * @see CCoeControl::GetHelpContext( TCoeHelpContext& aContext ) const |
|
94 */ |
|
95 IMPORT_C void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
96 |
|
97 |
|
98 |
|
99 public: // New functions |
|
100 /** |
|
101 * To Handle the key events |
|
102 */ |
|
103 void DefaultVauleL(); |
|
104 |
|
105 /** |
|
106 * copies to clipboard |
|
107 */ |
|
108 void CopyDataL(); |
|
109 |
|
110 /** |
|
111 * paste from clipboard |
|
112 */ |
|
113 void PasteDataL(); |
|
114 |
|
115 /** |
|
116 * Saves the URL name nd description of the station to be saved |
|
117 */ |
|
118 void SaveDataL(); |
|
119 |
|
120 /** |
|
121 * Edits the URL name and description of the station |
|
122 */ |
|
123 void EditStationL(); |
|
124 |
|
125 /** |
|
126 * Checks whether Name Field is empty or not. If it contains empty then |
|
127 * replace with the default name ("Unnamed") |
|
128 * |
|
129 * @return NA |
|
130 */ |
|
131 void ReplaceEmptyName( TDes& aUrlName ); |
|
132 |
|
133 |
|
134 /** |
|
135 * Replaces the ugly char symbols with space |
|
136 */ |
|
137 void ReplaceUglyChar(TDes& aUrlName); |
|
138 |
|
139 |
|
140 /** |
|
141 * Checks if there is an URI that contains scheme (="http://") |
|
142 * and at some characters after that. |
|
143 * |
|
144 * @return ETrue if Name text field contains a scheme and at least one character |
|
145 * Otherwise EFalse. |
|
146 */ |
|
147 TBool ValidateUrlL(); |
|
148 |
|
149 /** |
|
150 * Checks if there are any invalid characters in URL |
|
151 * @return ETrue if URL contains invalid characters |
|
152 */ |
|
153 TBool HasInvalidCharsInUrl(TDes& aUrl); |
|
154 |
|
155 public: // Functions from base classes |
|
156 |
|
157 /** |
|
158 * To Handle the key events |
|
159 */ |
|
160 void HandlePointerEventL (const TPointerEvent & aPointerEvent) ; |
|
161 void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType); |
|
162 void HandleResourceChange (TInt aType); |
|
163 |
|
164 /** |
|
165 * From CAknForm, called just before options menu is displayed. |
|
166 * @param aResourceId Resource ID identifying the menu pane to initialize |
|
167 * @param aMenuPane The in-memory representation of the menu pane |
|
168 */ |
|
169 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
170 |
|
171 /** |
|
172 * From CAknForm, takes care of command handling. |
|
173 * @param aCommand Command to be handled |
|
174 */ |
|
175 void ProcessCommandL( TInt aCommand ); |
|
176 void SizeChanged(); |
|
177 |
|
178 protected: |
|
179 |
|
180 /** |
|
181 * From CAknForm, called by the framework if user presses a button |
|
182 * @param aButtonId The ID of the pressed button. |
|
183 * @return Should the dialog exit (EFalse or ETrue) |
|
184 */ |
|
185 TBool OkToExitL( TInt aButtonId ); |
|
186 |
|
187 /** |
|
188 * From CAknForm, called by the framework just before form is shown |
|
189 */ |
|
190 void PostLayoutDynInitL(); |
|
191 |
|
192 private: |
|
193 |
|
194 /** |
|
195 * To save station information to favourites |
|
196 */ |
|
197 void AddToFavouritesL(); |
|
198 |
|
199 |
|
200 void PreLayoutDynInitL(); |
|
201 |
|
202 |
|
203 private: // Data |
|
204 // True if it is edit station. |
|
205 TBool iIsEditStation; |
|
206 TBool iIsSpaceEntered; |
|
207 TBool iIsTextEntered; |
|
208 TBuf<10> iTextBoxValidateUrl; |
|
209 TBool iUnNamedFlag; |
|
210 |
|
211 CAknNavigationControlContainer* iNaviPane; |
|
212 CAknNavigationDecorator* iNaviDecorator; |
|
213 public: |
|
214 CIRDialogLauncher* iDialogLauncher; |
|
215 CIRIsdsPreset* iPreset; |
|
216 |
|
217 TBuf<256> iSelText; |
|
218 TBuf<256> iStationURL; |
|
219 TBuf<256> iStationName; |
|
220 TBuf<256> iStationDescription; |
|
221 TBool iIsEnable; |
|
222 |
|
223 |
|
224 public: |
|
225 |
|
226 |
|
227 TUid iAddManPrevID; |
|
228 CIRAddManuallyStationView* iView; |
|
229 |
|
230 |
|
231 //Previous ViewId |
|
232 TUid iAddManPrevId; |
|
233 |
|
234 |
|
235 }; |
|
236 |
|
237 #endif // IRADDMANUALLYSTATIONCONTAINER_H |