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