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: Interface for object query |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MDEOBJECTQUERY_H__ |
|
20 #define __MDEOBJECTQUERY_H__ |
|
21 |
|
22 |
|
23 #include <mdequery.h> |
|
24 |
|
25 /* Forward declarations. */ |
|
26 class CMdEObject; |
|
27 class CMdEObjectDef; |
|
28 class CMdEPropertyDef; |
|
29 class CMdEObjectDef; |
|
30 class CMdESession; |
|
31 |
|
32 /** |
|
33 * A query that fetches a set of objects from the metadata engine database. |
|
34 */ |
|
35 NONSHARABLE_CLASS(CMdEObjectQuery) : public CMdEQuery |
|
36 { |
|
37 public: |
|
38 |
|
39 /* Constructors and destructor. */ |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 virtual ~CMdEObjectQuery(); |
|
45 |
|
46 |
|
47 /* Methods. */ |
|
48 |
|
49 |
|
50 /** |
|
51 * Adds new propertyfilter. Propertyfilters determines which properties |
|
52 * are included in result. |
|
53 |
|
54 * @param aPropertyDef property definition of property which is wanted to |
|
55 be part of result. |
|
56 */ |
|
57 IMPORT_C void AddPropertyFilterL( const CMdEPropertyDef* aPropertyDef ); |
|
58 |
|
59 /** |
|
60 Clears propertyfilters. After call to this function all properties are |
|
61 returned unless call to <code>AddPropertyFilterL</code> is done. |
|
62 */ |
|
63 |
|
64 IMPORT_C void ResetPropertyFilter(); |
|
65 |
|
66 /** |
|
67 * Returns one of the result objects. |
|
68 * |
|
69 * @return The result object that was requested. The query retains |
|
70 * ownership of the returned object. |
|
71 */ |
|
72 IMPORT_C CMdEObject& Result(TInt aIndex) const; |
|
73 |
|
74 /** |
|
75 * Returns query's object definition. |
|
76 * |
|
77 * @return object definition. |
|
78 */ |
|
79 IMPORT_C CMdEObjectDef& ObjectDef() const; |
|
80 |
|
81 public: |
|
82 RPointerArray<CMdEPropertyDef>& PropertyFilter(); |
|
83 |
|
84 RPointerArray<CMdEObjectDef>* ObjectDefs() const; |
|
85 |
|
86 protected: |
|
87 |
|
88 /* Constructors. */ |
|
89 |
|
90 /** |
|
91 * Constuctor. |
|
92 * |
|
93 * @param aSession Session. |
|
94 */ |
|
95 CMdEObjectQuery(CMdESession& aSession, CMdENamespaceDef& aNamespaceDef, |
|
96 CMdEObjectDef& aObjectDef, RPointerArray<CMdEObjectDef>* aObjectDefs); |
|
97 |
|
98 /** |
|
99 * Second-phase constructor. |
|
100 */ |
|
101 void ObjectQueryConstructL(); |
|
102 |
|
103 virtual void DoCancel(); |
|
104 |
|
105 private: |
|
106 |
|
107 /* Private methods. */ |
|
108 |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * Properties to include when fetching results. Empty, if |
|
114 * all available properties should be fetched. |
|
115 */ |
|
116 RPointerArray<CMdEPropertyDef> iPropertyFilters; |
|
117 |
|
118 /** |
|
119 * Query's object definition. |
|
120 */ |
|
121 CMdEObjectDef& iObjectDef; |
|
122 |
|
123 /** |
|
124 * Query's object definition. |
|
125 */ |
|
126 RPointerArray<CMdEObjectDef>* iObjectDefs; |
|
127 |
|
128 /** |
|
129 * Speed optimization to drop freetexts from results. |
|
130 */ |
|
131 TBool iFreetextsInResult; |
|
132 }; |
|
133 |
|
134 #endif // __MDEOBJECTQUERY_H__ |
|