1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 /*************************************************************************
25  *
26  *	  ATTENTION
27  *	  This file is intended to work inside and outside the StarOffice environment.
28  *	  Only adaption of file commtypes.hxx should be necessary. Else it is a bug!
29  *
30  ************************************************************************/
31 
32 #ifndef _CMDBASESTREAM_HXX_
33 #define _CMDBASESTREAM_HXX_
34 
35 #include <automation/commtypes.hxx>
36 #include "icommstream.hxx"
37 
38 class CmdBaseStream
39 {
40 protected:
41 	ICommStream* pCommStream;
42 	CmdBaseStream();
43 	virtual ~CmdBaseStream();
44 
45 public:
46 
47 	void GenError( rtl::OString *pUId, comm_String *pString );
48 
49 	void GenReturn( comm_USHORT nRet, comm_ULONG nNr );
50 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr );
51 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_String *pString );
52 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_BOOL bBool );
53 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr, comm_String *pString, comm_BOOL bBool );
54 
55 	void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_ULONG nNr );
56 	void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_String *pString );
57 	void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_BOOL bBool );
58 	void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_USHORT nNr );
59 
60 // MacroRecorder
61 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod ); // also used outside MacroRecorder
62     void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString );
63     void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString, comm_BOOL bBool );
64     void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_BOOL bBool );
65 	void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_ULONG nNr );
66 
67 	void Read ( comm_USHORT &nNr );
68 	void Read ( comm_ULONG &nNr );
69     void Read (comm_UniChar* &aString, comm_USHORT &nLenInChars );
70 	void Read ( comm_BOOL &bBool );
71     comm_USHORT GetNextType();
72 
73 	void Write( comm_USHORT nNr );
74 	void Write( comm_ULONG nNr );
75     void Write( const comm_UniChar* aString, comm_USHORT nLenInChars );
76 	void Write( comm_BOOL bBool );
77 
78 // Complex Datatypes to be handled system dependent
79 	virtual void Read ( comm_String *&pString );
80 	virtual void Read ( rtl::OString* &pId );
81 
82     virtual void Write( comm_String *pString );
83 	virtual void Write( rtl::OString* pId );
84 };
85 
86 #endif
87