00001 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // 00015 00016 #ifndef __PROCESSSERVER_H__ 00017 #define __PROCESSSERVER_H__ 00018 00019 #include <e32base.h> 00020 #include <e32std.h> 00021 #include "shutdownserver.h" 00022 #include "processclientserver.h" 00023 #include "driver1.h" 00024 00025 class CAsyncHandler; 00029 class CProcessServer : public CServer2 00030 { 00031 public: 00035 enum TDriverState 00036 { 00037 EStateUnknown, 00038 EDriverLoaded, 00039 ELogicalChannelOpened, 00040 ESendingData, 00041 ELogicalChannelClosed, 00042 EDriverUnloaded 00043 }; 00047 static void NewLC(); 00052 ~CProcessServer(); 00057 CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const; 00062 void IncrementRefCount(); 00067 void DecrementRefCount(); 00071 TInt LoadDevice(); 00075 TInt UnloadDevice(); 00079 TInt OpenLogicalChannel(); 00083 void CloseLogicalChannel(); 00087 TInt SendDataToDevice(TRequestStatus& aStatus, const TDesC8& aData); 00091 void CancelSendData(); 00095 void UpdateDriverState(TDriverState aState); 00096 00097 private: 00098 CProcessServer(); 00099 void ConstructL(); 00100 00101 private: 00102 TInt iRefCount; 00103 CDelayServerShutDown* iDelayProcessServerShutDown; 00104 RDriver1 iDriver; 00105 TDriverState iDriverState; 00106 }; 00107 00108 00109 00110 #endif