1 /* |
|
2 * Copyright (c) 2008 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: search fields array declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVIMPSTUISEARCHFIELDARAY_H |
|
20 #define CVIMPSTUISEARCHFIELDARAY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "mvimpstuisearchfield.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MVIMPSTSearchUiBuilder; |
|
29 class CEikCaptionedControl; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * An array of search editor fields. |
|
34 * @lib vimpstui.lib |
|
35 * @since S60 v5.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS(CVIMPSTUiSearchFieldArray) : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Creates a new instance of this class. |
|
43 * @return A new instance of this class. |
|
44 */ |
|
45 static CVIMPSTUiSearchFieldArray* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CVIMPSTUiSearchFieldArray(); |
|
51 |
|
52 public: // Interface |
|
53 |
|
54 /** |
|
55 * Creates editor fields |
|
56 * append the field into array from last |
|
57 * @param aLebal, label of field |
|
58 * @param aFieldDataType, field data type |
|
59 * @param aFieldType, field type basic or advanced |
|
60 * @param aSearchKey, search key |
|
61 */ |
|
62 TInt CreateFieldsL(const TDesC& aLebal, TVIMPSTSearchDataFieldType aFieldDataType , |
|
63 TIMPSTSearchFieldTypes aFieldType = EIMAdvancedSearch, |
|
64 TVIMPSTEnums::TVIMPSTSearchKey aSearchKey = TVIMPSTEnums::EVIMPSTSearchKeyUknown ); |
|
65 |
|
66 /** |
|
67 * Creates editor fields |
|
68 * insert into array at given index |
|
69 * @param aIndex, index where field to inserted |
|
70 * @param aLebal, label of field |
|
71 * @param aFieldDataType, field data type |
|
72 * @param aFieldType, field type basic or advanced |
|
73 * @param aSearchKey, search key |
|
74 */ |
|
75 TInt InsertFieldsL(TInt aIndex, const TDesC& aLebal, |
|
76 TVIMPSTSearchDataFieldType aFieldDataType , |
|
77 TIMPSTSearchFieldTypes aFieldType = EIMAdvancedSearch, |
|
78 TVIMPSTEnums::TVIMPSTSearchKey aSearchKey = TVIMPSTEnums::EVIMPSTSearchKeyUknown ) ; |
|
79 |
|
80 /** |
|
81 * Creates editor fields from the array |
|
82 * @param aUiBuilder, reference to builder class |
|
83 */ |
|
84 void CreateUiFieldsFromArrayL(MVIMPSTSearchUiBuilder& aUiBuilder ); |
|
85 |
|
86 |
|
87 public: // new implementations |
|
88 |
|
89 |
|
90 /** |
|
91 * count no of fields in array |
|
92 * @return no of fields in array |
|
93 */ |
|
94 inline TInt Count() const; |
|
95 |
|
96 |
|
97 /** |
|
98 * find and return the field store at given index |
|
99 * @param aIndex ,index of field |
|
100 * @return Base class reference of field |
|
101 */ |
|
102 inline MVIMPSTUiSearchField& At( TInt aIndex ); |
|
103 |
|
104 |
|
105 /** |
|
106 * AreAllUiFieldsEmpty check the all field are empty |
|
107 * @return ETrue if empty else EFalse |
|
108 */ |
|
109 TBool AreAllUiFieldsEmpty() const; |
|
110 |
|
111 /** |
|
112 * AreAllControlsEmptyL check the all control text are empty |
|
113 * @return ETrue if empty else EFalse |
|
114 */ |
|
115 TBool AreAllUiControlsEmptyL() const; |
|
116 |
|
117 /** |
|
118 * set the focus to selected field |
|
119 * @param aFieldIndex, index of field |
|
120 */ |
|
121 void SetFocusL(TInt aFieldIndex ); |
|
122 |
|
123 /** |
|
124 * get the first field data which is entered by user |
|
125 * @return text of field |
|
126 */ |
|
127 TPtrC GetFirstEnteredFieldDataL(); |
|
128 |
|
129 /** |
|
130 * GetSearchKeyDataL fill the data into array for lower layer to use |
|
131 */ |
|
132 void GetSearchKeyDataL(RArray<TVIMPSTSearchKeyData>& aKeyDataArray ); |
|
133 |
|
134 /** |
|
135 * reset field data text |
|
136 */ |
|
137 void ResetFieldData(); |
|
138 |
|
139 /** |
|
140 * RemoveField remove field from array |
|
141 * @param aIndex, index to use |
|
142 */ |
|
143 void RemoveField(TInt aIndex ); |
|
144 |
|
145 /** |
|
146 * insert a field at given location into array |
|
147 * @param aField, field to insert |
|
148 * @param aIndex, index to use |
|
149 */ |
|
150 void InsertField(MVIMPSTUiSearchField* aField , TInt aIndex ); |
|
151 |
|
152 |
|
153 /** |
|
154 * @return selected search type |
|
155 */ |
|
156 TIMPSTSearchFieldTypes GetSearchType(); |
|
157 |
|
158 /** |
|
159 * insert a field at given location into array |
|
160 * @param aType, selected search type |
|
161 */ |
|
162 void SetSearchType(TIMPSTSearchFieldTypes aType); |
|
163 |
|
164 |
|
165 private: // new Implementation |
|
166 |
|
167 /** |
|
168 * CVIMPSTUiSearchFieldArray default constructor |
|
169 */ |
|
170 CVIMPSTUiSearchFieldArray(); |
|
171 |
|
172 /** |
|
173 * ConstructL |
|
174 */ |
|
175 void ConstructL(); |
|
176 |
|
177 /** |
|
178 * create the field control of a field |
|
179 * set the control id to given field |
|
180 * @param aField, field to insert |
|
181 */ |
|
182 void CreateUiFieldsL( MVIMPSTUiSearchField& aField ); |
|
183 |
|
184 private: // Data |
|
185 |
|
186 // Own: An array of dialog fields |
|
187 RPointerArray<MVIMPSTUiSearchField> iFieldArray; |
|
188 |
|
189 // not owns, reference to ui builder class ,dialog |
|
190 MVIMPSTSearchUiBuilder* iUiBuilder; |
|
191 |
|
192 // Ref: Editor control |
|
193 CEikEdwin* iControl; |
|
194 |
|
195 // Ref: Fields captioned control |
|
196 CEikCaptionedControl* iCaptionedCtrl; |
|
197 |
|
198 // owns : selelected search type |
|
199 TIMPSTSearchFieldTypes iSelectedSearchType; |
|
200 |
|
201 |
|
202 }; |
|
203 |
|
204 // INLINE FUNCTIONS |
|
205 |
|
206 // -------------------------------------------------------------------------- |
|
207 // CVIMPSTUiSearchFieldArray::Count |
|
208 // -------------------------------------------------------------------------- |
|
209 // |
|
210 inline TInt CVIMPSTUiSearchFieldArray::Count() const |
|
211 { |
|
212 return iFieldArray.Count(); |
|
213 } |
|
214 |
|
215 // -------------------------------------------------------------------------- |
|
216 // CVIMPSTUiSearchFieldArray::At |
|
217 // -------------------------------------------------------------------------- |
|
218 // |
|
219 inline MVIMPSTUiSearchField& CVIMPSTUiSearchFieldArray::At |
|
220 ( TInt aIndex ) |
|
221 { |
|
222 return *iFieldArray[aIndex]; |
|
223 } |
|
224 |
|
225 #endif // CVIMPSTUISEARCHFIELDARAY_H |
|
226 |
|
227 // End of File |
|
228 |
|