systemswstubs/startupadaptationstub/inc/StartupAdaptationStub.h
changeset 46 e1758cbb96ac
parent 0 0ce1b5ce9557
equal deleted inserted replaced
43:e71858845f73 46:e1758cbb96ac
       
     1 /*
       
     2 * Copyright (c) 2004-2006 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:  CStartupAdaptationStub class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __STARTUPADAPTATIONSTUB_H__
       
    21 #define __STARTUPADAPTATIONSTUB_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CommandProcessingObserver.h"
       
    25 #include "sastubeventsender.h"
       
    26 #include <startupadaptation.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CCommandProcessingEngine;
       
    30 class CStartupAdaptationStubModel;
       
    31 class CSAStubEventListener;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  A stub implementation of CStartupAdaptation interface.
       
    37 *
       
    38 *  @lib StartupAdaptationStub.lib
       
    39 *  @since Series 60 3.0
       
    40 */
       
    41 class CStartupAdaptationStub :
       
    42     public CStartupAdaptation,
       
    43     public MCommandProcessingObserver,
       
    44     public MSAStubEventSender
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @param aConstructionParameters Construction parameters from the
       
    51         * client.
       
    52         */
       
    53         static CStartupAdaptationStub* NewL( TAny* aConstructionParameters );
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CStartupAdaptationStub();
       
    59 
       
    60     public: // Functions from base classes
       
    61 
       
    62         /**
       
    63         * From CStartupAdaptation.
       
    64         * Issue a command to startup adaptation.
       
    65         *
       
    66         * @param aCommandId A command identifier.
       
    67         * @param aData      Data associated with the command.
       
    68         */
       
    69         virtual void CommandL(
       
    70             const StartupAdaptation::TCommand aCommandId,
       
    71             TDesC8& aData );
       
    72 
       
    73         /**
       
    74         * From CStartupAdaptation.
       
    75         * Cancel a command.
       
    76         *
       
    77         * @param aCommandId A command identifier.
       
    78         */
       
    79         virtual void CancelCommandL(
       
    80             const StartupAdaptation::TCommand aCommandId );
       
    81 
       
    82         /**
       
    83         * From CStartupAdaptation.
       
    84         * Get plugin implementation version. Major and minor version numbers
       
    85         * are relevant.
       
    86         *
       
    87         * @return The plugin implementation version.
       
    88         */
       
    89         virtual TVersion Version() const;
       
    90 
       
    91         /**
       
    92         * From MCommandProcessingObserver.
       
    93         * A command has been processed.
       
    94         * @param aCommandId A command identifier.
       
    95         */
       
    96         virtual void CommandProcessedL(
       
    97             const TInt aCommandId );
       
    98 
       
    99         /**
       
   100          * From MSAStubEventSender.
       
   101          * Send an event.
       
   102          *
       
   103          * @since S60 4.0
       
   104          * @param aEvent Identifies the event to send.
       
   105          * @param aArg Optional paraneter for the event.
       
   106          */
       
   107         virtual void SendEvent( const TInt aEvent, const TInt aArg );
       
   108 
       
   109     private:
       
   110 
       
   111         /**
       
   112         * C++ default constructor.
       
   113         * @param anObserver Observer for command responses and events.
       
   114         */
       
   115         CStartupAdaptationStub( MStartupAdaptationObserver* anObserver );
       
   116 
       
   117         /**
       
   118         * Performs the second phase construction of a CStartupAdaptationStub
       
   119         * object.
       
   120         */
       
   121         void ConstructL();
       
   122 
       
   123     private:    // Data
       
   124 
       
   125         // Observer for command responses and events. Not owned.
       
   126         MStartupAdaptationObserver* iObserver;
       
   127 
       
   128         // The engine class that handles the 'processing' of requests.
       
   129         CCommandProcessingEngine* iEngine;
       
   130 
       
   131         // Model containg the response values for the commands.
       
   132         CStartupAdaptationStubModel* iModel;
       
   133 
       
   134         // Observer for indications to send events.
       
   135         CSAStubEventListener* iEventListener;
       
   136     };
       
   137 
       
   138 // CLASS DECLARATION
       
   139 
       
   140 #endif // __STARTUPADAPTATIONSTUB_H__
       
   141 
       
   142 // End of File