1 /* |
|
2 * Copyright (c) 2008 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: Definition for multiselection setting class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MSRULEMULTISELECTIONSETTING |
|
20 #define C_MSRULEMULTISELECTIONSETTING |
|
21 |
|
22 // INCLUDES |
|
23 #include "mssettingitems.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CSelectionItemList; |
|
27 class CCmSqlPropertyContainer; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * CMSRuleMultiSelectionSetting class. This class is used when |
|
33 * server list is modified |
|
34 * |
|
35 * @Since S60 5.1 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CMSRuleMultiselectionSetting ): public CMSTextSettingItem |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * |
|
44 * @since S60 5.1 |
|
45 * @param aIdentifier, resource identifier |
|
46 * @param aFirstPopupItemResource, first list item text resource id |
|
47 * @param aAnyItemTextRestource, 'any' item text resource |
|
48 * @param aMetadataArray, metadata list |
|
49 * @param aArray, selection list |
|
50 * @param aItemTextResource, item text resource when multiple |
|
51 * items selected |
|
52 * @param aText, dummy parameter - needed in item creation |
|
53 * @return None |
|
54 */ |
|
55 static CMSRuleMultiselectionSetting* NewL( TInt aIdentifier, |
|
56 TInt aTitleResource, |
|
57 TInt aFirstPopupItemResource, |
|
58 TInt aAnyItemTextResource, |
|
59 CCmSqlPropertyContainer* aMetadataArray, |
|
60 RArray<TInt>* aArray, |
|
61 TInt aItemTextResource, |
|
62 TDes& aText); |
|
63 |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 * |
|
67 * @since S60 5.1 |
|
68 * @param aIdentifier, resource identifier |
|
69 * @param aFirstPopupItemResource, first list item text resource id |
|
70 * @param aAnyItemTextRestource, 'any' item text resource |
|
71 * @param aMetadataArray, metadata list |
|
72 * @param aArray, selection list |
|
73 * @param aItemTextResource, item text resource when multiple |
|
74 * items selected |
|
75 * @param aText, dummy parameter - needed in item creation |
|
76 * @return None |
|
77 */ |
|
78 static CMSRuleMultiselectionSetting* NewLC( TInt aIdentifier, |
|
79 TInt aTitleResource, |
|
80 TInt aFirstPopupItemResource, |
|
81 TInt aAnyItemTextResource, |
|
82 CCmSqlPropertyContainer* aMetadataArray, |
|
83 RArray<TInt>* aArray, |
|
84 TInt aItemTextResource, |
|
85 TDes& aText); |
|
86 |
|
87 /** |
|
88 * Destructor. |
|
89 */ |
|
90 virtual ~CMSRuleMultiselectionSetting(); |
|
91 |
|
92 /** |
|
93 * Creates item list and updates listbox text |
|
94 */ |
|
95 void CreateItemListL(); |
|
96 |
|
97 protected: |
|
98 |
|
99 // From base class CAknSettingItem |
|
100 |
|
101 /** |
|
102 * From CAknSettingItem |
|
103 * See base class definition |
|
104 */ |
|
105 void EditItemL( TBool aCalledFromMenu ); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * Creates selection list for setting page |
|
111 * |
|
112 * @since S60 5.1 |
|
113 * @param None |
|
114 * @return None |
|
115 */ |
|
116 void CreateSelectionItemListL(); |
|
117 |
|
118 /** |
|
119 * Appends selected items to the list |
|
120 * |
|
121 * @since S60 5.1 |
|
122 * @param None |
|
123 * @return None |
|
124 */ |
|
125 void AppendSelectedItemsToListL(); |
|
126 |
|
127 /** |
|
128 * Sets setting item text |
|
129 * |
|
130 * @since S60 5.1 |
|
131 * @param None |
|
132 * @return None |
|
133 */ |
|
134 virtual void SetSettingItemTextL(); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Performs the first phase of two phase construction. |
|
140 * |
|
141 * @since S60 5.1 |
|
142 * @param aIdentifier, resource identifier |
|
143 * @param aFirstPopupItemResource, first list item text resource id |
|
144 * @param aAnyItemTextRestource, 'any' item text resource |
|
145 * @param aMetadataArray, metadata list |
|
146 * @param aArray, selection list |
|
147 * @param aItemTextResource, item text resource when multiple |
|
148 * items selected |
|
149 * @param aText, dummy parameter - needed in item creation |
|
150 * @return None |
|
151 */ |
|
152 CMSRuleMultiselectionSetting( |
|
153 TInt aIdentifier, |
|
154 TInt aTitleResource, |
|
155 TInt aFirstPopupItemResource, |
|
156 TInt aAnyItemTextResource, |
|
157 CCmSqlPropertyContainer* aMetadataArray, |
|
158 RArray<TInt>* aArray, |
|
159 TInt aItemTextResource, |
|
160 TDes& aText |
|
161 ); |
|
162 |
|
163 /** |
|
164 * Performs the second phase construction. |
|
165 */ |
|
166 void ConstructL(); |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * selected item count |
|
172 */ |
|
173 TInt iSelectedItemCount; |
|
174 /** |
|
175 * item text resource |
|
176 */ |
|
177 TInt iItemTextResource; |
|
178 |
|
179 /** |
|
180 * setting item text |
|
181 */ |
|
182 TDesC& iText; |
|
183 /** |
|
184 * item array for selection dialog |
|
185 */ |
|
186 CSelectionItemList* iItemArray; // owned |
|
187 /** |
|
188 * Server name string (external set) |
|
189 */ |
|
190 HBufC16* iSettingText; // owned |
|
191 /** |
|
192 * list of selected items |
|
193 */ |
|
194 RArray<TInt>* iList; // not owned |
|
195 /** |
|
196 * array of metadata items |
|
197 */ |
|
198 CCmSqlPropertyContainer* iMetadataArray; // not owned |
|
199 /** |
|
200 * title resource for multiselection dialog |
|
201 */ |
|
202 TInt iTitleResource; |
|
203 /** |
|
204 * first item resource for multiselection dialog |
|
205 */ |
|
206 TInt iFirstPopupItemResource; |
|
207 /** |
|
208 * secondary text resource |
|
209 */ |
|
210 TInt iAnyItemTextResource; |
|
211 /** |
|
212 * Last selected item index |
|
213 */ |
|
214 TInt iSelectedItemIndex; |
|
215 }; |
|
216 |
|
217 #endif // C_MSRULEMULTISELECTIONSETTING |
|
218 |
|
219 // End of File |
|