kerneltest/e32test/pccd/d_medch.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\pccd\d_medch.h
       
    15 // This header provides the interface to MEDCH.LDD so that user mode 
       
    16 // code such as test programs can use it.
       
    17 // 
       
    18 //
       
    19 
       
    20 #if !defined(__D_MEDCH_H__)
       
    21 #define __D_MEDCH_H__
       
    22 
       
    23 #include <e32cmn.h>
       
    24 
       
    25 #ifndef __KERNEL_MODE__
       
    26 #include <e32std.h>
       
    27 #endif
       
    28 
       
    29 class TCapsMediaChangeV01
       
    30 	{
       
    31 public:
       
    32 	TVersion version;
       
    33 	};
       
    34 
       
    35 class RMedCh : public RBusLogicalChannel
       
    36 	{
       
    37 public:
       
    38 	enum
       
    39 		{
       
    40 		EMajorVersionNumber=1,
       
    41 		EMinorVersionNumber=0,
       
    42 		EBuildVersionNumber=1
       
    43 		};
       
    44 
       
    45 	enum TControl
       
    46         {
       
    47 		EDoorNormal,
       
    48 		EDoorOpen,
       
    49 		EDoorClose,
       
    50 		EDoubleDoorOpen
       
    51 		};
       
    52 
       
    53 	enum TRequest
       
    54 		{
       
    55 		EDelayedDoorOpen,
       
    56 		EDelayedDoorClose
       
    57 		};
       
    58 	
       
    59 public:
       
    60 	inline void Cancel();
       
    61 	
       
    62 	inline TInt Open(TInt aSocket, const TVersion& aVer)
       
    63 		{
       
    64 		return(DoCreate(_L("MedCh"), aVer, aSocket, NULL, NULL));
       
    65 		}
       
    66 	
       
    67 	inline TVersion VersionRequired() const
       
    68 		{
       
    69 		return(TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber));
       
    70 		}
       
    71 	
       
    72 	inline TInt DoorOpen()
       
    73 		{
       
    74 		return(DoControl(EDoorOpen));
       
    75 		}
       
    76 
       
    77 	inline TInt DoorClose(TBool aMediaPresent)
       
    78 		{
       
    79 		return(DoControl(EDoorClose, (TAny*)aMediaPresent));
       
    80 		}
       
    81 	
       
    82 	inline TInt DoorNormal()
       
    83 		{
       
    84 		return(DoControl(EDoorNormal));
       
    85 		}
       
    86 
       
    87 	inline void DelayedDoorOpen(TRequestStatus &aReqStat, TInt aMsDelay)
       
    88 		{
       
    89 		DoRequest(EDelayedDoorOpen, aReqStat, (TAny*)aMsDelay);
       
    90 		}
       
    91 
       
    92 	inline void DelayedDoorClose(TRequestStatus &aReqStat, TInt aMsDelay, TBool aMediaPresent)
       
    93 		{
       
    94 		DoRequest(EDelayedDoorClose, aReqStat, (TAny*)aMsDelay, (TAny*)aMediaPresent);
       
    95 		}
       
    96 
       
    97 	inline TInt DoubleDoorOpen()
       
    98 		{
       
    99 		return(DoControl(EDoubleDoorOpen));
       
   100 		}
       
   101 
       
   102 	};
       
   103 
       
   104 #endif