author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
parent 1 | 666f914201fb |
child 4 | 837f303aceeb |
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@2 | 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 |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 Item Fetch API. |
williamr@2 | 16 |
* |
williamr@2 | 17 |
*/ |
williamr@2 | 18 |
|
williamr@2 | 19 |
|
williamr@2 | 20 |
#ifndef __CPbkSingleItemFetchDlg_H__ |
williamr@2 | 21 |
#define __CPbkSingleItemFetchDlg_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 CPbkSelectFieldDlg; |
williamr@2 | 31 |
class CPbkContactEngine; |
williamr@2 | 32 |
class CPbkFieldIdArray; |
williamr@2 | 33 |
class CPbkContactItem; |
williamr@2 | 34 |
class TPbkContactItemField; |
williamr@2 | 35 |
class MObjectProvider; |
williamr@2 | 36 |
|
williamr@2 | 37 |
|
williamr@2 | 38 |
// CLASS DECLARATION |
williamr@2 | 39 |
|
williamr@2 | 40 |
/** |
williamr@2 | 41 |
* Phonebook Single Item Fetch API. This class is used to construct |
williamr@2 | 42 |
* a Phonebook UI dialog where the user is able to select a single |
williamr@2 | 43 |
* contact entry from a contact list. Then the user must select a |
williamr@2 | 44 |
* particular field of that selected contact. The selected contact |
williamr@2 | 45 |
* item and field are then returned to the client. |
williamr@2 | 46 |
*/ |
williamr@2 | 47 |
class CPbkSingleItemFetchDlg : public CBase |
williamr@2 | 48 |
{ |
williamr@2 | 49 |
public: // Types |
williamr@2 | 50 |
/** |
williamr@2 | 51 |
* Single item fetch parameter class. |
williamr@2 | 52 |
*/ |
williamr@2 | 53 |
class TParams |
williamr@2 | 54 |
{ |
williamr@2 | 55 |
public: // Input parameters |
williamr@2 | 56 |
/** |
williamr@2 | 57 |
* Contact view to display. If NULL, loads the default |
williamr@2 | 58 |
* contact view containing all names in the contact |
williamr@2 | 59 |
* database. |
williamr@2 | 60 |
*/ |
williamr@2 | 61 |
CContactViewBase* iContactView; |
williamr@2 | 62 |
|
williamr@2 | 63 |
/** |
williamr@2 | 64 |
* Array of field types to fetch. |
williamr@2 | 65 |
*/ |
williamr@2 | 66 |
const CPbkFieldIdArray* iFieldIdArray; |
williamr@2 | 67 |
|
williamr@2 | 68 |
public: // Output parameters |
williamr@2 | 69 |
/** |
williamr@2 | 70 |
* Returns an contact item of the selected entry, undefined |
williamr@2 | 71 |
* if the dialog is canceled. Caller is responsible of |
williamr@2 | 72 |
* deleting iContactItem. |
williamr@2 | 73 |
*/ |
williamr@2 | 74 |
CPbkContactItem* iContactItem; |
williamr@2 | 75 |
|
williamr@2 | 76 |
/** |
williamr@2 | 77 |
* Returns a field of the selected entry, undefined if the |
williamr@2 | 78 |
* dialog is canceled. This is iContactItem's field so it |
williamr@2 | 79 |
* is deleted when iContactItem is deleted. |
williamr@2 | 80 |
*/ |
williamr@2 | 81 |
TPbkContactItemField* iContactItemField; |
williamr@2 | 82 |
|
williamr@2 | 83 |
public: // Additional input parameters |
williamr@2 | 84 |
/** |
williamr@2 | 85 |
* OPTIONAL: Fetch softkey resource ID. |
williamr@2 | 86 |
* If 0, Default softkeys are used. |
williamr@2 | 87 |
*/ |
williamr@2 | 88 |
TInt iCbaId; |
williamr@2 | 89 |
|
williamr@2 | 90 |
public: // Constructors |
williamr@2 | 91 |
/** |
williamr@2 | 92 |
* C++ constructor. |
williamr@2 | 93 |
*/ |
williamr@2 | 94 |
IMPORT_C TParams(); |
williamr@2 | 95 |
|
williamr@2 | 96 |
// Compiler-generated destructor is ok for this class |
williamr@2 | 97 |
|
williamr@2 | 98 |
/** |
williamr@2 | 99 |
* Returns a cleanup item which will handle cleanup of this |
williamr@2 | 100 |
* object in case a leave occurs. |
williamr@2 | 101 |
*/ |
williamr@2 | 102 |
IMPORT_C operator TCleanupItem(); |
williamr@2 | 103 |
|
williamr@2 | 104 |
private: // Implementation |
williamr@2 | 105 |
static void Cleanup(TAny* aSelf); |
williamr@2 | 106 |
|
williamr@2 | 107 |
private: // Unimplemented functions |
williamr@2 | 108 |
/// Unimplemented copy constructor |
williamr@2 | 109 |
TParams(const TParams&); |
williamr@2 | 110 |
/// Unimplemented assignment operator |
williamr@2 | 111 |
TParams& operator=(const TParams&); |
williamr@2 | 112 |
|
williamr@2 | 113 |
private: // data |
williamr@2 | 114 |
/// Own: spare data |
williamr@2 | 115 |
TInt32 iSpare1; |
williamr@2 | 116 |
}; |
williamr@2 | 117 |
|
williamr@2 | 118 |
public: // Interface |
williamr@2 | 119 |
/** |
williamr@2 | 120 |
* Creates a new single entry fetch dialog. |
williamr@2 | 121 |
* |
williamr@2 | 122 |
* @param aParams Fetch parameters, @see TParams |
williamr@2 | 123 |
* @param aEngine Phonebook engine |
williamr@2 | 124 |
*/ |
williamr@2 | 125 |
IMPORT_C static CPbkSingleItemFetchDlg* NewL |
williamr@2 | 126 |
(TParams& aParams, CPbkContactEngine& aEngine); |
williamr@2 | 127 |
|
williamr@2 | 128 |
/** |
williamr@2 | 129 |
* @see CCoeControl::SetMopParent(MObjectProvider* aParent) |
williamr@2 | 130 |
*/ |
williamr@2 | 131 |
IMPORT_C void SetMopParent(MObjectProvider* aParent); |
williamr@2 | 132 |
|
williamr@2 | 133 |
/** |
williamr@2 | 134 |
* Executes this dialog. |
williamr@2 | 135 |
* NOTE: this object is deleted when ExecuteLD returns or leaves! |
williamr@2 | 136 |
* NOTE: current status pane layout is replaced with the Phonebook |
williamr@2 | 137 |
* one. Restoring the original pane is left to be the responsibility |
williamr@2 | 138 |
* of the caller. |
williamr@2 | 139 |
* |
williamr@2 | 140 |
* @return A non-zero value if not canceled. |
williamr@2 | 141 |
*/ |
williamr@2 | 142 |
IMPORT_C TInt ExecuteLD(); |
williamr@2 | 143 |
|
williamr@2 | 144 |
/** |
williamr@2 | 145 |
* Destructor. Also cancels this dialog if ExecuteLD() has been called. |
williamr@2 | 146 |
*/ |
williamr@2 | 147 |
~CPbkSingleItemFetchDlg(); |
williamr@2 | 148 |
|
williamr@2 | 149 |
private: // Implementation |
williamr@2 | 150 |
CPbkSingleItemFetchDlg(TParams& aParams, CPbkContactEngine& aEngine); |
williamr@2 | 151 |
void ConstructL(); |
williamr@2 | 152 |
TBool EntryFetchAcceptedL(TContactItemId aCid); |
williamr@2 | 153 |
class TFetchCallback; |
williamr@2 | 154 |
friend class TFetchCallback; |
williamr@2 | 155 |
|
williamr@2 | 156 |
private: // Data |
williamr@2 | 157 |
/// Own: parameters |
williamr@2 | 158 |
TParams& iParams; |
williamr@2 | 159 |
/// Ref: contact view containing contacts to choose from |
williamr@2 | 160 |
CContactViewBase* iContactView; |
williamr@2 | 161 |
/// Own: fetch dialog |
williamr@2 | 162 |
CPbkFetchDlg* iFetchDlg; |
williamr@2 | 163 |
/// Own: field selection dialog |
williamr@2 | 164 |
CPbkSelectFieldDlg* iFieldDlg; |
williamr@2 | 165 |
/// Own: Phonebook engine |
williamr@2 | 166 |
CPbkContactEngine& iPbkEngine; |
williamr@2 | 167 |
/// Own: contact item to return to user via iParams |
williamr@2 | 168 |
CPbkContactItem* iContactItem; |
williamr@2 | 169 |
/// Own: contact item field to return to user via iParams |
williamr@2 | 170 |
TPbkContactItemField* iContactItemField; |
williamr@2 | 171 |
/// Ref: set to ETrue in destructor |
williamr@2 | 172 |
TBool* iDestroyedPtr; |
williamr@2 | 173 |
/// Own: object provicer |
williamr@2 | 174 |
MObjectProvider* iObjectProvider; |
williamr@2 | 175 |
}; |
williamr@2 | 176 |
|
williamr@2 | 177 |
#endif // __CPbkSingleItemFetchDlg_H__ |
williamr@2 | 178 |
|
williamr@2 | 179 |
// End of File |