|
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: Class that defines logical AND operation in an XML tree. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFANDOPERATION_H |
|
21 #define C_CFANDOPERATION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "cfoperationnode.h" |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Concrete class for inner nodes. Represents a boolean AND operation. |
|
31 * |
|
32 * @lib CFScriptEngine |
|
33 * @since Series 60 2.6 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CCFAndOperation ): public CCFOperationNode |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @param aServices is the operation services interface for nodes. |
|
42 * @param aParent parent of this node or NULL if this is a root. |
|
43 */ |
|
44 static CCFAndOperation* NewL( MCFOperationServices& aServices, |
|
45 CCFOperationNode* aParent ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor that leaves the class into CleanupStack. |
|
49 * @param aServices is the operation services interface for nodes. |
|
50 * @param aParent parent of this node or NULL if this is a root. |
|
51 */ |
|
52 static CCFAndOperation* NewLC( MCFOperationServices& aServices, |
|
53 CCFOperationNode* aParent ); |
|
54 |
|
55 /** |
|
56 * Creates and parses a CCFAndOperation instance from an xml node. |
|
57 * @param aServices is the operation services interface for nodes. |
|
58 * @param aParent is the parent of this node or NULL if this is a root. |
|
59 * The ownership of the parent is not transferred. |
|
60 * @param aNode is the node to be parsed. |
|
61 * @return a pointer to the created instance of CCFAndOperation, or NULL |
|
62 * if the node is not this and node. May leave with any system wide |
|
63 * error code. |
|
64 */ |
|
65 static CCFAndOperation* ParseL( MCFOperationServices& aServices, |
|
66 CCFOperationNode* aParent, |
|
67 CMDXMLNode& aNode ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 ~CCFAndOperation(); |
|
73 |
|
74 protected: // Functions from CCFOperationNode |
|
75 |
|
76 /** |
|
77 * Activates this node by passing the activate call to its' children. |
|
78 */ |
|
79 void ActivateL(); |
|
80 |
|
81 /** |
|
82 * Deactivates this node by passing the deactivate call to its' children. |
|
83 */ |
|
84 void Deactivate(); |
|
85 |
|
86 /** |
|
87 * Asks this node to check its security (via services interface). For |
|
88 * example, the security of contexts to be subscribed. |
|
89 * @return KErrNone if security check passed, otherwise any of the system |
|
90 * wide error codes. |
|
91 */ |
|
92 TInt CheckSecurity(); |
|
93 |
|
94 /** |
|
95 * Evaluates the AND operation. |
|
96 */ |
|
97 void Evaluate(); |
|
98 |
|
99 /** |
|
100 * Cleanup long term resources like persistent data files. |
|
101 * This is called by the context framework when the script is uninstalled |
|
102 * from the system. |
|
103 */ |
|
104 void Cleanup(); |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * C++ default constructor. |
|
110 */ |
|
111 CCFAndOperation( MCFOperationServices& aServices, |
|
112 CCFOperationNode* aParent ); |
|
113 |
|
114 /** |
|
115 * By default Symbian 2nd phase constructor is private. |
|
116 */ |
|
117 void ConstructL(); |
|
118 |
|
119 private: // Data |
|
120 |
|
121 // Node children. |
|
122 RPointerArray< CCFOperationNode > iChildren; |
|
123 }; |
|
124 |
|
125 |
|
126 #endif // C_CFANDOPERATION_H |