kerneltest/f32test/shostmassstorage/msman/server/cusbotgsession.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     1 // Copyright (c) 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 // Implements a Session of a Symbian OS server for the RUsbMassStorage API
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalTechnology
       
    23 */
       
    24 
       
    25 #ifndef CUSBOTGSESSION_H
       
    26 #define CUSBOTGSESSION_H
       
    27 
       
    28 
       
    29 _LIT(KUsbOtgClientPncCat, "UsbOtgServer");
       
    30 
       
    31 class CUsbOtgServer;
       
    32 
       
    33 enum TMsManPanicClient
       
    34     {
       
    35     EUsbOtgPanicIllegalIPC
       
    36     };
       
    37 
       
    38 
       
    39 class CUsbOtgSession : public CSession2
       
    40 	{
       
    41 public:
       
    42 	static CUsbOtgSession* NewL();
       
    43     virtual void CreateL();
       
    44 
       
    45 protected:
       
    46 	CUsbOtgSession();
       
    47 	void ConstructL();
       
    48 
       
    49 private:
       
    50 	~CUsbOtgSession();
       
    51 
       
    52 
       
    53 public:
       
    54 	// CSession2
       
    55 	void ServiceL(const RMessage2& aMessage);
       
    56     void DispatchMessageL(const RMessage2& aMessage);
       
    57 
       
    58 private:
       
    59     // Services
       
    60     void DeviceInsertedL(const RMessage2& aMessage);
       
    61 	void NotifyChange(const RMessage2& aMessage);
       
    62 	void NotifyChangeCancel();
       
    63     TInt BusDrop();
       
    64 
       
    65 protected:
       
    66     // panic the client
       
    67     void PanicClient(const RMessage2& aMessage,TInt aPanic) const;
       
    68 
       
    69 private:
       
    70     CUsbOtgServer& Server();
       
    71 	};
       
    72 
       
    73 
       
    74 inline CUsbOtgServer& CUsbOtgSession::Server()
       
    75     {
       
    76     return *static_cast<CUsbOtgServer*>(const_cast<CServer2*>(CSession2::Server()));
       
    77     }
       
    78 
       
    79 
       
    80 #endif // CUSBOTGSESSION_H