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 Multiple Entry Fetch API.
20 #ifndef __CPbkMultipleEntryFetchDlg_H__
21 #define __CPbkMultipleEntryFetchDlg_H__
24 #include <e32base.h> // CBase
26 // FORWARD DECLARATIONS
27 class CPbkContactEngine;
28 class CContactViewBase;
29 class CContactIdArray;
31 class MObjectProvider;
32 class MPbkFetchDlgSelection;
38 * Phonebook Multiple Entry Fetch API. This class is used to construct
39 * a Phonebook UI dialog where the user is able to select multiple
40 * contact entries from a list. The selection is then returned to the
43 class CPbkMultipleEntryFetchDlg : public CBase
47 * Multiple entry fetch parameter class.
51 public: // Input parameters
53 * Contact view to display. If NULL loads the default
54 * contact view containing all names in the contact
57 CContactViewBase* iContactView;
59 public: // Output parameters
61 * Returns an array of ids of the selected entries,
62 * undefined if the dialog is canceled.
63 * Caller must delete iMarkedEntries when no longer needed.
65 CContactIdArray* iMarkedEntries;
67 public: // Additional input parameters
69 * OPTIONAL: Fetch softkey resource ID.
70 * If 0, default softkeys are used.
75 * OPTIONAL: Fetch selection accepter.
76 * If NULL, not applicable.
78 MPbkFetchDlgSelection* iFetchSelection;
86 // Compiler-generated destructor is ok for this class
89 * Returns a cleanup item which will handle cleanup of this
90 * object in case of a leave.
92 IMPORT_C operator TCleanupItem();
94 private: // Implementation
95 static void Cleanup(TAny* aPtr);
97 private: // Unimplemented functions
98 /// Unimplemented copy constructor
99 TParams(const TParams&);
100 /// Unimplemented assignment operator
101 TParams& operator=(const TParams&);
106 * Creates a new multiple entry fetch dialog.
108 * @param aParams Fetch parameters, see TParams.
109 * @param aEngine Phonebook engine.
110 * @return A new instance of this class.
112 IMPORT_C static CPbkMultipleEntryFetchDlg* NewL
113 (TParams& aParams, CPbkContactEngine& aEngine);
116 * See CCoeControl::SetMopParent(MObjectProvider* aParent)
118 IMPORT_C void SetMopParent(MObjectProvider* aParent);
121 * Executes this dialog.
122 * NOTE: this object is deleted when ExecuteLD returns or leaves!
123 * NOTE: current status pane layout is replaced with the Phonebook
124 * one. Restoring the original pane is left to be the responsibility
127 * @return A non-zero value if accepted, zero if canceled.
129 IMPORT_C TInt ExecuteLD();
132 * Destructor. Also cancels this dialog and makes ExecuteLD return.
134 ~CPbkMultipleEntryFetchDlg();
136 private: // Implementation
137 CPbkMultipleEntryFetchDlg(TParams& aParams, CPbkContactEngine& aEngine);
139 static void Panic(TInt aReason);
144 /// Own: fetch dialog
145 CPbkFetchDlg* iFetchDlg;
146 /// Ref: Phonebook engine
147 CPbkContactEngine& iPbkEngine;
148 /// Ref: set to ETrue in destructor
149 TBool* iDestroyedPtr;
150 /// Own: Object Provider
151 MObjectProvider* iObjectProvider;
154 #endif // __CPbkMultipleEntryFetchDlg_H__