metadataengine/client/inc/mdesessionstartupao.h
changeset 0 c53acadfccc6
child 19 82c0024438c8
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  MdE session startup active object*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef __MDESESSIONSTARTUPAO_H__
       
    19 #define __MDESESSIONSTARTUPAO_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 // Forward declaration
       
    24 class CMdESessionImpl;
       
    25 class RMdEEngineSession;
       
    26 
       
    27 /**
       
    28 * CMdESessionStartupAO
       
    29 * An active object that handles asynchronous MdE session starting.
       
    30 */
       
    31 NONSHARABLE_CLASS(CMdESessionStartupAO) : public CActive
       
    32     {
       
    33     public: // Constructors and destructors
       
    34 
       
    35         /**
       
    36         * Two-phased constructor.
       
    37         * @param aSessionImpl session impl
       
    38         * @param aSession the server handler
       
    39         * @return the created instance
       
    40         */
       
    41         static CMdESessionStartupAO* NewL(
       
    42             CMdESessionImpl& aSessionImpl, RMdEEngineSession& aSession );
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         * @param aSessionImpl session impl
       
    47         * @param aSession the server handler
       
    48         * @return the created instance
       
    49         */
       
    50         static CMdESessionStartupAO* NewLC(
       
    51             CMdESessionImpl& aSessionImpl, RMdEEngineSession& aSession );
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CMdESessionStartupAO();
       
    57 
       
    58     protected: // Functions from base classes
       
    59 
       
    60         /**
       
    61         * From CActive
       
    62         * Callback function.
       
    63         * Invoked to handle responses from the server.
       
    64         */
       
    65         void RunL();
       
    66 
       
    67         /**
       
    68         * From CActive
       
    69         * Handles errors that occur during notifying the observer.
       
    70         */
       
    71         TInt RunError(TInt aError);
       
    72 
       
    73         /**
       
    74         * From CActive
       
    75         * Cancels any outstanding operation.
       
    76         */
       
    77         void DoCancel();
       
    78 
       
    79     private: // Constructors and destructors
       
    80 
       
    81         /**
       
    82         * constructor
       
    83         * @param aSessionImpl session impl
       
    84         * @param aSession the server handler
       
    85         */
       
    86         CMdESessionStartupAO( 
       
    87             CMdESessionImpl& aSessionImpl, RMdEEngineSession& aSession );
       
    88 
       
    89         /**
       
    90         * 2nd phase constructor
       
    91         */
       
    92         void ConstructL();
       
    93 
       
    94     private: // Data
       
    95 
       
    96 		enum TMdESessionStartupAOStates
       
    97 			{
       
    98 			EStartupOpenServer,
       
    99 			EStartupConnect,
       
   100 			EStartupLoadSchema,
       
   101 			EStartupNotifyClient
       
   102 			};
       
   103 
       
   104         TMdESessionStartupAOStates iState;
       
   105 
       
   106         /** the session impl. */
       
   107         CMdESessionImpl& iSessionImpl;
       
   108 
       
   109         /** the session */
       
   110         RMdEEngineSession& iSession;
       
   111     };
       
   112 
       
   113 #endif //__MDESESSIONSTARTUPAO_H__