connectivity/com.nokia.tcf/native/TCFNative/TCFServer/Client.h
changeset 60 9d2210c8eed2
equal deleted inserted replaced
59:c892c53c664e 60:9d2210c8eed2
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 // Client.h: interface for the CClient class.
       
    18 //
       
    19 // one of these per client
       
    20 //
       
    21 //////////////////////////////////////////////////////////////////////
       
    22 
       
    23 #if !defined(AFX_CLIENT_H__6BC8ADEC_683A_4924_ABD0_28B449E927C6__INCLUDED_)
       
    24 #define AFX_CLIENT_H__6BC8ADEC_683A_4924_ABD0_28B449E927C6__INCLUDED_
       
    25 
       
    26 #include "ServerClient.h"
       
    27 #include "InputStream.h"
       
    28 #include "MessageFile.h"
       
    29 #include "ErrorMonitorData.h"
       
    30 #include "TCConstants.h"
       
    31 
       
    32 #if _MSC_VER > 1000
       
    33 #pragma once
       
    34 #endif // _MSC_VER > 1000
       
    35 
       
    36 class CConnection;
       
    37 
       
    38 class CClient  
       
    39 {
       
    40 public:
       
    41 	CClient();
       
    42 	CClient(CConnection* connection, ClientOptions& options, DWORD clientId);
       
    43 	virtual ~CClient();
       
    44 
       
    45 	void Start() { m_Status = eStarted; }
       
    46 	void Stop() { m_Status = eStopped; }
       
    47 
       
    48 	BOOL IsStarted() { return (m_Status == eStarted); }
       
    49 	DWORD GetClientId() { return m_ClientId; }
       
    50 	CConnection* GetConnection() { return m_Connection; }
       
    51 	BOOL OpenStream(DestinationOptions* streamOptions);
       
    52 	BOOL CloseStream();
       
    53 	BOOL IsStreamOpen() { return (m_InputStream != NULL); }
       
    54 	CInputStream* GetInputStream() { return m_InputStream; }
       
    55 
       
    56 	BOOL OpenMessageFile(DestinationOptions* messageFileOptions);
       
    57 	BOOL CloseMessageFile();
       
    58 	BOOL ClearMessageFile();
       
    59 	BOOL IsMessageFileOpen() { return (m_MessageFile != NULL); }
       
    60 	CMessageFile* GetMessageFile() { return m_MessageFile; }
       
    61 
       
    62 	eMessageDestination m_MessageDestination;
       
    63 	CMessageFile* m_MessageFile;
       
    64 	CInputStream* m_InputStream;
       
    65 	CErrorMonitor* m_ErrorMonitor;
       
    66 	CConnection* m_Connection;
       
    67 	ClientOptions m_Options;
       
    68 	eClientStatus m_Status;
       
    69 	DWORD m_ClientId;
       
    70 };
       
    71 
       
    72 #endif // !defined(AFX_CLIENT_H__6BC8ADEC_683A_4924_ABD0_28B449E927C6__INCLUDED_)