63
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
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".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Phonebook 2 address selection.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPBK2ADDRESSSELECT_H
|
|
20 |
#define CPBK2ADDRESSSELECT_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <coedef.h> // TKeyResponse
|
|
25 |
#include <w32std.h> // TKeyEvent, TEventCode
|
|
26 |
#include <MPbk2DialogEliminator.h>
|
|
27 |
|
|
28 |
// FORWARD DECLARATIONS
|
|
29 |
class MVPbkStoreContactField;
|
|
30 |
class CVPbkFieldTypeSelector;
|
|
31 |
class CVPbkFieldFilter;
|
|
32 |
class CPbk2SelectFieldDlg;
|
|
33 |
class TPbk2AddressSelectParams;
|
|
34 |
class MVPbkContactAttributeManager;
|
|
35 |
class MVPbkStoreContact;
|
|
36 |
class CPbk2PresenceIconInfo;
|
|
37 |
|
|
38 |
// CLASS DECLARATION
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Phonebook 2 address selection.
|
|
42 |
* Responsible for selecting an appropriate contact field
|
|
43 |
* from given contact. The selection is based on the
|
|
44 |
* given parameters.
|
|
45 |
*/
|
|
46 |
class CPbk2AddressSelect : public CBase,
|
|
47 |
public MPbk2DialogEliminator
|
|
48 |
{
|
|
49 |
public: // Construction and destruction
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Creates a new instance of this class.
|
|
53 |
*
|
|
54 |
* @param aParams Address select parameters.
|
|
55 |
* @return A new instance of this class.
|
|
56 |
*/
|
|
57 |
IMPORT_C static CPbk2AddressSelect* NewL(
|
|
58 |
TPbk2AddressSelectParams& aParams );
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Creates a new instance of this class.
|
|
62 |
*
|
|
63 |
* @param aParams Address select parameters.
|
|
64 |
* @param aFieldTypeSelector Field type selector.
|
|
65 |
* @param aStoreContactsArray Additional contacts
|
|
66 |
* @param aPresenceIconsArray Presence icons array
|
|
67 |
* @return A new instance of this class.
|
|
68 |
*/
|
|
69 |
IMPORT_C static CPbk2AddressSelect* NewL(
|
|
70 |
TPbk2AddressSelectParams& aParams,
|
|
71 |
CVPbkFieldTypeSelector& aFieldTypeSelector,
|
|
72 |
const TArray<MVPbkStoreContact*>* aStoreContactsArray,
|
|
73 |
const TArray<CPbk2PresenceIconInfo*>* aPresenceIconsArray );
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Destructor.
|
|
77 |
* Cancels address selection query if active.
|
|
78 |
*/
|
|
79 |
IMPORT_C ~CPbk2AddressSelect();
|
|
80 |
|
|
81 |
public: // Interface
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Runs an address selection query (if necessary).
|
|
85 |
* Note! The caller is responsible for the contact field
|
|
86 |
* object returned.
|
|
87 |
*
|
|
88 |
* @return NULL if query was cancelled, selected field if
|
|
89 |
* query was accepted. Caller takes the ownership
|
|
90 |
* of the returned field.
|
|
91 |
*/
|
|
92 |
IMPORT_C MVPbkStoreContactField* ExecuteLD();
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Exit any address selection query. Makes ExecuteLD return
|
|
96 |
* which means this object is destroyed after this function returns!
|
|
97 |
*
|
|
98 |
* @param aAccept ETrue means the query selection is accepted and
|
|
99 |
* EFalse that query is canceled.
|
|
100 |
*/
|
|
101 |
IMPORT_C void AttemptExitL(
|
|
102 |
TBool aAccept );
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Override to handle key events in the list query.
|
|
106 |
*
|
|
107 |
* @param aKeyEvent Key event.
|
|
108 |
* @param aType Key event type.
|
|
109 |
* @return EKeyWasConsumed if the key event was consumed,
|
|
110 |
* EKeyWasNotConsumed otherwise.
|
|
111 |
*/
|
|
112 |
IMPORT_C virtual TKeyResponse Pbk2ControlKeyEventL(
|
|
113 |
const TKeyEvent& aKeyEvent,
|
|
114 |
TEventCode aType );
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Sets CBA button labels if needed.
|
|
118 |
* Overrides buttons defined in the resource file.
|
|
119 |
*/
|
|
120 |
IMPORT_C void SetCba(
|
|
121 |
TInt aCbaResourceId );
|
|
122 |
|
|
123 |
public: // From MPbk2DialogEliminator
|
|
124 |
void RequestExitL(
|
|
125 |
TInt aCommandId );
|
|
126 |
void ForceExit();
|
|
127 |
void ResetWhenDestroyed(
|
|
128 |
MPbk2DialogEliminator** aSelfPtr );
|
|
129 |
|
|
130 |
private: // Implementation
|
|
131 |
CPbk2AddressSelect(
|
|
132 |
TPbk2AddressSelectParams& aParams,
|
|
133 |
const TArray<MVPbkStoreContact*>* aStoreContactsArray,
|
|
134 |
const TArray<CPbk2PresenceIconInfo*>* aPresenceIconsArray );
|
|
135 |
void ConstructL(
|
|
136 |
CVPbkFieldTypeSelector* aFieldTypeSelector );
|
|
137 |
TBool AddressField(
|
|
138 |
const MVPbkStoreContactField& aField ) const;
|
|
139 |
void NoAddressesL(
|
|
140 |
TPbk2AddressSelectParams aParams ) const;
|
|
141 |
void SelectFieldL();
|
|
142 |
void SelectFromApplicableFieldsL();
|
|
143 |
TInt IndexOfDefaultFieldL();
|
|
144 |
TBool SelectFromDefaultFieldsL();
|
|
145 |
MVPbkStoreContactField* FindDefaultFieldLC();
|
|
146 |
void SetSelectedFieldL(
|
|
147 |
const MVPbkStoreContactField* aField );
|
|
148 |
HBufC* LoadDialogTitleL();
|
|
149 |
HBufC* GetVoiceAndVOIPCallDialogTitleL();
|
|
150 |
TBool IsVoiceCallExistL();
|
|
151 |
TBool AreGeoFieldsForAddressesL();
|
|
152 |
HBufC* GetVOIPDialogTitleL();
|
|
153 |
|
|
154 |
private: // Friends
|
|
155 |
/// Field selection dialog for this class
|
|
156 |
class CSelectFieldDlg;
|
|
157 |
friend class CSelectFieldDlg;
|
|
158 |
|
|
159 |
private: // Data
|
|
160 |
/// Ref: Address select parameters
|
|
161 |
TPbk2AddressSelectParams& iParams;
|
|
162 |
/// Own: Field type selector
|
|
163 |
CVPbkFieldTypeSelector* iFieldTypeSelector;
|
|
164 |
/// Own: Field filter
|
|
165 |
CVPbkFieldFilter* iFieldFilter;
|
|
166 |
/// Own: Field selection dialog
|
|
167 |
CPbk2SelectFieldDlg* iFieldDlg;
|
|
168 |
/// Ref: Set to ETrue when the execution enters destructor
|
|
169 |
TBool* iDestroyedPtr;
|
|
170 |
/// Ref: The selected field
|
|
171 |
MVPbkStoreContactField* iSelectedField;
|
|
172 |
/// Ref: Virtual Phonebook attribute manager
|
|
173 |
MVPbkContactAttributeManager* iAttributeManager;
|
|
174 |
/// Own: No addresses for a name prompt text resource id
|
|
175 |
TInt iNoAddressesForNamePromptResource;
|
|
176 |
/// Own: No address prompt text resource id
|
|
177 |
TInt iNoAddressesPromptResource;
|
|
178 |
/// Own: Soft key resource id
|
|
179 |
TInt iSoftKeyResource;
|
|
180 |
/// Ref: Set to NULL when the execution enters destructor
|
|
181 |
MPbk2DialogEliminator** iSelfPtr;
|
|
182 |
/// Ref: Additional contacts
|
|
183 |
const TArray<MVPbkStoreContact*>* iStoreContactsArray;
|
|
184 |
/// Own: Field filter array for additional contacts
|
|
185 |
RPointerArray<CVPbkFieldFilter> iFieldFilterArray;
|
|
186 |
/// Ref: Presence icons array
|
|
187 |
const TArray<CPbk2PresenceIconInfo*>* iPresenceIconsArray;
|
|
188 |
};
|
|
189 |
|
|
190 |
#endif // CPBK2ADDRESSSELECT_H
|
|
191 |
|
|
192 |
// End of File
|