|
1 /* |
|
2 * Copyright (c) 2007-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_HNCOMPLEXCONDITION_H |
|
21 #define C_HNCOMPLEXCONDITION_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32hashtab.h> |
|
25 #include <xmlengelement.h> |
|
26 |
|
27 #include "hnconditioninterface.h" |
|
28 |
|
29 class CLiwGenericParamList; |
|
30 |
|
31 /** |
|
32 * Complex condition. |
|
33 * |
|
34 * This class is designed to support complex conditions in the xml configuration. |
|
35 * |
|
36 * @lib hnmetadatamodel |
|
37 * @since S60 v3.2 |
|
38 * @ingroup group_hnmetadatamodel |
|
39 */ |
|
40 NONSHARABLE_CLASS(CHnComplexCondition) : public CHnConditionInterface |
|
41 { |
|
42 public: |
|
43 |
|
44 |
|
45 /** |
|
46 * Standard factory function. |
|
47 * |
|
48 * @param aElement Xml element. |
|
49 * @return Fully constructed object. |
|
50 */ |
|
51 static CHnComplexCondition* NewL( TDesC8 & aElement ); |
|
52 |
|
53 /** |
|
54 * Standard C++ Destructor |
|
55 */ |
|
56 ~CHnComplexCondition(); |
|
57 |
|
58 /** |
|
59 * Returns result. |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 * @param aQueryResults Results of query. |
|
63 * @param aPos Position in the list. |
|
64 * @return True if condition of true, otherwise false. |
|
65 */ |
|
66 TBool ResultL( const CLiwGenericParamList& aQueryResults, TInt aPos ); |
|
67 |
|
68 protected: |
|
69 |
|
70 /** |
|
71 * Standard C++ Constructor |
|
72 */ |
|
73 CHnComplexCondition(); |
|
74 |
|
75 /** |
|
76 * Standard symbian second phase constructor. |
|
77 * |
|
78 * @param aElement Xml element. |
|
79 */ |
|
80 void ConstructL( TDesC8 & aElement ); |
|
81 |
|
82 /** |
|
83 * Prepares the condition for processng. |
|
84 * Removes excessive white characters and |
|
85 * superfluous parentheses |
|
86 * |
|
87 * @param aConditionString Condition string. |
|
88 */ |
|
89 TBool CheckForOrOnTheSameLevelL( TDesC8 & aConditionString ); |
|
90 |
|
91 protected: // data |
|
92 |
|
93 /** |
|
94 * Logical operation between conditions. |
|
95 */ |
|
96 TOperator iOperation; |
|
97 |
|
98 /** |
|
99 * Own - left side of the condition. |
|
100 */ |
|
101 CHnConditionInterface* iLeftCondition; |
|
102 |
|
103 /** |
|
104 * Own - right side of the condition. |
|
105 */ |
|
106 CHnConditionInterface* iRightCondition; |
|
107 |
|
108 }; |
|
109 |
|
110 #endif // C_HNCOMPLEXCONDITION_H |
|
111 |