usbservices_plat/usb_personality_plugin_api/tsrc/usbpersonalitypluginapitest/inc/UsbPersonalityPluginActiveObject.h
branchRCL_3
changeset 92 dde4619868dc
parent 86 703a2b94c06c
child 95 55a3258355ea
equal deleted inserted replaced
86:703a2b94c06c 92:dde4619868dc
     1 /*
       
     2  * Copyright (c) 2010 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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef USBPERSONALITYPLUGINACTIVEOBJECT_H
       
    19 #define USBPERSONALITYPLUGINACTIVEOBJECT_H
       
    20 
       
    21 #include <e32base.h>	// For CActive, link against: euser.lib
       
    22 #include <e32std.h>		// For RTimer, link against: euser.lib
       
    23 
       
    24 #include <cusbpersonalityplugin.h>
       
    25 #include <tusbpersonalityparams.h>
       
    26 
       
    27 #include <StifLogger.h>
       
    28 #include <TestScripterInternal.h>
       
    29 #include <StifTestModule.h>
       
    30 
       
    31 
       
    32 class CUsbPersonalityPluginActiveObject : public CActive
       
    33     {
       
    34 public:
       
    35     // Cancel and destroy
       
    36     ~CUsbPersonalityPluginActiveObject();
       
    37 
       
    38     // Two-phased constructor.
       
    39     static CUsbPersonalityPluginActiveObject* NewL( CUsbPersonalityPlugin*, CStifLogger*, TUsbPersonalityParams* );
       
    40 
       
    41     // Two-phased constructor.
       
    42     static CUsbPersonalityPluginActiveObject* NewLC( CUsbPersonalityPlugin*, CStifLogger*, TUsbPersonalityParams* );
       
    43 
       
    44 public:
       
    45     // New functions
       
    46     // Function for making the initial request
       
    47     void PreparePersonalityStart( TRequestStatus& aStatus);
       
    48 
       
    49     void FinishPersonalityStart( TRequestStatus& aStatus);
       
    50 
       
    51     void PreparePersonalityStop( TRequestStatus& aStatus);
       
    52 
       
    53     void FinishPersonalityStop( TRequestStatus& aStatus);
       
    54 
       
    55     void ConfirmPersonalityUnload( TRequestStatus& aStatus);
       
    56 private:
       
    57     // C++ constructor
       
    58     CUsbPersonalityPluginActiveObject( CUsbPersonalityPlugin*, CStifLogger*, TUsbPersonalityParams* );
       
    59 
       
    60     // Second-phase constructor
       
    61     void ConstructL();
       
    62 
       
    63 private:
       
    64     // From CActive
       
    65     // Handle completion
       
    66     void RunL();
       
    67 
       
    68     // How to cancel me
       
    69     void DoCancel();
       
    70 
       
    71     // Override to handle leaves from RunL(). Default implementation causes
       
    72     // the active scheduler to panic.
       
    73     TInt RunError(TInt aError);
       
    74 
       
    75 private:
       
    76 
       
    77 private:
       
    78     CUsbPersonalityPlugin* iPlugin;
       
    79     CStifLogger* iLog;
       
    80     TUsbPersonalityParams* iParams;
       
    81     };
       
    82 
       
    83 #endif // USBPERSONALITYPLUGINACTIVEOBJECT_H