|
1 /* |
|
2 * Copyright (c) 2002 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 - Landmark editor field array. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef __CLMKEDITORFIELDARRAY_H__ |
|
25 #define __CLMKEDITORFIELDARRAY_H__ |
|
26 |
|
27 // INCLUDES |
|
28 #include "landmarks.hrh" |
|
29 #include "CLmkLandMarkCategoriesName.h" |
|
30 #include <e32base.h> |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class MLmkEditorField; |
|
34 class MLmkEditorUiBuilder; |
|
35 class CLmkFields; |
|
36 class CPosLandmark; |
|
37 class MLmkFieldData; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Landmark editor field array. |
|
43 */ |
|
44 class CLmkEditorFieldArray : |
|
45 public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 /** |
|
49 * Creates an editor for aLmkItem. |
|
50 * @param aLmkItem edited landmark item |
|
51 * @param aUiBuilder reference to the UI creator |
|
52 * @return newly instantiated object |
|
53 */ |
|
54 static CLmkEditorFieldArray* NewL |
|
55 (CLmkFields& aLmkFields, |
|
56 MLmkEditorUiBuilder& aUiBuilder); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CLmkEditorFieldArray(); |
|
62 |
|
63 public: // Interface |
|
64 /** |
|
65 * Update fields |
|
66 * @param aFieldType |
|
67 */ |
|
68 void UpdateFieldsL(const TUint16 aFieldType=EAllEditorItems); |
|
69 |
|
70 /** |
|
71 * 2nd part constructor. |
|
72 * Create dialog lines from iLmkFields |
|
73 */ |
|
74 void CreateFieldsFromLmkL(); |
|
75 |
|
76 /** |
|
77 * Returns ETrue if all the fields of this lmk are empty |
|
78 * or contain only whitespace characters. |
|
79 * @return TBool |
|
80 */ |
|
81 TBool AreAllFieldsEmptyL() const; |
|
82 |
|
83 /** |
|
84 * Returns the aFieldIndex field. |
|
85 * @precond aFieldIndex >= 0 && aFieldIndex < EditorCount() |
|
86 */ |
|
87 const MLmkEditorField& FieldAt(TInt aFieldIndex); |
|
88 |
|
89 /** |
|
90 * Returns the lmk editor field corresponding to aControlId. |
|
91 * @return NULL if not found. |
|
92 */ |
|
93 //MLmkEditorField* Find( TInt aControlId, TInt* aPos =NULL ) const; |
|
94 MLmkEditorField* Find( TInt aControlId, TInt* aPos=NULL , TInt* aPrevControlId=NULL ) const; |
|
95 |
|
96 /** |
|
97 * Saves all fields in the editor to the lmk item. |
|
98 * @return true if at least one field was changed |
|
99 */ |
|
100 TBool SaveFieldsL(); |
|
101 void SaveFieldsToBufferL(); |
|
102 |
|
103 public: //new function |
|
104 /** |
|
105 * Its a getter method for returning the field array |
|
106 * @return iFieldArray member by reference |
|
107 */ |
|
108 CArrayPtrFlat<MLmkEditorField>& GetFieldArray(); |
|
109 public :// Added for category name support |
|
110 void SetCategoryName(const TDesC& aCategoryName); |
|
111 TBool CheckIfFieldIsEmpty(MLmkFieldData& a); |
|
112 |
|
113 private: // Implementation |
|
114 /** |
|
115 * Create CLmkEditorFieldArray object |
|
116 * @param aLmkFields |
|
117 * @param aUiBuilder |
|
118 * @return newly instantiated object |
|
119 */ |
|
120 CLmkEditorFieldArray( |
|
121 CLmkFields& aLmkFields, |
|
122 MLmkEditorUiBuilder& aUiBuilder); |
|
123 |
|
124 void ConstructL(); |
|
125 |
|
126 private: // Data |
|
127 /// Ref: |
|
128 CLmkFields& iLmkFields; |
|
129 |
|
130 /// Ref: editor UI creator |
|
131 MLmkEditorUiBuilder& iUiBuilder; |
|
132 |
|
133 /// Own: Contact editor fields |
|
134 CArrayPtrFlat<MLmkEditorField> iFieldArray; |
|
135 TCategoryName iCategoryName; |
|
136 TBool iCategoryFlag; |
|
137 }; |
|
138 |
|
139 #endif // __CLMKEDITORFIELDARRAY_H__ |
|
140 |
|
141 // End of File |