contextframework/cfw/inc/basicoperationsplugin/cfelseifclause.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:  CCFElseIfClause class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CFELSEIFCLAUSE_H
       
    21 #define C_CFELSEIFCLAUSE_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( CCFElseIfClause ): public CCFClauseNode
       
    38     {
       
    39 public: // Constructors and destructor
       
    40 
       
    41     /**
       
    42     * Creates a CCFElseIfClause 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 CCFElseIfClause
       
    47     */
       
    48     static CCFElseIfClause* NewL( MCFOperationServices& aServices,
       
    49             CCFOperationNode* aParent );
       
    50 
       
    51     /**
       
    52     * Creates a CCFElseIfClause 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 CCFElseIfClause
       
    57     */
       
    58     static CCFElseIfClause* NewLC( MCFOperationServices& aServices,
       
    59             CCFOperationNode* aParent );
       
    60 
       
    61     /**
       
    62     * Creates and parses a CCFElseIfClause 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 CCFElseIfClause, or NULL if
       
    68     *   the node is not else if clause node. May leave with any system wide
       
    69     *   error code.
       
    70     */
       
    71     static CCFElseIfClause* ParseL( MCFOperationServices& aServices,
       
    72             CCFOperationNode* aParent,
       
    73             CMDXMLNode& aNode );
       
    74 
       
    75     /**
       
    76     * Destructor.
       
    77     */
       
    78     ~CCFElseIfClause();
       
    79 
       
    80 protected: // Functions from CCFClauseNode
       
    81 
       
    82     /**
       
    83     * Fires actions of the node.
       
    84     * @return None.
       
    85     */
       
    86     void FireActionsL();
       
    87 
       
    88 protected: // Functions from CCFOperationNode
       
    89 
       
    90     /**
       
    91     * Activates this node by passing the activate call to its' child.
       
    92     * @return None.
       
    93     */
       
    94     void ActivateL();
       
    95 
       
    96     /**
       
    97     * Deactivates this node by passing the deactivate call to its' child.
       
    98     * @return None.
       
    99     */
       
   100     void Deactivate();
       
   101 
       
   102     /**
       
   103     * Asks this node to check its security (via services interface). Checks the
       
   104     * security of contexts to be subscribed and actions to be performed.
       
   105     * @return KErrNone if security check passed, otherwise any of the system
       
   106     *   wide error codes.
       
   107     */
       
   108     TInt CheckSecurity();
       
   109 
       
   110     /**
       
   111     * Called by child node, to ask the parent to re-evaluate its value,
       
   112     * since the child's value has changed.
       
   113     * @return None.
       
   114     */
       
   115     void Evaluate();
       
   116 
       
   117     /**
       
   118     * Cleanup long term resources like persistent data files.
       
   119     * This is called by the context framework when the script is uninstalled
       
   120     * from the system.
       
   121     */ 
       
   122     void Cleanup();
       
   123 
       
   124 private:
       
   125 
       
   126     /**
       
   127     * C++ default constructor.
       
   128     */
       
   129    CCFElseIfClause( MCFOperationServices& aServices,
       
   130            CCFOperationNode* aParent );
       
   131 
       
   132     /**
       
   133     * By default Symbian 2nd phase constructor is private.
       
   134     */
       
   135     void ConstructL();
       
   136 
       
   137 private: // Data
       
   138 
       
   139     // Must have one "root" operation, a child.
       
   140     CCFOperationNode* iChild;
       
   141 
       
   142     // ElseIf clause actions.
       
   143     RPointerArray< CCFScriptAction > iActions;
       
   144     };
       
   145 
       
   146 #endif // C_CFELSEIFCLAUSE_H