usbengines/usbotgwatcher/tsrc/UsbOtgWatcherTest/inc/mockcusbidpinobserver.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 MOCK_C_USBIDPINOBSERVER_H
       
    19 #define MOCK_C_USBIDPINOBSERVER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include <StifTestModule.h>
       
    24 #include <StifLogger.h>
       
    25 #include <e32property.h> 
       
    26 
       
    27 #include "tassertbase.h"
       
    28 
       
    29 class CStifLogger;
       
    30 
       
    31 class MUsbIdPinObserver
       
    32     {
       
    33 public:
       
    34 
       
    35     virtual void IdPinOffL() = 0;
       
    36     virtual void IdPinOnL() = 0;
       
    37 
       
    38     };
       
    39 
       
    40 /**
       
    41  *  Class observes ID-PIN property
       
    42  *
       
    43  *  @lib ?library
       
    44  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    45  */
       
    46 class CUsbIdPinObserver : public TAssertBase
       
    47     {
       
    48     friend class CtUsbOtgWatcher;
       
    49     friend class CUsbOtgWatcherTest;
       
    50 public:
       
    51     enum TState
       
    52         {
       
    53         EIdPinOff = 0,
       
    54         EIdPinOn = 1
       
    55         };
       
    56 
       
    57     /**
       
    58      * Two-phased constructor.
       
    59      * @param ?arg1 ?description
       
    60      * @param ?arg2 ?description
       
    61      */
       
    62     //    ?IMPORT_C 
       
    63     static CUsbIdPinObserver* NewL();
       
    64 
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     virtual ~CUsbIdPinObserver();
       
    69 
       
    70     /**
       
    71      * ?description
       
    72      *
       
    73      * @since S60 ?S60_version
       
    74      * @param ?arg1 ?description
       
    75      * @param ?arg2 ?description
       
    76      * @return ?description
       
    77      */
       
    78     //    ?IMPORT_C 
       
    79     TState IdPin() /* const! read comment in impl*/;
       
    80 
       
    81     /**
       
    82      * ?description
       
    83      *
       
    84      * @since S60 ?S60_version
       
    85      * @param ?arg1 ?description
       
    86      * @param ?arg2 ?description
       
    87      * @return ?description
       
    88      */
       
    89 
       
    90     void SubscribeL(MUsbIdPinObserver&);
       
    91 
       
    92     void UnsubscribeL(MUsbIdPinObserver&);
       
    93 
       
    94     void TriggerPinOnL();
       
    95 
       
    96     void TriggerPinOffL();
       
    97 
       
    98 private:
       
    99 
       
   100     CUsbIdPinObserver();
       
   101 
       
   102     void ConstructL();
       
   103 
       
   104 private:
       
   105     // data
       
   106     // The observer reports state changes to its own observers
       
   107     // Own
       
   108     MUsbIdPinObserver* iObserver;
       
   109     TInt iIdPinOn;
       
   110     CActiveSchedulerWait * iWait;
       
   111     };
       
   112 
       
   113 #endif //  MOCK_C_USBIDPINOBSERVER_H