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: Represent property condition |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MDEPROPERTYCONDITION_H__ |
|
19 #define __MDEPROPERTYCONDITION_H__ |
|
20 |
|
21 #include <mdecondition.h> |
|
22 |
|
23 /* Forward declarations. */ |
|
24 class CMdEPropertyDef; |
|
25 class CMdCSerializationBuffer; |
|
26 |
|
27 /** |
|
28 * CMdEPropertyCondition is the base class for all property conditions. |
|
29 * Instances of CMdEPropertyCondition and its subclasses are always associated |
|
30 * with a property definition. |
|
31 */ |
|
32 NONSHARABLE_CLASS(CMdEPropertyCondition) : public CMdECondition |
|
33 { |
|
34 public: |
|
35 |
|
36 /* Types. */ |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CMdEPropertyCondition* NewL( const CMdEPropertyDef& aPropertyDef ); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CMdEPropertyCondition* NewLC( const CMdEPropertyDef& aPropertyDef ); |
|
47 |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CMdEPropertyCondition(); |
|
53 |
|
54 |
|
55 /* Methods. */ |
|
56 |
|
57 /** |
|
58 * Returns the property definition of the condition. |
|
59 * |
|
60 * @return Property definition. |
|
61 */ |
|
62 IMPORT_C const CMdEPropertyDef& PropertyDef() const; |
|
63 |
|
64 /** |
|
65 * Get possible query's internal optimization flags from condition. |
|
66 * |
|
67 * @param aFlaga query's internal optimization flags |
|
68 * @return last level internal optimization flags |
|
69 */ |
|
70 TUint32 InternalQueryOptimizationFlags(TUint32& aFlags); |
|
71 |
|
72 /** |
|
73 * Get required size of serialized buffer when this is serialized. |
|
74 * |
|
75 * @return required size of serialized buffer |
|
76 */ |
|
77 virtual TUint32 RequiredBufferSize() const; |
|
78 |
|
79 /** |
|
80 * Serialize own data to serialized buffer (correct position must be set |
|
81 * before calling) and return new position of serialized buffer. |
|
82 * |
|
83 * @param aBuffer serialized buffer. |
|
84 */ |
|
85 virtual void SerializeL(CMdCSerializationBuffer& aBuffer, |
|
86 TMdCOffset& aFreespaceOffset) const; |
|
87 |
|
88 protected: |
|
89 |
|
90 /** |
|
91 * Constructor for a condition that tests the existence of properties. |
|
92 * |
|
93 * @param aPropertDef Property definition. |
|
94 */ |
|
95 CMdEPropertyCondition(const CMdEPropertyDef& aPropertyDef); |
|
96 |
|
97 /** |
|
98 * Second-phase constructor. |
|
99 */ |
|
100 void ConstructL(); |
|
101 |
|
102 /** |
|
103 * Constructor that sets the condition type as well. |
|
104 * |
|
105 * @param aType Type of the condition node. |
|
106 */ |
|
107 CMdEPropertyCondition(TConditionType aConditionType, |
|
108 const CMdEPropertyDef& aPropertyDef); |
|
109 |
|
110 protected: |
|
111 |
|
112 /** The property this condition operates on. */ |
|
113 const CMdEPropertyDef& iPropertyDef; |
|
114 }; |
|
115 |
|
116 #endif // __MDEPROPERTYCONDITION_H__ |
|