author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* Phonebook Single Entry Fetch dialog API. |
williamr@2 | 16 |
* |
williamr@2 | 17 |
*/ |
williamr@2 | 18 |
|
williamr@2 | 19 |
|
williamr@2 | 20 |
#ifndef __CPbkSingleEntryFetchDlg_H__ |
williamr@2 | 21 |
#define __CPbkSingleEntryFetchDlg_H__ |
williamr@2 | 22 |
|
williamr@2 | 23 |
// INCLUDES |
williamr@2 | 24 |
#include <e32base.h> // CBase |
williamr@2 | 25 |
#include <cntdef.h> // TContactItemId |
williamr@2 | 26 |
|
williamr@2 | 27 |
// FORWARD DECLARATIONS |
williamr@2 | 28 |
class CContactViewBase; |
williamr@2 | 29 |
class CPbkFetchDlg; |
williamr@2 | 30 |
class CPbkContactEngine; |
williamr@2 | 31 |
class MObjectProvider; |
williamr@2 | 32 |
class MPbkFetchKeyCallback; |
williamr@2 | 33 |
class MPbkFetchDlgAccept; |
williamr@2 | 34 |
|
williamr@2 | 35 |
|
williamr@2 | 36 |
// CLASS DECLARATION |
williamr@2 | 37 |
/** |
williamr@2 | 38 |
* Phonebook Single Entry Fetch API. This class is used to construct |
williamr@2 | 39 |
* a Phonebook UI dialog where the user is able to select a single |
williamr@2 | 40 |
* contact entry from a contact list. The user selection is then returned |
williamr@2 | 41 |
* to the client. |
williamr@2 | 42 |
*/ |
williamr@2 | 43 |
class CPbkSingleEntryFetchDlg : |
williamr@2 | 44 |
public CBase |
williamr@2 | 45 |
{ |
williamr@2 | 46 |
public: // Types |
williamr@2 | 47 |
/** |
williamr@2 | 48 |
* Single entry fetch parameter class. |
williamr@2 | 49 |
*/ |
williamr@2 | 50 |
class TParams |
williamr@2 | 51 |
{ |
williamr@2 | 52 |
public: // Input parameters |
williamr@2 | 53 |
/** |
williamr@2 | 54 |
* Contact database. If NULL, the contact database is |
williamr@2 | 55 |
* retrieved from TLS or constructed if not available. |
williamr@2 | 56 |
* If you have a Contact database on the client side |
williamr@2 | 57 |
* please supply it here. |
williamr@2 | 58 |
*/ |
williamr@2 | 59 |
CPbkContactEngine* iPbkEngine; |
williamr@2 | 60 |
|
williamr@2 | 61 |
/** |
williamr@2 | 62 |
* Contact view to display. If NULL, loads the default |
williamr@2 | 63 |
* contact view containing all names in the contact |
williamr@2 | 64 |
* database. |
williamr@2 | 65 |
* @see CPbkContactEngine::AllContactsView() |
williamr@2 | 66 |
* @see CPbkContactEngine::FilteredContactsViewL() |
williamr@2 | 67 |
*/ |
williamr@2 | 68 |
CContactViewBase* iContactView; |
williamr@2 | 69 |
|
williamr@2 | 70 |
/** |
williamr@2 | 71 |
* OPTIONAL: Fetch key event callback. |
williamr@2 | 72 |
* If NULL, not applicable. |
williamr@2 | 73 |
*/ |
williamr@2 | 74 |
MPbkFetchKeyCallback* iFetchKeyCallback; |
williamr@2 | 75 |
|
williamr@2 | 76 |
/** |
williamr@2 | 77 |
* OPTIONAL: Fetch accept callback. |
williamr@2 | 78 |
* If NULL, not applicable. |
williamr@2 | 79 |
*/ |
williamr@2 | 80 |
MPbkFetchDlgAccept* iFetchDlgAccept; |
williamr@2 | 81 |
|
williamr@2 | 82 |
public: // Output parameters |
williamr@2 | 83 |
/** |
williamr@2 | 84 |
* Returns the id of the selected entry, undefined if the dialog |
williamr@2 | 85 |
* is canceled. |
williamr@2 | 86 |
*/ |
williamr@2 | 87 |
TContactItemId iSelectedEntry; |
williamr@2 | 88 |
|
williamr@2 | 89 |
public: // Additional input parameters |
williamr@2 | 90 |
/** |
williamr@2 | 91 |
* OPTIONAL: Fetch softkey resource ID. |
williamr@2 | 92 |
* If 0, default softkeys are used. |
williamr@2 | 93 |
*/ |
williamr@2 | 94 |
TInt iCbaId; |
williamr@2 | 95 |
|
williamr@2 | 96 |
public: // Constructors |
williamr@2 | 97 |
/** |
williamr@2 | 98 |
* C++ Constructor. |
williamr@2 | 99 |
*/ |
williamr@2 | 100 |
IMPORT_C TParams(); |
williamr@2 | 101 |
|
williamr@2 | 102 |
// Compiler-generated destructor is ok for this class |
williamr@2 | 103 |
|
williamr@2 | 104 |
private: // Unimplemented functions |
williamr@2 | 105 |
/// Unimplemented copy constructor |
williamr@2 | 106 |
TParams(const TParams&); |
williamr@2 | 107 |
/// Unimplemented assignment operator |
williamr@2 | 108 |
TParams& operator=(const TParams&); |
williamr@2 | 109 |
|
williamr@2 | 110 |
private: // data |
williamr@2 | 111 |
/// Own: spare data |
williamr@2 | 112 |
TInt32 iSpare1; |
williamr@2 | 113 |
}; |
williamr@2 | 114 |
|
williamr@2 | 115 |
public: // Interface |
williamr@2 | 116 |
/** |
williamr@2 | 117 |
* Creates a new single entry fetch dialog. |
williamr@2 | 118 |
* |
williamr@2 | 119 |
* @param aParams Fetch parameters, @see TParams |
williamr@2 | 120 |
* @return New instance of this class. |
williamr@2 | 121 |
*/ |
williamr@2 | 122 |
IMPORT_C static CPbkSingleEntryFetchDlg* NewL(TParams& aParams); |
williamr@2 | 123 |
|
williamr@2 | 124 |
/** |
williamr@2 | 125 |
* @see CCoeControl::SetMopParent(MObjectProvider* aParent) |
williamr@2 | 126 |
*/ |
williamr@2 | 127 |
IMPORT_C void SetMopParent(MObjectProvider* aParent); |
williamr@2 | 128 |
|
williamr@2 | 129 |
/** |
williamr@2 | 130 |
* Sets *aSelfPtr to NULL when this dialog is destroyed. |
williamr@2 | 131 |
* @precond !aSelfPtr || *aSelfPtr==this |
williamr@2 | 132 |
*/ |
williamr@2 | 133 |
IMPORT_C void ResetWhenDestroyed(CPbkSingleEntryFetchDlg** aSelfPtr); |
williamr@2 | 134 |
|
williamr@2 | 135 |
/** |
williamr@2 | 136 |
* Executes this dialog. |
williamr@2 | 137 |
* NOTE: this object is deleted when ExecuteLD returns or leaves! |
williamr@2 | 138 |
* NOTE: current status pane layout is replaced with the Phonebook |
williamr@2 | 139 |
* one. Restoring the original pane is left to be the responsibility |
williamr@2 | 140 |
* of the caller. |
williamr@2 | 141 |
* |
williamr@2 | 142 |
* @return A non-zero value if accepted, 0 if canceled. |
williamr@2 | 143 |
*/ |
williamr@2 | 144 |
IMPORT_C TInt ExecuteLD(); |
williamr@2 | 145 |
|
williamr@2 | 146 |
/** |
williamr@2 | 147 |
* Destructor. Also cancels this dialog and makes ExecuteLD return. |
williamr@2 | 148 |
*/ |
williamr@2 | 149 |
~CPbkSingleEntryFetchDlg(); |
williamr@2 | 150 |
|
williamr@2 | 151 |
private: // Implementation |
williamr@2 | 152 |
CPbkSingleEntryFetchDlg(TParams& aParams); |
williamr@2 | 153 |
void ConstructL(); |
williamr@2 | 154 |
static void Panic(TInt aReason); |
williamr@2 | 155 |
|
williamr@2 | 156 |
private: // Data |
williamr@2 | 157 |
/// Own: parameters |
williamr@2 | 158 |
TParams& iParams; |
williamr@2 | 159 |
/// Own: fetch dialog |
williamr@2 | 160 |
CPbkFetchDlg* iFetchDlg; |
williamr@2 | 161 |
/// Ref: Phonebook engine |
williamr@2 | 162 |
CPbkContactEngine* iPbkEngine; |
williamr@2 | 163 |
/// Own: Phonebook engine |
williamr@2 | 164 |
CPbkContactEngine* iOwnPbkEngine; |
williamr@2 | 165 |
/// Ref: contact view to use for fetcing |
williamr@2 | 166 |
CContactViewBase* iContactView; |
williamr@2 | 167 |
/// Ref: set to ETrue in destructor |
williamr@2 | 168 |
TBool* iDestroyedPtr; |
williamr@2 | 169 |
/// Ref: pointer to self |
williamr@2 | 170 |
CPbkSingleEntryFetchDlg** iSelfPtr; |
williamr@2 | 171 |
/// Own: Object Provider |
williamr@2 | 172 |
MObjectProvider* iObjectProvider; |
williamr@2 | 173 |
}; |
williamr@2 | 174 |
|
williamr@2 | 175 |
#endif // __CPbkSingleEntryFetchDlg_H__ |
williamr@2 | 176 |
|
williamr@2 | 177 |
// End of File |