|
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 contact editor image field. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CONTACTEDITORIMAGEFIELD_H |
|
20 #define CPBK2CONTACTEDITORIMAGEFIELD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CPbk2ContactEditorFieldBase.h" |
|
24 #include "CPbk2ContactEditorReadonlyField.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CEikEdwin; |
|
28 class CEikCaptionedControl; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Phonebook 2 contact editor ringtone field. |
|
34 */ |
|
35 NONSHARABLE_CLASS(CPbk2ContactEditorImageField) : |
|
36 public CPbk2ContactEditorFieldBase |
|
37 { |
|
38 public: |
|
39 enum TTextState |
|
40 { |
|
41 ENoData, //AddImage |
|
42 EFilename, |
|
43 EThumbnail |
|
44 }; |
|
45 |
|
46 enum TClipFileExtension |
|
47 { |
|
48 EClipFileExtension, |
|
49 EDontClipFileExtension |
|
50 }; |
|
51 |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Creates a new instance of this class. |
|
56 * |
|
57 * @param aContactField Contact field. |
|
58 * @param aUiBuilder UI builder for adding the |
|
59 * field into dialog. |
|
60 * @param aIconInfoContainer Icon container for |
|
61 * setting the field icon. |
|
62 * @param aCustomPosition Position where this custom controls should be placed. |
|
63 * @return A new instance of this class. |
|
64 */ |
|
65 static CPbk2ContactEditorImageField* NewLC( |
|
66 CPbk2PresentationContactField& aContactField, |
|
67 MPbk2ContactEditorUiBuilder& aUiBuilder, |
|
68 CPbk2IconInfoContainer& aIconInfoContainer, |
|
69 TInt aCustomPosition); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 virtual ~CPbk2ContactEditorImageField(); |
|
75 |
|
76 /** |
|
77 * Returns control id of this custom line. |
|
78 * |
|
79 * @return Control id. |
|
80 */ |
|
81 TInt ControlId() const; |
|
82 |
|
83 public: |
|
84 void SetTextL(); |
|
85 TInt TextState(); |
|
86 |
|
87 private: // From MPbk2ContactEditorField |
|
88 CEikEdwin* Control() const; |
|
89 void SaveFieldL(); |
|
90 void ActivateL(); |
|
91 void AcceptL( |
|
92 MPbk2ContactEditorFieldVisitor& aVisitor ); |
|
93 TBool ConsumesKeyEvent |
|
94 ( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
95 TAny* ContactEditorFieldExtension( |
|
96 TUid aExtensionUid ); |
|
97 HBufC* ControlTextL() const; |
|
98 TBool HandleCustomFieldCommandL(TInt aCommand ); |
|
99 |
|
100 private: // Implementation |
|
101 CPbk2ContactEditorImageField( |
|
102 CPbk2PresentationContactField& aContactField, |
|
103 MPbk2ContactEditorUiBuilder& aUiBuilder, |
|
104 CPbk2IconInfoContainer& aIconInfoContainer ); |
|
105 void ConstructL(TInt aCustomPosition); |
|
106 void FormatTextL(TPtrC aDataPtr, TClipFileExtension aClipFileExtension); |
|
107 |
|
108 private: // Data |
|
109 /// Ref: Editor control |
|
110 CPbk2ContactEditorReadonlyField* iControl; |
|
111 /// Ref: Fields captioned control |
|
112 CEikCaptionedControl* iCaptionedCtrl; |
|
113 /// Own: Text content when editor was opened |
|
114 HBufC* iInitialText; |
|
115 TInt iTextState; |
|
116 }; |
|
117 |
|
118 #endif // CPBK2CONTACTEDITORIMAGEFIELD_H |
|
119 |
|
120 // End of File |