contextframework/cfw/inc/basicoperationsplugin/cfelseclause.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:  CCFElseClause class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CFELSECLAUSE_H
       
    21 #define C_CFELSECLAUSE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "cfclausenode.h"
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *   This class implements ElseIfClause XML node of CFW script in Script Engine
       
    32 *   scripts.
       
    33 *
       
    34 *  @lib CFScriptEngine
       
    35 *  @since Series 60 2.6
       
    36 */
       
    37 NONSHARABLE_CLASS( CCFElseClause ): public CCFClauseNode
       
    38     {
       
    39 public: // Constructors and destructor
       
    40 
       
    41     /**
       
    42     * Creates a CCFElseClause 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 CCFElseClause
       
    47     */
       
    48     static CCFElseClause* NewL( MCFOperationServices& aServices,
       
    49             CCFOperationNode* aParent );
       
    50 
       
    51     /**
       
    52     * Creates a CCFElseClause 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 CCFElseClause
       
    57     */
       
    58     static CCFElseClause* NewLC( MCFOperationServices& aServices,
       
    59             CCFOperationNode* aParent );
       
    60 
       
    61     /**
       
    62     * Creates and parses a CCFElseClause 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 CCFElseClause, or NULL if the
       
    68     *   node is not else clause node. May leave with any system wide error code.
       
    69     */
       
    70     static CCFElseClause* ParseL( MCFOperationServices& aServices,
       
    71             CCFOperationNode* aParent,
       
    72             CMDXMLNode& aNode );
       
    73 
       
    74     /**
       
    75     * Destructor.
       
    76     */
       
    77     ~CCFElseClause();
       
    78 
       
    79 protected: // Functions from CCFClauseNode
       
    80 
       
    81     /**
       
    82     * Fires actions of the node.
       
    83     * @return None.
       
    84     */
       
    85     void FireActionsL();
       
    86 
       
    87 protected: // Functions 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 the
       
   103     * security of 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 private:
       
   117 
       
   118     /**
       
   119     * C++ default constructor.
       
   120     */
       
   121     CCFElseClause( MCFOperationServices& aServices, CCFOperationNode* aParent );
       
   122 
       
   123     /**
       
   124     * By default Symbian 2nd phase constructor is private.
       
   125     */
       
   126     void ConstructL();
       
   127 
       
   128 private: // Data
       
   129 
       
   130     // Else clause actions.
       
   131     RPointerArray< CCFScriptAction > iActions;
       
   132     };
       
   133 
       
   134 #endif // C_CFELSECLAUSE_H