|
1 /* |
|
2 * Copyright (c) 2002-2007 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: An array of editor fields. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MPBK2CONTACTEDITORFIELDARRAY_H |
|
20 #define MPBK2CONTACTEDITORFIELDARRAY_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class TPbk2ContactEditorParams; |
|
24 class MPbk2ContactEditorUiBuilder; |
|
25 class CPbk2PresentationContact; |
|
26 class CPbk2PresentationContactField; |
|
27 class CPbk2IconInfoContainer; |
|
28 class MPbk2ContactEditorField; |
|
29 class MVPbkFieldType; |
|
30 class CPbk2ContactEditorArrayItem; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 |
|
35 class MPbk2ContactEditorFieldArray |
|
36 { |
|
37 public: // Destruction |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 virtual ~MPbk2ContactEditorFieldArray() {} |
|
42 |
|
43 public: // Interface |
|
44 |
|
45 /** |
|
46 * Returns the amount fields in the array. |
|
47 * |
|
48 * @return The amount fields in the array. |
|
49 */ |
|
50 virtual TInt Count() const = 0; |
|
51 |
|
52 /** |
|
53 * Returns the field in given index. |
|
54 * |
|
55 * @param aIndex The index of the field. |
|
56 * @return The field in given index. |
|
57 */ |
|
58 virtual CPbk2ContactEditorArrayItem& At(TInt aIndex) = 0; |
|
59 |
|
60 /** |
|
61 * Saves all fields in the editor to the contact item. |
|
62 * |
|
63 */ |
|
64 virtual void SaveFieldsL() = 0; |
|
65 |
|
66 /** |
|
67 * Check are fields changed. SaveFieldsL method |
|
68 * should call before this. |
|
69 * |
|
70 * @return ETrue if at least one field was changed. |
|
71 */ |
|
72 virtual TBool FieldsChanged() const = 0; |
|
73 |
|
74 /** |
|
75 * Returns ETrue if all the fields of this contact are empty |
|
76 * or contain only whitespace characters. |
|
77 * |
|
78 * @return ETrue if all fields are empty. |
|
79 */ |
|
80 virtual TBool AreAllUiFieldsEmpty() const = 0; |
|
81 |
|
82 /** |
|
83 * Sets the focus to the field in given index. |
|
84 * |
|
85 * @param aFieldIndex The index of the field to set. |
|
86 */ |
|
87 virtual void SetFocus(TInt aFieldIndex) = 0; |
|
88 |
|
89 /** |
|
90 * Finds the field that has the given control id. |
|
91 * |
|
92 * @param aControlId The control id of the field. |
|
93 * @return The field or NULL if not found. |
|
94 */ |
|
95 virtual CPbk2ContactEditorArrayItem* Find(TInt aControlId) = 0; |
|
96 |
|
97 /** |
|
98 * Adds a new field to the contact and to the UI. |
|
99 * |
|
100 * @param aFieldType The field type of the new field. |
|
101 * @return The control id of the new UI field. |
|
102 */ |
|
103 virtual TInt AddNewFieldL(const MVPbkFieldType& aFieldType) = 0; |
|
104 |
|
105 /** |
|
106 * Removes the field from the contact and the editor. |
|
107 * |
|
108 * @param The field to remove. |
|
109 */ |
|
110 virtual void RemoveField(CPbk2ContactEditorArrayItem& aField) = 0; |
|
111 |
|
112 /** |
|
113 * Adds a new field to the contact and to the UI. |
|
114 * |
|
115 * @param aFieldType The field type of the new field. |
|
116 * @param aName The name for field type of the new field. |
|
117 * @return The control id of the new UI field. |
|
118 */ |
|
119 virtual TInt AddNewFieldL(const MVPbkFieldType& aFieldType, |
|
120 const TDesC& aName) = 0; |
|
121 |
|
122 }; |
|
123 |
|
124 #endif // MPBK2CONTACTEDITORFIELDARRAY_H |
|
125 |
|
126 // End of File |