|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Policy evaluator |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_POLICYEVALUATOR_H |
|
20 #define C_POLICYEVALUATOR_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "aipolicyelement.h" |
|
25 |
|
26 class CXnNodeAppIf; |
|
27 |
|
28 namespace AiXmlUiController |
|
29 { |
|
30 |
|
31 |
|
32 /** |
|
33 * @ingroup group_xmluicontroller |
|
34 * |
|
35 * Policy evaluator class |
|
36 * |
|
37 * @lib AiXmlUiMain |
|
38 */ |
|
39 class CPolicyEvaluator : public CBase |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 static CPolicyEvaluator* NewL(); |
|
45 |
|
46 virtual ~CPolicyEvaluator(); |
|
47 |
|
48 /** |
|
49 * Evaluates content policy for ui element. |
|
50 * |
|
51 * @param aTarget target ui element |
|
52 * @param aPolicyArray array of found policies to fill |
|
53 * @leave |
|
54 */ |
|
55 void EvaluateContentPolicyL( CXnNodeAppIf& aTarget, |
|
56 RAiPolicyElementArray& aPolicyArray ); |
|
57 |
|
58 /** |
|
59 * Evaluates empty content policy for ui element. |
|
60 * |
|
61 * @param aTarget target ui element |
|
62 * @param aPolicyArray array of found policies to fill |
|
63 * @leave |
|
64 */ |
|
65 void EvaluateEmptyContentPolicyL( CXnNodeAppIf& aTarget, |
|
66 RAiPolicyElementArray& aPolicyArray ); |
|
67 |
|
68 /** |
|
69 * Evaluates Visiblity policy for ui element. |
|
70 * |
|
71 * @param aTarget target ui element |
|
72 * @param aResource resource element to publish |
|
73 * @param aPolicyArray array of found policies to fill |
|
74 * @leave |
|
75 */ |
|
76 void EvaluateVisibilityPolicyL( CXnNodeAppIf& aTarget, |
|
77 RAiPolicyElementArray& aPolicyArray ); |
|
78 |
|
79 /** |
|
80 * Evaluates ContentChanged policy for ui element. |
|
81 * |
|
82 * @param aTarget target ui element |
|
83 * @param aResource resource element to publish |
|
84 * @param aPolicyArray array of found policies to fill |
|
85 * @leave |
|
86 */ |
|
87 void EvaluateContentChangedPolicyL( CXnNodeAppIf& aTarget, |
|
88 RAiPolicyElementArray& aPolicyArray ); |
|
89 |
|
90 /** |
|
91 * Evaluates resource policy for ui element. |
|
92 * |
|
93 * @param aTarget target ui element |
|
94 * @param aResource resource element to publish |
|
95 * @param aPolicyArray array of found policies to fill |
|
96 * @leave |
|
97 */ |
|
98 void EvaluateResourcePolicyL( CXnNodeAppIf& aTarget, |
|
99 CXnNodeAppIf& aResource, |
|
100 RAiPolicyElementArray& aPolicyArray ); |
|
101 private: |
|
102 |
|
103 CPolicyEvaluator(); |
|
104 |
|
105 void ConstructL(); |
|
106 |
|
107 void EvaluatePolicyL( CXnNodeAppIf& aTarget, |
|
108 RAiPolicyElementArray& aPolicyArray, |
|
109 const TDesC8& aPolicyClass ); |
|
110 |
|
111 TBool MatchCondition( const TDesC8& aId, |
|
112 const TDesC8& aCondition ); |
|
113 |
|
114 TBool MatchVisibilityConditionL( const TDesC8& aCondition, |
|
115 CXnNodeAppIf& aProperty, |
|
116 RAiPolicyElementArray& aPolicyArray ); |
|
117 |
|
118 }; |
|
119 |
|
120 } // namespace AiXmlUiController |
|
121 |
|
122 #endif // C_POLICYEVALUATOR_H |