|
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: Phonebook 2 FDN contact editor phone number field. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPSU2FDNCONTACTEDITORPHONENUMBERFIELD_H |
|
20 #define CPSU2FDNCONTACTEDITORPHONENUMBERFIELD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <MPbk2ContactEditorField.h> |
|
24 #include <MPbk2ContactEditorField2.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikEdwin; |
|
28 class CEikCaptionedControl; |
|
29 class MVPbkStoreContactField; |
|
30 class MPbk2ContactEditorUiBuilder; |
|
31 class MPbk2FieldProperty; |
|
32 class CPbk2IconInfoContainer; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Phonebook 2 contact editor FDN phone number field. |
|
38 */ |
|
39 NONSHARABLE_CLASS(CPsu2FdnContactEditorPhoneNumberField) : |
|
40 public CBase, |
|
41 public MPbk2ContactEditorField, |
|
42 public MPbk2ContactEditorField2 |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @param aContactField The field to create editor field for. |
|
50 * @param aFieldProperty Field property. |
|
51 * @param aUiBuilder Builder for adding the field into |
|
52 * dialog. |
|
53 * @param aIconInfoContainer Icon container for setting the icon. |
|
54 * @return A new instance of this class. |
|
55 */ |
|
56 static CPsu2FdnContactEditorPhoneNumberField* NewL( |
|
57 MVPbkStoreContactField& aContactField, |
|
58 const MPbk2FieldProperty& aFieldProperty, |
|
59 MPbk2ContactEditorUiBuilder& aUiBuilder, |
|
60 CPbk2IconInfoContainer& aIconInfoContainer ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 ~CPsu2FdnContactEditorPhoneNumberField(); |
|
66 |
|
67 public: // From MPbk2ContactEditorField |
|
68 TInt ControlId() const; |
|
69 CEikEdwin* Control() const; |
|
70 void SaveFieldL(); |
|
71 |
|
72 TBool FieldDataChanged() const; |
|
73 TPtrC FieldLabel() const; |
|
74 void SetFieldLabelL( |
|
75 const TDesC& aLabel ); |
|
76 HBufC* ControlTextL() const; |
|
77 void SetFocus(); |
|
78 void ActivateL(); |
|
79 MVPbkStoreContactField& ContactField() const; |
|
80 const MPbk2FieldProperty& FieldProperty() const; |
|
81 void AcceptL( |
|
82 MPbk2ContactEditorFieldVisitor& aVisitor ); |
|
83 TBool ConsumesKeyEvent( |
|
84 const TKeyEvent& aKeyEvent, |
|
85 TEventCode aType ); |
|
86 TAny* ContactEditorFieldExtension(TUid aExtensionUid ); |
|
87 |
|
88 public: // From MPbk2ContactEditorField2 |
|
89 TBool HandleCustomFieldCommandL(TInt aCommand ); |
|
90 |
|
91 private: // Implementation |
|
92 CPsu2FdnContactEditorPhoneNumberField( |
|
93 MVPbkStoreContactField& aContactField, |
|
94 const MPbk2FieldProperty& aFieldProperty, |
|
95 MPbk2ContactEditorUiBuilder& aUiBuilder, |
|
96 const CPbk2IconInfoContainer& aIconInfoContainer ); |
|
97 void ConstructL(); |
|
98 |
|
99 private: // Data |
|
100 /// Ref: Store contact field |
|
101 MVPbkStoreContactField& iContactField; |
|
102 /// Ref: Field property |
|
103 const MPbk2FieldProperty& iFieldProperty; |
|
104 /// Ref: UI builder |
|
105 MPbk2ContactEditorUiBuilder& iUiBuilder; |
|
106 /// Ref: Icon info container |
|
107 const CPbk2IconInfoContainer& iIconInfoContainer; |
|
108 /// Ref: Field editor |
|
109 CEikEdwin* iControl; |
|
110 /// Ref: Field captioned control |
|
111 CEikCaptionedControl* iCaptionedCtrl; |
|
112 /// Own: Indicates has contact data changed |
|
113 TBool iContactDataHasChanged; |
|
114 }; |
|
115 |
|
116 #endif // CPSU2FDNCONTACTEDITORPHONENUMBERFIELD_H |
|
117 |
|
118 // End of File |