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 "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".
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;
30 class CPbkContactItem;
31 class CPbkFieldAnalyzer;
32 class CPbkContactEngine;
38 * Phonebook field selection dialog. This class is used to show a Phonebook
39 * contact item field selection dialog to the user. The user is able to
40 * select a particular field from the dialog and this selection is returned
43 class CPbkSelectFieldDlg : public CBase
49 IMPORT_C CPbkSelectFieldDlg();
52 * Runs the dialog and returns selected field.
53 * NOTE: this object is deleted when this function
56 * @param aArray Array of TPbkContactItemFields
57 * @param aCbaResourceId Softkey buttons for the control.
58 * @param aHeading Possible heading for the control.
59 * @param aFocusIndex Field index to focus initially.
61 * @return The selected contact item field or NULL.
63 IMPORT_C TPbkContactItemField* ExecuteLD
64 (CPbkFieldArray& aArray,
66 const TDesC& aHeading = KNullDesC,
72 IMPORT_C ~CPbkSelectFieldDlg();
75 * Registers aKeyObserver as a key event observer of this control.
76 * Only one observer is supported and setting a new one removes the
79 * @param aKeyObserver A Phonebook control key observer.
81 IMPORT_C void SetObserver(MPbkControlKeyObserver* aKeyObserver);
84 * Attempts to exit this dialog as if a soft button was pressed.
85 * @see CAknPopupList::AttemptExitL(TBool).
87 IMPORT_C void AttemptExitL(TBool aAccept);
90 * Sets aSelfPtr to NULL when this dialog is destroyed.
91 * @precond !aSelfPtr || *aSelfPtr==this
93 IMPORT_C void ResetWhenDestroyed(CPbkSelectFieldDlg** aSelfPtr);
96 /// Specialized listbox class
98 /// Own: ListBox inside the popuplist
100 /// Specialized popup list class
102 /// Own: popup list query
103 CPopupList* iPopupList;
104 /// Ref: key event observer
105 MPbkControlKeyObserver* iKeyObserver;
106 /// Ref: Set to ETrue in destructor
107 TBool* iDestroyedPtr;
108 /// Ref: Set to NULL when this dialog is destroyed.
109 CPbkSelectFieldDlg** iSelfPtr;
114 #endif // __CPbkSelectFieldDlg_H__