1 /* |
|
2 * Copyright (c) 2005-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: Property conditions for boolean property values |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MDEBOOLPROPERTYCONDITION_H__ |
|
20 #define __MDEBOOLPROPERTYCONDITION_H__ |
|
21 |
|
22 |
|
23 #include <mdepropertycondition.h> |
|
24 |
|
25 /* Forward declarations. */ |
|
26 class CMdEPropertyDef; |
|
27 class CMdCSerializationBuffer; |
|
28 |
|
29 /** |
|
30 * Property conditions for boolean property values. The condition is true |
|
31 * when the property's value matches the condition's boolean value. |
|
32 */ |
|
33 NONSHARABLE_CLASS(CMdEBoolPropertyCondition) : public CMdEPropertyCondition |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * First-phase constructor |
|
39 */ |
|
40 static CMdEBoolPropertyCondition* NewL( const CMdEPropertyDef& aPropertyDef, |
|
41 TBool aValue ); |
|
42 |
|
43 /** |
|
44 * First-phase constructor |
|
45 */ |
|
46 static CMdEBoolPropertyCondition* NewLC( const CMdEPropertyDef& aPropertyDef, |
|
47 TBool aValue ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CMdEBoolPropertyCondition(); |
|
53 |
|
54 |
|
55 /* Methods. */ |
|
56 |
|
57 /** |
|
58 * Returns the boolean condition value. |
|
59 */ |
|
60 IMPORT_C TBool Value() const; |
|
61 |
|
62 /** |
|
63 * Get possible query's internal optimization flags from condition. |
|
64 * |
|
65 * @param aFlaga query's internal optimization flags |
|
66 * @return last level internal optimization flags |
|
67 */ |
|
68 TUint32 InternalQueryOptimizationFlags(TUint32& aFlags); |
|
69 |
|
70 /** |
|
71 * Get required size of serialized buffer when this is serialized. |
|
72 * |
|
73 * @return required size of serialized buffer |
|
74 */ |
|
75 TUint32 RequiredBufferSize() const; |
|
76 |
|
77 /** |
|
78 * Serialize own data to serialized buffer (correct position must be set |
|
79 * before calling) and return new position of serialized buffer. |
|
80 * |
|
81 * @param aBuffer serialized buffer. |
|
82 */ |
|
83 void SerializeL(CMdCSerializationBuffer& aBuffer, |
|
84 TMdCOffset& aFreespaceOffset) const; |
|
85 |
|
86 private: |
|
87 /** |
|
88 * Constructor. |
|
89 * |
|
90 * @param aValue boolean value |
|
91 */ |
|
92 CMdEBoolPropertyCondition(const CMdEPropertyDef& aPropertyDef, |
|
93 TBool aValue); |
|
94 |
|
95 /** |
|
96 * Second-phase constructor. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 private: |
|
101 |
|
102 /** The boolean value to compare against. */ |
|
103 TBool iValue; |
|
104 }; |
|
105 |
|
106 #endif // __MDEBOOLPROPERTYCONDITION_H__ |
|