usbclasses/usbbasicpersonality/inc/CUsbActiveBasicHandler.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2 * Copyright (c) 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:  Header file for CUsbActiveBasicHandler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CUSBACTIVEBASICHANDLER_H
       
    20 #define C_CUSBACTIVEBASICHANDLER_H
       
    21 
       
    22 #include "cusbpersonalityplugin.h"
       
    23 
       
    24 class RUsb;
       
    25 
       
    26 /**
       
    27 *  Class to handle basic personalities.
       
    28 *
       
    29 *  @lib euser.lib
       
    30 *  @since Series 60 3.0
       
    31 */
       
    32 class CUsbActiveBasicHandler : public CUsbPersonalityPlugin
       
    33     {
       
    34 public:  // Constructors and destructor
       
    35         
       
    36     /**
       
    37      * Two-phased constructor.
       
    38      * @param aPersonalityParams Reference to the container class.
       
    39      * @return pointer to created object
       
    40      */
       
    41     static CUsbActiveBasicHandler* NewL(TUsbPersonalityParams& aPersonalityParams);
       
    42         
       
    43     /**
       
    44      * Destructor.
       
    45      */
       
    46     virtual ~CUsbActiveBasicHandler();
       
    47 
       
    48 public: // from base class CUsbPersonality        
       
    49         
       
    50     /**
       
    51      * From CUsbPersonality
       
    52      * Called when personality will be changed. In this personality 
       
    53      * no actions is taken.
       
    54      *
       
    55      * @since Series 60 3.0
       
    56      * @param aStatus Status of the ended operation.
       
    57      */        
       
    58     virtual void ConfirmPersonalityUnload(TRequestStatus& aStatus);
       
    59 
       
    60     /**
       
    61      * From CUsbPersonality
       
    62      * Called by personality handler when personality start needs to be 
       
    63      * prepared. Nothing is done in this personality.
       
    64      *
       
    65      * @since Series 60 3.0
       
    66      * @param aStatus Status of the ended operation.
       
    67      */
       
    68     virtual void PreparePersonalityStart(TRequestStatus& aStatus);
       
    69 
       
    70     /**
       
    71      * From CUsbPersonality
       
    72      * Called by personality handler when personality start needs to be 
       
    73      * finished. For this personality: Show infonote to user.
       
    74      *
       
    75      * @since Series 60 3.0
       
    76      * @param aStatus Status of the ended operation.
       
    77      */
       
    78     virtual void FinishPersonalityStart(TRequestStatus& aStatus);
       
    79                 
       
    80     /**
       
    81      * From CUsbPersonality
       
    82      * Called by personality handler when personality stop needs to be 
       
    83      * prepared. For this personality: Do nothing.
       
    84      *
       
    85      * @since Series 60 3.0
       
    86      * @param aStatus Status of the ended operation.
       
    87      */
       
    88     virtual void PreparePersonalityStop(TRequestStatus& aStatus);
       
    89 
       
    90     /**
       
    91      * From CUsbPersonality
       
    92      * Called by personality handler when personality stop needs to be 
       
    93      * finished. For this personality: Do nothing.
       
    94      *
       
    95      * @since Series 60 3.0
       
    96      * @param aStatus Status of the ended operation.
       
    97      */
       
    98     virtual void FinishPersonalityStop(TRequestStatus& aStatus);
       
    99         
       
   100     /**
       
   101      * From CUsbPersonality
       
   102      * State change notify
       
   103      *
       
   104      * @since Series 60 3.0
       
   105      * @param aState state of the device
       
   106      */
       
   107     virtual void StateChangeNotify( TUsbDeviceState aState );
       
   108 
       
   109 public: // from base class CActive
       
   110 
       
   111     /**
       
   112      * From CActive.
       
   113      * Left empty in this implementation.
       
   114      *
       
   115      * @since Series 60 3.0
       
   116      */
       
   117     void RunL();
       
   118 
       
   119     /**
       
   120      * From CActive.
       
   121      * Left empty in this implementation.
       
   122      *
       
   123      * @since Series 60 3.0
       
   124      * @param aError the error returned
       
   125      * @return error
       
   126      */
       
   127     TInt RunError( TInt /*aError*/ );
       
   128 
       
   129     /**
       
   130      * From CActive
       
   131      * Left empty in this implementation.
       
   132      *
       
   133      * @since Series 60 3.0        
       
   134      */
       
   135     void DoCancel();
       
   136 
       
   137 protected:
       
   138 
       
   139     /**
       
   140      * C++ default constructor (no implementation provided).
       
   141      */
       
   142     CUsbActiveBasicHandler(TUsbPersonalityParams& aPersonalityParams);
       
   143 
       
   144     /**
       
   145      * By default Symbian 2nd phase constructor is private.
       
   146      */
       
   147     void ConstructL();
       
   148 
       
   149     // Prohibit copy constructor when not deriving from CBase.
       
   150     CUsbActiveBasicHandler( const CUsbActiveBasicHandler& );
       
   151     // Prohibit assigment operator when not deriving from CBase.
       
   152     CUsbActiveBasicHandler& operator=( const CUsbActiveBasicHandler& );
       
   153 
       
   154 private:    // Data
       
   155     /**
       
   156      * Request to completed later
       
   157      */
       
   158     TRequestStatus* iRequestStatus;
       
   159     };
       
   160 
       
   161 #endif   // USBACTIVECDCHANDLER_H
       
   162 
       
   163 // End of File