2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Phonebook field selection dialog.
20 #ifndef __CPbkSelectFieldDlg_H__
21 #define __CPbkSelectFieldDlg_H__
24 #include <e32base.h> // CBase
26 // FORWARD DECLARATIONS
27 class TPbkContactItemField;
29 class MPbkControlKeyObserver;
35 * Phonebook field selection dialog. This class is used to show a Phonebook
36 * contact item field selection dialog to the user. The user is able to
37 * select a particular field from the dialog and this selection is returned
40 class CPbkSelectFieldDlg : public CBase
46 IMPORT_C CPbkSelectFieldDlg();
49 * Runs the dialog and returns selected field.
50 * NOTE: this object is deleted when this function
53 * @param aArray Array of TPbkContactItemFields
54 * @param aCbaResourceId Softkey buttons for the control.
55 * @param aHeading Possible heading for the control.
56 * @param aFocusIndex Field index to focus initially.
58 * @return The selected contact item field or NULL.
60 IMPORT_C TPbkContactItemField* ExecuteLD
61 (CPbkFieldArray& aArray,
63 const TDesC& aHeading = KNullDesC,
69 IMPORT_C ~CPbkSelectFieldDlg();
72 * Registers aKeyObserver as a key event observer of this control.
73 * Only one observer is supported and setting a new one removes the
76 * @param aKeyObserver A Phonebook control key observer.
78 IMPORT_C void SetObserver(MPbkControlKeyObserver* aKeyObserver);
81 * Attempts to exit this dialog as if a soft button was pressed.
82 * @see CAknPopupList::AttemptExitL(TBool).
84 IMPORT_C void AttemptExitL(TBool aAccept);
87 * Sets aSelfPtr to NULL when this dialog is destroyed.
88 * @precond !aSelfPtr || *aSelfPtr==this
90 IMPORT_C void ResetWhenDestroyed(CPbkSelectFieldDlg** aSelfPtr);
93 /// Specialized listbox class
95 /// Own: ListBox inside the popuplist
97 /// Specialized popup list class
99 /// Own: popup list query
100 CPopupList* iPopupList;
101 /// Ref: key event observer
102 MPbkControlKeyObserver* iKeyObserver;
103 /// Ref: Set to ETrue in destructor
104 TBool* iDestroyedPtr;
105 /// Ref: Set to NULL when this dialog is destroyed.
106 CPbkSelectFieldDlg** iSelfPtr;
111 #endif // __CPbkSelectFieldDlg_H__