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