xref: /trunk/main/automation/source/simplecm/packethandler.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
13398c5b8SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33398c5b8SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43398c5b8SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53398c5b8SAndrew Rist  * distributed with this work for additional information
63398c5b8SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73398c5b8SAndrew Rist  * to you under the Apache License, Version 2.0 (the
83398c5b8SAndrew Rist  * "License"); you may not use this file except in compliance
93398c5b8SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
113398c5b8SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
133398c5b8SAndrew Rist  * Unless required by applicable law or agreed to in writing,
143398c5b8SAndrew Rist  * software distributed under the License is distributed on an
153398c5b8SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163398c5b8SAndrew Rist  * KIND, either express or implied.  See the License for the
173398c5b8SAndrew Rist  * specific language governing permissions and limitations
183398c5b8SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
203398c5b8SAndrew Rist  *************************************************************/
213398c5b8SAndrew Rist 
223398c5b8SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir /*************************************************************************
25cdf0e10cSrcweir  *
26cdf0e10cSrcweir  *    ATTENTION
27cdf0e10cSrcweir  *    This file is intended to work inside and outside the StarOffice environment.
28cdf0e10cSrcweir  *    Only adaption of file commtypes.hxx should be necessary. Else it is a bug!
29cdf0e10cSrcweir  *
30cdf0e10cSrcweir  ************************************************************************/
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #ifndef _TOOLS_PACKETHANDLER_HXX_
33cdf0e10cSrcweir #define _TOOLS_PACKETHANDLER_HXX_
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <automation/commtypes.hxx>
36cdf0e10cSrcweir #include <automation/commdefines.hxx>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class ITransmiter;
39cdf0e10cSrcweir class IReceiver;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class PacketHandler
42cdf0e10cSrcweir {
43cdf0e10cSrcweir private:
44cdf0e10cSrcweir     unsigned char CalcCheckByte( comm_UINT32 nBytes );
45cdf0e10cSrcweir     ITransmiter* pTransmitter;
46cdf0e10cSrcweir     IReceiver* pReceiver;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     comm_BOOL bMultiChannel;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir protected:
51cdf0e10cSrcweir     comm_UINT16 nReceiveProtocol;
52cdf0e10cSrcweir     comm_UINT16 nReceiveHeaderType;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir public:
55cdf0e10cSrcweir     PacketHandler( ITransmiter* pTransmitter_, IReceiver* pReceiver_, comm_BOOL bMC = sal_False );
56cdf0e10cSrcweir 
GetReceiveProtocol()57cdf0e10cSrcweir     comm_UINT16 GetReceiveProtocol() { return nReceiveProtocol; }
GetReceiveHeaderType()58cdf0e10cSrcweir     comm_UINT16 GetReceiveHeaderType() { return nReceiveHeaderType; }
59cdf0e10cSrcweir 
60*07a3d7f1SPedro Giffuni     comm_BOOL ReceiveData( void* &pData, comm_UINT32 &nLen );               /// Receive DataPacket from Socket
61cdf0e10cSrcweir     virtual comm_BOOL SendHandshake( HandshakeType aHandshakeType, const void* pData = NULL, comm_UINT32 nLen = 0 );
62cdf0e10cSrcweir     virtual comm_BOOL TransferData( const void* pData, comm_UINT32 nLen, CMProtocol nProtocol = CM_PROTOCOL_OLDSTYLE );
63cdf0e10cSrcweir };
64cdf0e10cSrcweir 
65cdf0e10cSrcweir #endif
66