|
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: |
|
15 * Phonebook Contact editor field base class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPbkContactEditorFieldBase_H__ |
|
21 #define __CPbkContactEditorFieldBase_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <MPbkContactEditorField.h> |
|
25 #include "MPbkFieldEditorControl.h" |
|
26 #include "TPbkContactItemField.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CPbkIconInfoContainer; |
|
30 class CPbkContactItem; |
|
31 class MPbkContactEditorUiBuilder; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Phonebook Contact editor field base class. |
|
38 */ |
|
39 NONSHARABLE_CLASS(CPbkContactEditorFieldBase) : |
|
40 public CBase, |
|
41 public MPbkContactEditorField, |
|
42 public MPbkFieldEditorControl |
|
43 { |
|
44 protected: // Construction |
|
45 /** |
|
46 * Constructor. |
|
47 * @param aField reference to the field to edit |
|
48 * @param aIconInfoContainer reference to icon info container |
|
49 * @param aUiBuilder reference to UI builder |
|
50 */ |
|
51 CPbkContactEditorFieldBase( |
|
52 const TPbkContactItemField& aField, |
|
53 CPbkIconInfoContainer& aIconInfoContainer, |
|
54 MPbkContactEditorUiBuilder& aUiBuilder); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CPbkContactEditorFieldBase(); |
|
60 |
|
61 /** |
|
62 * Base constructor. |
|
63 */ |
|
64 void BaseConstructL(); |
|
65 |
|
66 public: // from MPbkContactEditorField |
|
67 TInt ControlId() const; |
|
68 TPbkFieldId FieldId() const; |
|
69 TPtrC FieldLabel() const; |
|
70 void SetFieldLabelL(HBufC* aLabel); |
|
71 const TPbkContactItemField& ContactItemField() const; |
|
72 HBufC* ControlTextL() const; |
|
73 void ActivateL() = 0; |
|
74 void AcceptL(MPbkFieldEditorVisitor& aVisitor) = 0; |
|
75 TBool ConsumesKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
76 TBool FieldDataChanged() const; |
|
77 |
|
78 |
|
79 protected: // from MPbkFieldEditorControl |
|
80 CEikEdwin* Control() { return NULL; } |
|
81 TPbkFieldId FieldId() { return EPbkFieldIdNone; } |
|
82 void LoadBitmapToFieldL(MPbkContactEditorUiBuilder& aUiBuilder); |
|
83 |
|
84 protected: // utility functions |
|
85 /** |
|
86 * Returns reference to iContactItemField. |
|
87 */ |
|
88 TPbkContactItemField& Field(); |
|
89 |
|
90 protected: // Data |
|
91 /// Own: Contact item field associated with this editor field |
|
92 TPbkContactItemField iContactItemField; |
|
93 /// Ref: Icon info container |
|
94 CPbkIconInfoContainer& iIconInfoContainer; |
|
95 /// Ref: UI builder |
|
96 MPbkContactEditorUiBuilder& iUiBuilder; |
|
97 ///Own: Contact data has changed |
|
98 TBool iContactDataHasChanged; |
|
99 }; |
|
100 |
|
101 #endif // __CPbkContactEditorFieldBase_H__ |
|
102 |
|
103 // End of File |