williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description:
|
williamr@4
|
15 |
* Field type selection dialog for Phonebook's Create New / Edit Memory entry
|
williamr@4
|
16 |
* functions.
|
williamr@4
|
17 |
*
|
williamr@4
|
18 |
*/
|
williamr@4
|
19 |
|
williamr@4
|
20 |
|
williamr@4
|
21 |
#ifndef __CPbkMemoryEntryAddItemDlg_H__
|
williamr@4
|
22 |
#define __CPbkMemoryEntryAddItemDlg_H__
|
williamr@4
|
23 |
|
williamr@4
|
24 |
// INCLUDES
|
williamr@4
|
25 |
#include <e32base.h>
|
williamr@4
|
26 |
|
williamr@4
|
27 |
// FORWARD DECLARATIONS
|
williamr@4
|
28 |
class CPbkFieldInfo;
|
williamr@4
|
29 |
class CEikFormattedCellListBox;
|
williamr@4
|
30 |
class CAknPopupList;
|
williamr@4
|
31 |
|
williamr@4
|
32 |
// CLASS DECLARATION
|
williamr@4
|
33 |
|
williamr@4
|
34 |
/**
|
williamr@4
|
35 |
* Field type selection dialog for Phonebook's Create New- and Edit Memory
|
williamr@4
|
36 |
* entry-functions.
|
williamr@4
|
37 |
* Also used externally for Create New Entry- and Add to Existing
|
williamr@4
|
38 |
* Entry-services.
|
williamr@4
|
39 |
*/
|
williamr@4
|
40 |
class CPbkMemoryEntryAddItemDlg : public CBase
|
williamr@4
|
41 |
{
|
williamr@4
|
42 |
public: // Interface
|
williamr@4
|
43 |
/**
|
williamr@4
|
44 |
* Constructor.
|
williamr@4
|
45 |
*/
|
williamr@4
|
46 |
IMPORT_C CPbkMemoryEntryAddItemDlg();
|
williamr@4
|
47 |
|
williamr@4
|
48 |
/**
|
williamr@4
|
49 |
* Sets *aSelfPtr to NULL when this dialog is destroyed.
|
williamr@4
|
50 |
* @precond !aSelfPtr || *aSelfPtr==this
|
williamr@4
|
51 |
*/
|
williamr@4
|
52 |
IMPORT_C void ResetWhenDestroyed(CPbkMemoryEntryAddItemDlg** aSelfPtr);
|
williamr@4
|
53 |
|
williamr@4
|
54 |
/**
|
williamr@4
|
55 |
* Run the dialog and return selected field info.
|
williamr@4
|
56 |
*
|
williamr@4
|
57 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
58 |
* @param aCbaResource Cba buttons to use with the dialog.
|
williamr@4
|
59 |
* @return Pointer to a field info in aFieldInfos or NULL if canceled.
|
williamr@4
|
60 |
*/
|
williamr@4
|
61 |
IMPORT_C CPbkFieldInfo* ExecuteLD
|
williamr@4
|
62 |
(CArrayPtrFlat<CPbkFieldInfo>& aFieldInfos, TInt aCbaResource);
|
williamr@4
|
63 |
|
williamr@4
|
64 |
/**
|
williamr@4
|
65 |
* Run the dialog and return selected field info.
|
williamr@4
|
66 |
*
|
williamr@4
|
67 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
68 |
* @param aCbaResource Cba buttons to use with the dialog.
|
williamr@4
|
69 |
* @param aTitleText Text to put into popup list's title. No title
|
williamr@4
|
70 |
* pane if aTitleText is empty.
|
williamr@4
|
71 |
* @return Pointer to a field info in aFieldInfos or NULL if canceled.
|
williamr@4
|
72 |
*/
|
williamr@4
|
73 |
IMPORT_C CPbkFieldInfo* ExecuteLD
|
williamr@4
|
74 |
(CArrayPtr<CPbkFieldInfo>& aFieldInfos,
|
williamr@4
|
75 |
TInt aCbaResource,
|
williamr@4
|
76 |
const TDesC& aTitleText);
|
williamr@4
|
77 |
|
williamr@4
|
78 |
/**
|
williamr@4
|
79 |
* Basic ExecuteLD for derived classes to override.
|
williamr@4
|
80 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
81 |
*/
|
williamr@4
|
82 |
IMPORT_C virtual CPbkFieldInfo* ExecuteLD
|
williamr@4
|
83 |
(CArrayPtr<CPbkFieldInfo>& aFieldInfos);
|
williamr@4
|
84 |
|
williamr@4
|
85 |
/**
|
williamr@4
|
86 |
* Destructor.
|
williamr@4
|
87 |
* Also cancels and dismisses this popup list, in other words makes
|
williamr@4
|
88 |
* ExecuteLD return just like cancel was pressed.
|
williamr@4
|
89 |
*/
|
williamr@4
|
90 |
IMPORT_C ~CPbkMemoryEntryAddItemDlg();
|
williamr@4
|
91 |
|
williamr@4
|
92 |
public: // internal implementation
|
williamr@4
|
93 |
/**
|
williamr@4
|
94 |
* @internal
|
williamr@4
|
95 |
* Sorts the field info objects according to Phonebook specific rules.
|
williamr@4
|
96 |
*/
|
williamr@4
|
97 |
void SortFieldInfoArray();
|
williamr@4
|
98 |
|
williamr@4
|
99 |
protected: // Interface for derived classes
|
williamr@4
|
100 |
/**
|
williamr@4
|
101 |
* Creates list items, sets Cba and title.
|
williamr@4
|
102 |
* Executed before RunLD.
|
williamr@4
|
103 |
* First part of ExecuteLD.
|
williamr@4
|
104 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
105 |
* @param aCbaResource Cba buttons to use with the dialog
|
williamr@4
|
106 |
* @param aTitle Text to put into popup list's title
|
williamr@4
|
107 |
*/
|
williamr@4
|
108 |
void PrepareLC(CArrayPtr<CPbkFieldInfo>& aFieldInfos,
|
williamr@4
|
109 |
TInt aCbaResource, const TDesC& aTitle);
|
williamr@4
|
110 |
|
williamr@4
|
111 |
/**
|
williamr@4
|
112 |
* Execute the initialized dialog.
|
williamr@4
|
113 |
* Second part of ExecuteLD.
|
williamr@4
|
114 |
* @return Pointer to a field info
|
williamr@4
|
115 |
*/
|
williamr@4
|
116 |
CPbkFieldInfo* RunLD();
|
williamr@4
|
117 |
|
williamr@4
|
118 |
private: // Spare virtual functions
|
williamr@4
|
119 |
IMPORT_C virtual void Reserved_1();
|
williamr@4
|
120 |
IMPORT_C virtual void Reserved_2();
|
williamr@4
|
121 |
|
williamr@4
|
122 |
private: // Data types
|
williamr@4
|
123 |
class CListBoxModel;
|
williamr@4
|
124 |
|
williamr@4
|
125 |
private: // Data members
|
williamr@4
|
126 |
/// Own: list box.
|
williamr@4
|
127 |
CEikFormattedCellListBox* iListBox;
|
williamr@4
|
128 |
/// Own: popup listbox.
|
williamr@4
|
129 |
CAknPopupList* iPopupList;
|
williamr@4
|
130 |
/// Ref: Referred boolean is set to ETrue when this object is destroyed.
|
williamr@4
|
131 |
TBool* iDestroyedPtr;
|
williamr@4
|
132 |
/// Ref: set to NULL from destructor
|
williamr@4
|
133 |
CPbkMemoryEntryAddItemDlg** iSelfPtr;
|
williamr@4
|
134 |
// Own: Sort Field Infos
|
williamr@4
|
135 |
TBool iSortFieldInfos;
|
williamr@4
|
136 |
};
|
williamr@4
|
137 |
|
williamr@4
|
138 |
|
williamr@4
|
139 |
/**
|
williamr@4
|
140 |
* Field type selection dialog for Phonebook's Create New service.
|
williamr@4
|
141 |
* This service can be used to show a popup dialog of Phonebook field
|
williamr@4
|
142 |
* types and then let the user select a particular field type from it.
|
williamr@4
|
143 |
*/
|
williamr@4
|
144 |
class CPbkItemTypeSelectCreateNew : public CPbkMemoryEntryAddItemDlg
|
williamr@4
|
145 |
{
|
williamr@4
|
146 |
public: // Interface
|
williamr@4
|
147 |
/**
|
williamr@4
|
148 |
* Constructor.
|
williamr@4
|
149 |
*/
|
williamr@4
|
150 |
IMPORT_C CPbkItemTypeSelectCreateNew();
|
williamr@4
|
151 |
|
williamr@4
|
152 |
/**
|
williamr@4
|
153 |
* Destructor.
|
williamr@4
|
154 |
* Also cancels and dismisses this popup list, in other words makes
|
williamr@4
|
155 |
* ExecuteLD return just like cancel was pressed.
|
williamr@4
|
156 |
*/
|
williamr@4
|
157 |
IMPORT_C ~CPbkItemTypeSelectCreateNew();
|
williamr@4
|
158 |
|
williamr@4
|
159 |
public: // from CPbkMemoryEntryAddItemDlg
|
williamr@4
|
160 |
/**
|
williamr@4
|
161 |
* Runs this dialog and returns the selected field info.
|
williamr@4
|
162 |
*
|
williamr@4
|
163 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
164 |
* @return Pointer to a field info in aFieldInfos or NULL if canceled.
|
williamr@4
|
165 |
*/
|
williamr@4
|
166 |
IMPORT_C CPbkFieldInfo* ExecuteLD(CArrayPtr<CPbkFieldInfo>& aFieldInfos);
|
williamr@4
|
167 |
|
williamr@4
|
168 |
private: // Data
|
williamr@4
|
169 |
/// Own: popup list title text
|
williamr@4
|
170 |
HBufC* iTitleBuf;
|
williamr@4
|
171 |
// Spare data
|
williamr@4
|
172 |
TInt32 iSpare1;
|
williamr@4
|
173 |
};
|
williamr@4
|
174 |
|
williamr@4
|
175 |
|
williamr@4
|
176 |
/**
|
williamr@4
|
177 |
* Field type selection dialog for Phonebook's Add to Existing-service.
|
williamr@4
|
178 |
* This service can be used to show a popup dialog of Phonebook field
|
williamr@4
|
179 |
* types and then let the user select a particular field type from it.
|
williamr@4
|
180 |
*/
|
williamr@4
|
181 |
class CPbkItemTypeSelectAddToExisting : public CPbkMemoryEntryAddItemDlg
|
williamr@4
|
182 |
{
|
williamr@4
|
183 |
public: // Interface
|
williamr@4
|
184 |
/**
|
williamr@4
|
185 |
* Constructor.
|
williamr@4
|
186 |
*/
|
williamr@4
|
187 |
IMPORT_C CPbkItemTypeSelectAddToExisting();
|
williamr@4
|
188 |
|
williamr@4
|
189 |
/**
|
williamr@4
|
190 |
* Destructor.
|
williamr@4
|
191 |
* Also cancels and dismisses this popup list, in other words makes
|
williamr@4
|
192 |
* ExecuteLD return just like cancel was pressed.
|
williamr@4
|
193 |
*/
|
williamr@4
|
194 |
IMPORT_C ~CPbkItemTypeSelectAddToExisting();
|
williamr@4
|
195 |
|
williamr@4
|
196 |
public: // from CPbkMemoryEntryAddItemDlg
|
williamr@4
|
197 |
/**
|
williamr@4
|
198 |
* Run this dialog and return selected field info.
|
williamr@4
|
199 |
*
|
williamr@4
|
200 |
* @param aFieldInfos An array of field info objects to select from.
|
williamr@4
|
201 |
* @return Pointer to a field info in aFieldInfos or NULL if canceled.
|
williamr@4
|
202 |
*/
|
williamr@4
|
203 |
IMPORT_C CPbkFieldInfo* ExecuteLD(CArrayPtr<CPbkFieldInfo>& aFieldInfos);
|
williamr@4
|
204 |
|
williamr@4
|
205 |
private: // Data
|
williamr@4
|
206 |
/// Own: popup list title text
|
williamr@4
|
207 |
HBufC* iTitleBuf;
|
williamr@4
|
208 |
// Spare data
|
williamr@4
|
209 |
TInt32 iSpare1;
|
williamr@4
|
210 |
};
|
williamr@4
|
211 |
|
williamr@4
|
212 |
#endif // __CPbkMemoryEntryAddItemDlg_H__
|
williamr@4
|
213 |
|
williamr@4
|
214 |
// End of File
|