|
1 /* |
|
2 * Copyright (c) 2008 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: Field selection dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFSCSELECTFIELDDLG_H |
|
20 #define CFSCSELECTFIELDDLG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MVPbkStoreContactField; |
|
27 class MVPbkStoreContactFieldCollection; |
|
28 class CFscPresentationContactFieldCollection; |
|
29 class MFscControlKeyObserver; |
|
30 class CVPbkContactManager; |
|
31 class MPbk2FieldPropertyArray; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Phonebook 2 field selection dialog. |
|
37 */ |
|
38 NONSHARABLE_CLASS(CFscSelectFieldDlg) : public CBase |
|
39 { |
|
40 public: // Construction and destruction |
|
41 |
|
42 /** |
|
43 * Constructor. |
|
44 */ |
|
45 CFscSelectFieldDlg(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CFscSelectFieldDlg(); |
|
51 |
|
52 public: // Interface |
|
53 |
|
54 /** |
|
55 * Runs the dialog and returns selected field. Caller takes the |
|
56 * ownership of the field. Field is left to the cleanupstack |
|
57 * on return. NOTE: this object is deleted when this function |
|
58 * returns or leaves. |
|
59 * |
|
60 * @param aFieldCollection Array of store contact fields. |
|
61 * @param aContactManager Virtual Phonebook contact manager. |
|
62 * @param aFieldProperties Phonebook 2 field properties. |
|
63 * @param aCbaResourceId Softkey buttons for the control. |
|
64 * @param aHeading Possible heading text for the control. |
|
65 * @param aFocusIndex Field index to focus initially. |
|
66 * |
|
67 * @return Returns the selected contact item field or NULL. |
|
68 * @see CFscSelectFieldDlg::TPbk2SelectFieldFlags |
|
69 */ |
|
70 MVPbkStoreContactField* ExecuteLD( |
|
71 MVPbkStoreContactFieldCollection& aFieldCollection, |
|
72 const CVPbkContactManager& aContactManager, |
|
73 const MPbk2FieldPropertyArray& aFieldProperties, |
|
74 TInt aCbaResourceId, |
|
75 const TDesC& aHeading = KNullDesC, |
|
76 TInt aFocusIndex = KErrNotFound ); |
|
77 |
|
78 /** |
|
79 * Registers aKeyObserver as a key event observer of this control. |
|
80 * Only one observer is supported and setting a new one removes the |
|
81 * previous setting. |
|
82 * |
|
83 * @param aKeyObserver Phonebook 2 control key observer. |
|
84 */ |
|
85 void SetObserver( |
|
86 MFscControlKeyObserver* aKeyObserver ); |
|
87 |
|
88 /** |
|
89 * Attempts to exit this dialog just like a soft button was pressed. |
|
90 * @see CAknPopupList::AttemptExitL(TBool). |
|
91 */ |
|
92 void AttemptExitL( |
|
93 TBool aAccept ); |
|
94 |
|
95 /** |
|
96 * Sets given pointer to NULL when this dialog is destroyed. |
|
97 * |
|
98 * @param aSelfPtr The pointer to use. |
|
99 * @precond !aSelfPtr || *aSelfPtr==this |
|
100 */ |
|
101 void ResetWhenDestroyed( |
|
102 CFscSelectFieldDlg** aSelfPtr ); |
|
103 |
|
104 private: // Implementation |
|
105 void CreateListBoxL( |
|
106 const CFscPresentationContactFieldCollection& aFieldCollection, |
|
107 const CVPbkContactManager& aContactManager, |
|
108 const MPbk2FieldPropertyArray& aFieldProperties, |
|
109 TInt aCbaResourceId, |
|
110 const TDesC& aHeading, |
|
111 TInt aFocusIndex ); |
|
112 |
|
113 private: // Data |
|
114 /// Specialized list box class |
|
115 class CListBox; |
|
116 /// Own: List box inside the popup list |
|
117 CListBox* iListBox; |
|
118 /// Specialized popup list class |
|
119 class CPopupList; |
|
120 /// Own: Popup list query |
|
121 CPopupList* iPopupList; |
|
122 /// Ref: Key event observer |
|
123 MFscControlKeyObserver* iKeyObserver; |
|
124 /// Ref: Set to ETrue in destructor |
|
125 TBool* iDestroyedPtr; |
|
126 /// Ref: Set to NULL when this dialog is destroyed. |
|
127 CFscSelectFieldDlg** iSelfPtr; |
|
128 }; |
|
129 |
|
130 #endif // CFSCSELECTFIELDDLG_H |
|
131 // End of File |