|
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: This class is a handler for getlist operation. It manages fetching and |
|
15 * providing getlist information |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __MCSGETLISTHANDLER_H__ |
|
22 #define __MCSGETLISTHANDLER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32property.h> |
|
26 |
|
27 #include "mcsmenuitem.h" |
|
28 |
|
29 //Forward declatations |
|
30 class CMenuSrvEng; |
|
31 class CLiwGenericParamList; |
|
32 class CMenuFilter; |
|
33 class CLiwMap; |
|
34 |
|
35 /* |
|
36 * GetList Handler. |
|
37 * @lib mcsmenu.lib |
|
38 * @since S60 v5.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CMcsGetlistHandler ): public CBase |
|
41 { |
|
42 public: |
|
43 typedef TUint TBasicParameters; |
|
44 enum |
|
45 { |
|
46 EGetListRecursive = 1, |
|
47 EGetListFlat = 2, |
|
48 EGetListParentOnly = 4, |
|
49 EGetListIncludeParent = 8 |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Factory method. |
|
54 */ |
|
55 static CMcsGetlistHandler* NewL( CMenuSrvEng& aEng ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CMcsGetlistHandler(); |
|
61 |
|
62 /** |
|
63 * Do getlist operation. Stores serialized result in |
|
64 * iSerializedOutput descriptor |
|
65 * @param aSerializedInput serialized input parameters for getlist |
|
66 * @result size of serialized result descriptor |
|
67 */ |
|
68 TInt GetListSizeL( const TDesC8& aSerializedInput ); |
|
69 |
|
70 /* |
|
71 * Returns result of GetList operation |
|
72 * @return serialized output of GetList operation |
|
73 **/ |
|
74 TPtrC8 GetListDataL( ); |
|
75 |
|
76 /* |
|
77 * Destroys the output buffer. |
|
78 **/ |
|
79 void CloseOutputBuffer( ); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * Constructor. |
|
84 */ |
|
85 CMcsGetlistHandler( CMenuSrvEng& aEng ); |
|
86 |
|
87 /** |
|
88 * 2nd phase constructor |
|
89 */ |
|
90 void ConstructL(); |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * Fetches basic input parameters for GetList operation |
|
96 * @param aInputList input list for GetList |
|
97 * @param aFolderId to store folder id |
|
98 * @param aBasicParameters to store basic parameters |
|
99 */ |
|
100 void FetchBasicParametersL( const CLiwGenericParamList* aInputList, |
|
101 TInt& aFolderId, TBasicParameters& aBasicParameters ); |
|
102 |
|
103 /** |
|
104 * Fetches required and ignored attributes |
|
105 * @param aInputList input list for GetList |
|
106 * @param aRequiredAttributes to store required attributes |
|
107 * @param aIgnoredAttributes to store ignored attributes |
|
108 */ |
|
109 void FetchRequiredAndIgnoredAttributesL( |
|
110 const CLiwGenericParamList* aInputList, |
|
111 CDesC16Array* aRequiredAttributes, |
|
112 CDesC16Array* aIgnoredAttributes ); |
|
113 |
|
114 /** |
|
115 * Fetches filter |
|
116 * @param aInputList input list for GetList |
|
117 * @param aFilter to store filter |
|
118 */ |
|
119 TBool FetchFilterL( const CLiwGenericParamList* aInputList, |
|
120 CMenuFilter* aFilter ); |
|
121 |
|
122 /** |
|
123 * Fetches items ids |
|
124 * @param aItemArray items ids |
|
125 * @param aFolderId folder id |
|
126 * @param aFilter filter |
|
127 * @param aBasicParameters basic input parameters for getlist |
|
128 */ |
|
129 void FetchItemsIdsL( RArray<TMenuItem>& aItemArray, TInt aFolderId, |
|
130 CMenuFilter* aFilter, TBasicParameters& aBasicParameters ); |
|
131 |
|
132 /** |
|
133 * Gets attributes from descriptor |
|
134 * @param aList descriptor containing attributes |
|
135 * @param aArray array to store attributes |
|
136 */ |
|
137 void GetAttributesL( const TDesC& aList, CDesC16Array* aArray ); |
|
138 |
|
139 /** |
|
140 * Set flags in filter |
|
141 * @param inputMap Input map containint flags |
|
142 * @param aFilter filter |
|
143 */ |
|
144 void SetFlagsL( const CLiwMap* inputMap, CMenuFilter* aFilter ); |
|
145 |
|
146 /** |
|
147 * Set attribute string to input map |
|
148 * @param inputMap input map |
|
149 * @param aAttrName input attribute name |
|
150 * @param aFilter filter |
|
151 */ |
|
152 void SetAttributeDesL( const CLiwMap* inputMap, |
|
153 const TDesC& aAttrName, CMenuFilter* aFilter ); |
|
154 |
|
155 /** |
|
156 * Set attribute hex to input map |
|
157 * @param inputMap input map |
|
158 * @param aAttrName input attribute name |
|
159 * @param aFilter filter |
|
160 */ |
|
161 void SetAttributeHexFormatL( const CLiwMap* inputMap, |
|
162 const TDesC& aAttrName, CMenuFilter* aFilter ); |
|
163 |
|
164 /** |
|
165 * Set attribute num to input map |
|
166 * @param inputMap input map |
|
167 * @param aAttrName input attribute name |
|
168 * @param aFilter filter |
|
169 */ |
|
170 void SetAttributeNumL( const CLiwMap* inputMap, |
|
171 const TDesC& aAttrName, CMenuFilter* aFilter ); |
|
172 |
|
173 /** |
|
174 * Set attribute bool to input map |
|
175 * @param inputMap input map |
|
176 * @param aAttrName input attribute name |
|
177 * @param aFilter filter |
|
178 */ |
|
179 void SetAttributeBoolL( const CLiwMap* inputMap, |
|
180 const TDesC& aAttrName, CMenuFilter* aFilter ); |
|
181 |
|
182 |
|
183 private: |
|
184 /** |
|
185 * Engine. not own |
|
186 */ |
|
187 CMenuSrvEng& iEng ; |
|
188 |
|
189 /** |
|
190 * Buffer for serialized result.own |
|
191 */ |
|
192 RBuf8 iOutputBuffer; |
|
193 }; |
|
194 |
|
195 #endif // __MCSGETLISTHANDLER_H__ |