sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Implements a Session of a Symbian OS server for the RUsbMassStorage API sl@0: // sl@0: // sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef CUSBOTGSESSION_H sl@0: #define CUSBOTGSESSION_H sl@0: sl@0: sl@0: _LIT(KUsbOtgClientPncCat, "UsbOtgServer"); sl@0: sl@0: class CUsbOtgServer; sl@0: sl@0: enum TMsManPanicClient sl@0: { sl@0: EUsbOtgPanicIllegalIPC sl@0: }; sl@0: sl@0: sl@0: class CUsbOtgSession : public CSession2 sl@0: { sl@0: public: sl@0: static CUsbOtgSession* NewL(); sl@0: virtual void CreateL(); sl@0: sl@0: protected: sl@0: CUsbOtgSession(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: ~CUsbOtgSession(); sl@0: sl@0: sl@0: public: sl@0: // CSession2 sl@0: void ServiceL(const RMessage2& aMessage); sl@0: void DispatchMessageL(const RMessage2& aMessage); sl@0: sl@0: private: sl@0: // Services sl@0: void DeviceInsertedL(const RMessage2& aMessage); sl@0: void NotifyChange(const RMessage2& aMessage); sl@0: void NotifyChangeCancel(); sl@0: TInt BusDrop(); sl@0: sl@0: protected: sl@0: // panic the client sl@0: void PanicClient(const RMessage2& aMessage,TInt aPanic) const; sl@0: sl@0: private: sl@0: CUsbOtgServer& Server(); sl@0: }; sl@0: sl@0: sl@0: inline CUsbOtgServer& CUsbOtgSession::Server() sl@0: { sl@0: return *static_cast(const_cast(CSession2::Server())); sl@0: } sl@0: sl@0: sl@0: #endif // CUSBOTGSESSION_H