1*dde7d3faSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*dde7d3faSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*dde7d3faSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*dde7d3faSAndrew Rist * distributed with this work for additional information
6*dde7d3faSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*dde7d3faSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*dde7d3faSAndrew Rist * "License"); you may not use this file except in compliance
9*dde7d3faSAndrew Rist * with the License. You may obtain a copy of the License at
10*dde7d3faSAndrew Rist *
11*dde7d3faSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*dde7d3faSAndrew Rist *
13*dde7d3faSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*dde7d3faSAndrew Rist * software distributed under the License is distributed on an
15*dde7d3faSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*dde7d3faSAndrew Rist * KIND, either express or implied. See the License for the
17*dde7d3faSAndrew Rist * specific language governing permissions and limitations
18*dde7d3faSAndrew Rist * under the License.
19*dde7d3faSAndrew Rist *
20*dde7d3faSAndrew Rist *************************************************************/
21*dde7d3faSAndrew Rist
22*dde7d3faSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_comphelper.hxx"
26cdf0e10cSrcweir #include <comphelper/basicio.hxx>
27cdf0e10cSrcweir
28cdf0e10cSrcweir //.........................................................................
29cdf0e10cSrcweir namespace comphelper
30cdf0e10cSrcweir {
31cdf0e10cSrcweir //.........................................................................
32cdf0e10cSrcweir
33cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,const starawt::FontDescriptor & _rFont)34cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (
35cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream,
36cdf0e10cSrcweir const starawt::FontDescriptor& _rFont)
37cdf0e10cSrcweir {
38cdf0e10cSrcweir _rxOutStream->writeUTF( _rFont.Name );
39cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Height );
40cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Width );
41cdf0e10cSrcweir _rxOutStream->writeUTF( _rFont.StyleName );
42cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Family );
43cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.CharSet );
44cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Pitch );
45cdf0e10cSrcweir _rxOutStream->writeDouble( _rFont.CharacterWidth );
46cdf0e10cSrcweir _rxOutStream->writeDouble( _rFont.Weight );
47cdf0e10cSrcweir _rxOutStream->writeShort( static_cast< sal_Int16 >(_rFont.Slant) );
48cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Underline );
49cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Strikeout );
50cdf0e10cSrcweir _rxOutStream->writeDouble( _rFont.Orientation );
51cdf0e10cSrcweir _rxOutStream->writeBoolean( _rFont.Kerning );
52cdf0e10cSrcweir _rxOutStream->writeBoolean( _rFont.WordLineMode );
53cdf0e10cSrcweir _rxOutStream->writeShort( _rFont.Type );
54cdf0e10cSrcweir return _rxOutStream;
55cdf0e10cSrcweir }
56cdf0e10cSrcweir
57cdf0e10cSrcweir // FontDescriptor
58cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,starawt::FontDescriptor & _rFont)59cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (
60cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& _rxInStream,
61cdf0e10cSrcweir starawt::FontDescriptor& _rFont)
62cdf0e10cSrcweir {
63cdf0e10cSrcweir // schreiben des Fontdescriptors
64cdf0e10cSrcweir _rFont.Name = _rxInStream->readUTF();
65cdf0e10cSrcweir _rFont.Height = _rxInStream->readShort();
66cdf0e10cSrcweir _rFont.Width = _rxInStream->readShort();
67cdf0e10cSrcweir _rFont.StyleName = _rxInStream->readUTF();
68cdf0e10cSrcweir _rFont.Family = _rxInStream->readShort();
69cdf0e10cSrcweir _rFont.CharSet = _rxInStream->readShort();
70cdf0e10cSrcweir _rFont.Pitch = _rxInStream->readShort();
71cdf0e10cSrcweir _rFont.CharacterWidth = static_cast< float >(_rxInStream->readDouble());
72cdf0e10cSrcweir _rFont.Weight = static_cast< float >(_rxInStream->readDouble());
73cdf0e10cSrcweir _rFont.Slant = (starawt::FontSlant)_rxInStream->readShort();
74cdf0e10cSrcweir _rFont.Underline = _rxInStream->readShort();
75cdf0e10cSrcweir _rFont.Strikeout = _rxInStream->readShort();
76cdf0e10cSrcweir _rFont.Orientation = static_cast< float >(_rxInStream->readDouble());
77cdf0e10cSrcweir _rFont.Kerning = _rxInStream->readBoolean();
78cdf0e10cSrcweir _rFont.WordLineMode = _rxInStream->readBoolean();
79cdf0e10cSrcweir _rFont.Type = _rxInStream->readShort();
80cdf0e10cSrcweir return _rxInStream;
81cdf0e10cSrcweir }
82cdf0e10cSrcweir
83cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,sal_Bool & _rVal)84cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Bool& _rVal)
85cdf0e10cSrcweir {
86cdf0e10cSrcweir _rVal = _rxInStream->readBoolean();
87cdf0e10cSrcweir return _rxInStream;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir
90cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,sal_Bool _bVal)91cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Bool _bVal)
92cdf0e10cSrcweir {
93cdf0e10cSrcweir _rxOutStream->writeBoolean(_bVal);
94cdf0e10cSrcweir return _rxOutStream;
95cdf0e10cSrcweir }
96cdf0e10cSrcweir
97cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,::rtl::OUString & rStr)98cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, ::rtl::OUString& rStr)
99cdf0e10cSrcweir {
100cdf0e10cSrcweir rStr = _rxInStream->readUTF();
101cdf0e10cSrcweir return _rxInStream;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir
104cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,const::rtl::OUString & rStr)105cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, const ::rtl::OUString& rStr)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir _rxOutStream->writeUTF(rStr);
108cdf0e10cSrcweir return _rxOutStream;
109cdf0e10cSrcweir }
110cdf0e10cSrcweir
111cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,sal_Int16 & _rValue)112cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int16& _rValue)
113cdf0e10cSrcweir {
114cdf0e10cSrcweir _rValue = _rxInStream->readShort();
115cdf0e10cSrcweir return _rxInStream;
116cdf0e10cSrcweir }
117cdf0e10cSrcweir
118cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,sal_Int16 _nValue)119cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int16 _nValue)
120cdf0e10cSrcweir {
121cdf0e10cSrcweir _rxOutStream->writeShort(_nValue);
122cdf0e10cSrcweir return _rxOutStream;
123cdf0e10cSrcweir }
124cdf0e10cSrcweir
125cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,sal_uInt16 & _rValue)126cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt16& _rValue)
127cdf0e10cSrcweir {
128cdf0e10cSrcweir _rValue = _rxInStream->readShort();
129cdf0e10cSrcweir return _rxInStream;
130cdf0e10cSrcweir }
131cdf0e10cSrcweir
132cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,sal_uInt16 _nValue)133cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt16 _nValue)
134cdf0e10cSrcweir {
135cdf0e10cSrcweir _rxOutStream->writeShort(_nValue);
136cdf0e10cSrcweir return _rxOutStream;
137cdf0e10cSrcweir }
138cdf0e10cSrcweir
139cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,sal_uInt32 & _rValue)140cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt32& _rValue)
141cdf0e10cSrcweir {
142cdf0e10cSrcweir _rValue = _rxInStream->readLong();
143cdf0e10cSrcweir return _rxInStream;
144cdf0e10cSrcweir }
145cdf0e10cSrcweir
146cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,sal_uInt32 _nValue)147cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt32 _nValue)
148cdf0e10cSrcweir {
149cdf0e10cSrcweir _rxOutStream->writeLong(_nValue);
150cdf0e10cSrcweir return _rxOutStream;
151cdf0e10cSrcweir }
152cdf0e10cSrcweir
153cdf0e10cSrcweir //------------------------------------------------------------------------------
operator >>(const staruno::Reference<stario::XObjectInputStream> & _rxInStream,sal_Int32 & _rValue)154cdf0e10cSrcweir const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int32& _rValue)
155cdf0e10cSrcweir {
156cdf0e10cSrcweir _rValue = _rxInStream->readLong();
157cdf0e10cSrcweir return _rxInStream;
158cdf0e10cSrcweir }
159cdf0e10cSrcweir
160cdf0e10cSrcweir //------------------------------------------------------------------------------
operator <<(const staruno::Reference<stario::XObjectOutputStream> & _rxOutStream,sal_Int32 _nValue)161cdf0e10cSrcweir const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int32 _nValue)
162cdf0e10cSrcweir {
163cdf0e10cSrcweir _rxOutStream->writeLong(_nValue);
164cdf0e10cSrcweir return _rxOutStream;
165cdf0e10cSrcweir }
166cdf0e10cSrcweir
167cdf0e10cSrcweir //.........................................................................
168cdf0e10cSrcweir } // namespace comphelper
169cdf0e10cSrcweir //.........................................................................
170cdf0e10cSrcweir
171