|
1 /* |
|
2 * Copyright (c) 2004-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: CCFIfClause class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFIFCLAUSE_H |
|
21 #define C_CFIFCLAUSE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 #include "cfclausenode.h" |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * This class implements IfClause XML node of CFW script in Script Engine |
|
32 * scripts. |
|
33 * |
|
34 * @lib CFScriptEngine |
|
35 * @since Series 60 2.6 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CCFIfClause ): public CCFClauseNode |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Creates a CCFIfClause object |
|
43 * @param aServices is the operation services interface for nodes. |
|
44 * @param aParent parent of this node or NULL if this is a root. The |
|
45 * ownership of the parent is not transferred. |
|
46 * @return a pointer to the created instance of CCFIfClause |
|
47 */ |
|
48 static CCFIfClause* NewL( MCFOperationServices& aServices, |
|
49 CCFOperationNode* aParent ); |
|
50 |
|
51 /** |
|
52 * Creates a CCFIfClause object |
|
53 * @param aServices is the operation services interface for nodes. |
|
54 * @param aParent parent of this node or NULL if this is a root. The |
|
55 * ownership of the parent is not transferred. |
|
56 * @return a pointer to the created instance of CCFIfClause |
|
57 */ |
|
58 static CCFIfClause* NewLC( MCFOperationServices& aServices, |
|
59 CCFOperationNode* aParent ); |
|
60 |
|
61 /** |
|
62 * Creates and parses a CCFIfClause instance from an xml node. |
|
63 * @param aServices is the operation services interface for nodes. |
|
64 * @param aParent is the parent of this node or NULL if this is a root. The |
|
65 * ownership of the parent is not transferred. |
|
66 * @param aNode is the node to be parsed. |
|
67 * @return a pointer to the created instance of CCFIfClause, or NULL if the |
|
68 * node is not if clause node. May leave with any system wide error code. |
|
69 */ |
|
70 static CCFIfClause* ParseL( MCFOperationServices& aServices, |
|
71 CCFOperationNode* aParent, |
|
72 CMDXMLNode& aNode ); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 */ |
|
77 ~CCFIfClause(); |
|
78 |
|
79 protected: // From CCFClauseNode |
|
80 |
|
81 /** |
|
82 * Fires actions of the node. |
|
83 * @return None. |
|
84 */ |
|
85 void FireActionsL(); |
|
86 |
|
87 protected: // From CCFOperationNode |
|
88 |
|
89 /** |
|
90 * Activates this node by passing the activate call to its' child. |
|
91 * @return None. |
|
92 */ |
|
93 void ActivateL(); |
|
94 |
|
95 /** |
|
96 * Deactivates this node by passing the deactivate call to its' child. |
|
97 * @return None. |
|
98 */ |
|
99 void Deactivate(); |
|
100 |
|
101 /** |
|
102 * Asks this node to check its security (via services interface). Checks |
|
103 * the security of contexts to be subscribed and actions to be performed. |
|
104 * @return KErrNone if security check passed, otherwise any of the system |
|
105 * wide error codes. |
|
106 */ |
|
107 TInt CheckSecurity(); |
|
108 |
|
109 /** |
|
110 * Called by child node, to ask the parent to re-evaluate its value, since |
|
111 * the child's value has changed. |
|
112 * @return None. |
|
113 */ |
|
114 void Evaluate(); |
|
115 |
|
116 /** |
|
117 * Cleanup long term resources like persistent data files. |
|
118 * This is called by the context framework when the script is uninstalled |
|
119 * from the system. |
|
120 */ |
|
121 void Cleanup(); |
|
122 |
|
123 private: |
|
124 |
|
125 /** |
|
126 * C++ default constructor. |
|
127 */ |
|
128 CCFIfClause( MCFOperationServices& aServices, CCFOperationNode* aParent ); |
|
129 |
|
130 /** |
|
131 * By default Symbian 2nd phase constructor is private. |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 private: // Data |
|
136 |
|
137 // Must have one "root" operation, a child. |
|
138 CCFOperationNode* iChild; |
|
139 |
|
140 // If clause actions. |
|
141 RPointerArray< CCFScriptAction > iActions; |
|
142 }; |
|
143 |
|
144 #endif // C_CFIFCLAUSE_H |