|
1 /* |
|
2 * Copyright (c) 2009 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: Class to deserialize client query cliteria |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MDSQUERYCRITERIADESERIALIZATION_H__ |
|
19 #define __MDSQUERYCRITERIADESERIALIZATION_H__ |
|
20 |
|
21 #include <e32cmn.h> |
|
22 #include <e32def.h> |
|
23 #include <e32des8.h> |
|
24 |
|
25 #include "mdccommon.h" |
|
26 #include "mdcserializationbuffer.h" |
|
27 // added for serialization definitions !! |
|
28 #include "mdscommoninternal.h" |
|
29 // end |
|
30 |
|
31 /** |
|
32 * Query criteria serialization. |
|
33 */ |
|
34 class CMdSQueryCriteriaDeserialization : public CBase |
|
35 { |
|
36 friend class CMdSFindSqlClause; |
|
37 |
|
38 public: |
|
39 |
|
40 /* Constructors and destructor. */ |
|
41 |
|
42 /** |
|
43 * Constructs a new serialized query criteria. |
|
44 * @param aCondition root logic condition to serialize |
|
45 * |
|
46 * @return query criteria serialization instance |
|
47 * |
|
48 * @leave KErrNotSupported result mode and query type don't match |
|
49 * @leave KErrCompletion result mode is EModeDistinctValues and query |
|
50 * criteria is incorrect |
|
51 */ |
|
52 static CMdSQueryCriteriaDeserialization* NewL(CMdCSerializationBuffer& aSerializationBuffer); |
|
53 |
|
54 /** |
|
55 * Constructs a new serialized query criteria and leaves it in the |
|
56 * cleanup stack. |
|
57 * @param aCondition root logic condition to serialize |
|
58 * |
|
59 * @return query criteria serialization instance |
|
60 * |
|
61 * @leave KErrNotSupported result mode and query type don't match |
|
62 * @leave KErrCompletion result mode is EModeDistinctValues and query |
|
63 * criteria is incorrect |
|
64 */ |
|
65 static CMdSQueryCriteriaDeserialization* NewLC(CMdCSerializationBuffer& aSerializationBuffer); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~CMdSQueryCriteriaDeserialization(); |
|
71 |
|
72 /** |
|
73 * Returns pointer to the serialized data (read only) |
|
74 */ |
|
75 TPtr8 Buffer() const; |
|
76 |
|
77 /** |
|
78 * Returns pointer to the serialized data (read only) |
|
79 */ |
|
80 const TPtr8* BufferPtr() const; |
|
81 |
|
82 /** |
|
83 * Returns pointer to the serialization buffer |
|
84 */ |
|
85 CMdCSerializationBuffer& SerializationBuffer(); |
|
86 |
|
87 protected: |
|
88 |
|
89 /** |
|
90 * Returns query's result mode. |
|
91 * |
|
92 * @return query result mode |
|
93 */ |
|
94 TQueryResultMode ResultModeL(); |
|
95 |
|
96 /** |
|
97 * Returns query's type. |
|
98 * |
|
99 * @return query type |
|
100 */ |
|
101 TQueryType QueryTypeL(); |
|
102 |
|
103 /** |
|
104 * Returns query's namespace definition ID. |
|
105 * |
|
106 * @return namespace definition ID |
|
107 */ |
|
108 TDefId NamespaceDefIdL(); |
|
109 |
|
110 /** |
|
111 * Returns query's object definition ID. |
|
112 * |
|
113 * @return object definition ID |
|
114 */ |
|
115 TDefId ObjectDefIdL(); |
|
116 |
|
117 /** |
|
118 * Moves position to begin of query's object definitions IDs. |
|
119 * |
|
120 * @return if offset is KNoOffset return EFalse, else return ETrue and move |
|
121 * to that position |
|
122 */ |
|
123 TBool ObjectDefsIdsL(); |
|
124 |
|
125 /** |
|
126 * Returns query's result's limit value. |
|
127 * |
|
128 * @return limit value |
|
129 */ |
|
130 TUint32 LimitL(); |
|
131 |
|
132 /** |
|
133 * Returns query's internal optimization flags. |
|
134 * |
|
135 * @return query's internal optimization flags |
|
136 */ |
|
137 TUint32 OptimizationFlagsL(); |
|
138 |
|
139 /** |
|
140 * Returns query's result's offset value. |
|
141 * |
|
142 * @return offset value |
|
143 */ |
|
144 TUint32 OffsetL(); |
|
145 |
|
146 /** |
|
147 * Moves position to begin of query's root condition. |
|
148 */ |
|
149 void RootConditionL(); |
|
150 |
|
151 /** |
|
152 * Moves position to begin of query's order rules. |
|
153 */ |
|
154 void OrderRulesL(); |
|
155 |
|
156 /** |
|
157 * Moves position to begin of query's property filter. |
|
158 */ |
|
159 void PropertyFiltersL(); |
|
160 |
|
161 private: |
|
162 |
|
163 /* Constructors. */ |
|
164 |
|
165 /** |
|
166 * Constructor. |
|
167 */ |
|
168 CMdSQueryCriteriaDeserialization(CMdCSerializationBuffer& aSerializedBuffer); |
|
169 |
|
170 private: |
|
171 |
|
172 /** Serialized query criteria. */ |
|
173 CMdCSerializationBuffer& iSerializedBuffer; |
|
174 }; |
|
175 |
|
176 |
|
177 #endif // __MDEQUERYCRITERIASERIALIZATION_H__ |