1*9d1279ecSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9d1279ecSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9d1279ecSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9d1279ecSAndrew Rist  * distributed with this work for additional information
6*9d1279ecSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9d1279ecSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9d1279ecSAndrew Rist  * "License"); you may not use this file except in compliance
9*9d1279ecSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9d1279ecSAndrew Rist  *
11*9d1279ecSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9d1279ecSAndrew Rist  *
13*9d1279ecSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9d1279ecSAndrew Rist  * software distributed under the License is distributed on an
15*9d1279ecSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9d1279ecSAndrew Rist  * KIND, either express or implied.  See the License for the
17*9d1279ecSAndrew Rist  * specific language governing permissions and limitations
18*9d1279ecSAndrew Rist  * under the License.
19*9d1279ecSAndrew Rist  *
20*9d1279ecSAndrew Rist  *************************************************************/
21*9d1279ecSAndrew Rist 
22*9d1279ecSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_automation.hxx"
26cdf0e10cSrcweir #include <tools/stream.hxx>
27cdf0e10cSrcweir #include <basic/ttstrhlp.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "retstrm.hxx"
30cdf0e10cSrcweir #include "rcontrol.hxx"
31cdf0e10cSrcweir #include "svcommstream.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
RetStream()34cdf0e10cSrcweir RetStream::RetStream()
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 	pSammel = new SvMemoryStream();
37cdf0e10cSrcweir 	pCommStream = new SvCommStream( pSammel );
38cdf0e10cSrcweir //	SetCommStream( pCommStream );
39cdf0e10cSrcweir }
40cdf0e10cSrcweir 
~RetStream()41cdf0e10cSrcweir RetStream::~RetStream()
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 	delete pCommStream;
44cdf0e10cSrcweir 	delete pSammel;
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
GenError(rtl::OString aUId,String aString)47cdf0e10cSrcweir void RetStream::GenError ( rtl::OString aUId, String aString )
48cdf0e10cSrcweir {
49cdf0e10cSrcweir     CmdBaseStream::GenError ( &aUId, &aString );
50cdf0e10cSrcweir }
51cdf0e10cSrcweir 
GenReturn(sal_uInt16 nRet,rtl::OString aUId,String aString)52cdf0e10cSrcweir void RetStream::GenReturn ( sal_uInt16 nRet, rtl::OString aUId, String aString )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     CmdBaseStream::GenReturn ( nRet, &aUId, &aString );
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
GenReturn(sal_uInt16 nRet,rtl::OString aUId,comm_ULONG nNr,String aString,sal_Bool bBool)57cdf0e10cSrcweir void RetStream::GenReturn ( sal_uInt16 nRet, rtl::OString aUId, comm_ULONG nNr, String aString, sal_Bool bBool )
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     CmdBaseStream::GenReturn ( nRet, &aUId, nNr, &aString, bBool );
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
62cdf0e10cSrcweir // MacroRecorder
GenReturn(sal_uInt16 nRet,rtl::OString aUId,comm_USHORT nMethod,String aString)63cdf0e10cSrcweir void RetStream::GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_USHORT nMethod, String aString )
64cdf0e10cSrcweir {
65cdf0e10cSrcweir     CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString );
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
GenReturn(sal_uInt16 nRet,rtl::OString aUId,comm_USHORT nMethod,String aString,sal_Bool bBool)68cdf0e10cSrcweir void RetStream::GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_USHORT nMethod, String aString, sal_Bool bBool )
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString, bBool );
71cdf0e10cSrcweir }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
GenReturn(sal_uInt16 nRet,sal_uInt16 nMethod,SbxValue & aValue)74cdf0e10cSrcweir void RetStream::GenReturn ( sal_uInt16 nRet, sal_uInt16 nMethod, SbxValue &aValue )
75cdf0e10cSrcweir {
76cdf0e10cSrcweir 	Write(sal_uInt16(SIReturn));
77cdf0e10cSrcweir 	Write(nRet);
78cdf0e10cSrcweir 	Write((comm_ULONG)nMethod); //HELPID BACKWARD (no sal_uLong needed)
79cdf0e10cSrcweir 	Write(sal_uInt16(PARAM_SBXVALUE_1));		// Typ der folgenden Parameter
80cdf0e10cSrcweir 	Write(aValue);
81cdf0e10cSrcweir }
82cdf0e10cSrcweir 
GenReturn(sal_uInt16 nRet,sal_uInt16 nMethod,String aString)83cdf0e10cSrcweir void RetStream::GenReturn( sal_uInt16 nRet, sal_uInt16 nMethod, String aString )
84cdf0e10cSrcweir {
85cdf0e10cSrcweir     CmdBaseStream::GenReturn ( nRet, nMethod, &aString );
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
Write(String * pString)91cdf0e10cSrcweir void RetStream::Write( String *pString )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir 	CmdBaseStream::Write( pString->GetBuffer(), pString->Len() );
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
Write(SbxValue & aValue)96cdf0e10cSrcweir void RetStream::Write( SbxValue &aValue )
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	*pSammel << sal_uInt16( BinSbxValue );
99cdf0e10cSrcweir 	aValue.Store( *pSammel );
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
Write(rtl::OString * pId)102cdf0e10cSrcweir void RetStream::Write( rtl::OString* pId )
103cdf0e10cSrcweir {
104cdf0e10cSrcweir     //HELPID BACKWARD (should use ByteString or OString)
105cdf0e10cSrcweir     String aTmp( Id2Str( *pId ) );
106cdf0e10cSrcweir     Write( &aTmp );
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 
GetStream()110cdf0e10cSrcweir SvStream* RetStream::GetStream()
111cdf0e10cSrcweir {
112cdf0e10cSrcweir 	return pSammel;
113cdf0e10cSrcweir }
114cdf0e10cSrcweir 
Reset()115cdf0e10cSrcweir void RetStream::Reset ()
116cdf0e10cSrcweir {
117cdf0e10cSrcweir 	delete pCommStream;
118cdf0e10cSrcweir 	delete pSammel;
119cdf0e10cSrcweir 	pSammel = new SvMemoryStream();
120cdf0e10cSrcweir 	pCommStream = new SvCommStream( pSammel );
121cdf0e10cSrcweir //	SetCommStream( pCommStream );
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124