|
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: CCFLess class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFLESS_H |
|
21 #define C_CFLESS_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include "cfcontextoperation.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CCFContextObject; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * This class implements Less -operation on Context Framework Scripts. |
|
36 * |
|
37 * @lib CFScriptEngine |
|
38 * @since Series 60 2.6 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CCFLess ): public CCFContextOperation |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Creates a CCFLess object |
|
46 * @param aServices is the operation services interface for nodes. |
|
47 * @param aParent parent of this node or NULL if this is a root. The |
|
48 * ownership of the parent is not transferred. |
|
49 * @param aName is name of the context object this operation operates on. |
|
50 * @param aSource is the source of the context object this operation |
|
51 * operates on. |
|
52 * @param aType is the interpretation of aCmpVal |
|
53 * @param aCmpVal is a string representation of the comparison value |
|
54 * @return a pointer to the created instance of CCFLess |
|
55 */ |
|
56 static CCFLess* NewL( MCFOperationServices& aServices, |
|
57 CCFOperationNode* aParent, |
|
58 TDesC& aName, |
|
59 TDesC& aSource, |
|
60 const CCFContextOperation::TCmpType aType, |
|
61 const TDesC& aCmpVal ); |
|
62 |
|
63 /** |
|
64 * Creates a CCFLess object |
|
65 * @param aServices is the operation services interface for nodes. |
|
66 * @param aParent parent of this node or NULL if this is a root. The |
|
67 * ownership of the parent is not transferred. |
|
68 * @param aName is name of the context object this operation operates on. |
|
69 * @param aSource is the source of the context object this operation |
|
70 * operates on. |
|
71 * @param aType is the interpretation of aCmpVal |
|
72 * @param aCmpVal is a string representation of the comparison value |
|
73 * @return a pointer to the created instance of CCFLess |
|
74 */ |
|
75 static CCFLess* NewLC( MCFOperationServices& aServices, |
|
76 CCFOperationNode* aParent, |
|
77 TDesC& aName, |
|
78 TDesC& aSource, |
|
79 const CCFContextOperation::TCmpType aType, |
|
80 const TDesC& aCmpVal ); |
|
81 |
|
82 /** |
|
83 * Creates and parses a CCFLess instance from an xml node. |
|
84 * @param aServices is the operation services interface for nodes. |
|
85 * @param aParent is the parent of this node or NULL if this is a root. |
|
86 * The ownership of the parent is not transferred. |
|
87 * @param aNode is the node to be parsed. |
|
88 * @return a pointer to the created instance of CCFLess, or NULL if the node |
|
89 * is not this less node. May leave with any system wide error code. |
|
90 */ |
|
91 static CCFLess* ParseL( MCFOperationServices& aServices, |
|
92 CCFOperationNode* aParent, |
|
93 CMDXMLNode& aNode ); |
|
94 |
|
95 /** |
|
96 * Destructor. |
|
97 */ |
|
98 ~CCFLess(); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * C++ default constructor. |
|
104 */ |
|
105 CCFLess( MCFOperationServices& aServices, |
|
106 CCFOperationNode* aParent, |
|
107 HBufC* aName, |
|
108 HBufC* aSource, |
|
109 const CCFContextOperation::TCmpType aType ); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 */ |
|
114 void ConstructL( const TDesC& aCmpVal ); |
|
115 |
|
116 protected: // // From CCFContextOperation |
|
117 |
|
118 /** |
|
119 * Returns ETrue if this operation is true. |
|
120 */ |
|
121 TBool IsTrueL( const CCFContextObject& aContextObject ); |
|
122 |
|
123 private: // Data |
|
124 |
|
125 CCFContextOperation::TCmpType iType; |
|
126 HBufC* iCmpValue; |
|
127 }; |
|
128 |
|
129 #endif // C_CFLESS_H |