Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <comphelper/basicio.hxx>
21 :
22 :
23 : namespace comphelper
24 : {
25 :
26 :
27 :
28 2 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (
29 : const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream,
30 : const css::awt::FontDescriptor& _rFont)
31 : {
32 2 : _rxOutStream->writeUTF( _rFont.Name );
33 2 : _rxOutStream->writeShort( _rFont.Height );
34 2 : _rxOutStream->writeShort( _rFont.Width );
35 2 : _rxOutStream->writeUTF( _rFont.StyleName );
36 2 : _rxOutStream->writeShort( _rFont.Family );
37 2 : _rxOutStream->writeShort( _rFont.CharSet );
38 2 : _rxOutStream->writeShort( _rFont.Pitch );
39 2 : _rxOutStream->writeDouble( _rFont.CharacterWidth );
40 2 : _rxOutStream->writeDouble( _rFont.Weight );
41 2 : _rxOutStream->writeShort( static_cast< sal_Int16 >(_rFont.Slant) );
42 2 : _rxOutStream->writeShort( _rFont.Underline );
43 2 : _rxOutStream->writeShort( _rFont.Strikeout );
44 2 : _rxOutStream->writeDouble( _rFont.Orientation );
45 2 : _rxOutStream->writeBoolean( _rFont.Kerning );
46 2 : _rxOutStream->writeBoolean( _rFont.WordLineMode );
47 2 : _rxOutStream->writeShort( _rFont.Type );
48 2 : return _rxOutStream;
49 : }
50 :
51 : // FontDescriptor
52 :
53 2 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (
54 : const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream,
55 : css::awt::FontDescriptor& _rFont)
56 : {
57 : // schreiben des Fontdescriptors
58 2 : _rFont.Name = _rxInStream->readUTF();
59 2 : _rFont.Height = _rxInStream->readShort();
60 2 : _rFont.Width = _rxInStream->readShort();
61 2 : _rFont.StyleName = _rxInStream->readUTF();
62 2 : _rFont.Family = _rxInStream->readShort();
63 2 : _rFont.CharSet = _rxInStream->readShort();
64 2 : _rFont.Pitch = _rxInStream->readShort();
65 2 : _rFont.CharacterWidth = static_cast< float >(_rxInStream->readDouble());
66 2 : _rFont.Weight = static_cast< float >(_rxInStream->readDouble());
67 2 : _rFont.Slant = (css::awt::FontSlant)_rxInStream->readShort();
68 2 : _rFont.Underline = _rxInStream->readShort();
69 2 : _rFont.Strikeout = _rxInStream->readShort();
70 2 : _rFont.Orientation = static_cast< float >(_rxInStream->readDouble());
71 2 : _rFont.Kerning = _rxInStream->readBoolean();
72 2 : _rFont.WordLineMode = _rxInStream->readBoolean();
73 2 : _rFont.Type = _rxInStream->readShort();
74 2 : return _rxInStream;
75 : }
76 :
77 :
78 1 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, bool& _rVal)
79 : {
80 1 : _rVal = _rxInStream->readBoolean();
81 1 : return _rxInStream;
82 : }
83 :
84 :
85 1 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, bool _bVal)
86 : {
87 1 : _rxOutStream->writeBoolean(_bVal);
88 1 : return _rxOutStream;
89 : }
90 :
91 :
92 96 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, OUString& rStr)
93 : {
94 96 : rStr = _rxInStream->readUTF();
95 96 : return _rxInStream;
96 : }
97 :
98 :
99 96 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, const OUString& rStr)
100 : {
101 96 : _rxOutStream->writeUTF(rStr);
102 96 : return _rxOutStream;
103 : }
104 :
105 :
106 5 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, sal_Int16& _rValue)
107 : {
108 5 : _rValue = _rxInStream->readShort();
109 5 : return _rxInStream;
110 : }
111 :
112 :
113 5 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, sal_Int16 _nValue)
114 : {
115 5 : _rxOutStream->writeShort(_nValue);
116 5 : return _rxOutStream;
117 : }
118 :
119 :
120 2 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, sal_uInt16& _rValue)
121 : {
122 2 : _rValue = _rxInStream->readShort();
123 2 : return _rxInStream;
124 : }
125 :
126 :
127 2 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, sal_uInt16 _nValue)
128 : {
129 2 : _rxOutStream->writeShort(_nValue);
130 2 : return _rxOutStream;
131 : }
132 :
133 :
134 0 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, sal_uInt32& _rValue)
135 : {
136 0 : _rValue = _rxInStream->readLong();
137 0 : return _rxInStream;
138 : }
139 :
140 :
141 0 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, sal_uInt32 _nValue)
142 : {
143 0 : _rxOutStream->writeLong(_nValue);
144 0 : return _rxOutStream;
145 : }
146 :
147 :
148 2 : const css::uno::Reference<css::io::XObjectInputStream>& operator >> (const css::uno::Reference<css::io::XObjectInputStream>& _rxInStream, sal_Int32& _rValue)
149 : {
150 2 : _rValue = _rxInStream->readLong();
151 2 : return _rxInStream;
152 : }
153 :
154 :
155 2 : const css::uno::Reference<css::io::XObjectOutputStream>& operator << (const css::uno::Reference<css::io::XObjectOutputStream>& _rxOutStream, sal_Int32 _nValue)
156 : {
157 2 : _rxOutStream->writeLong(_nValue);
158 2 : return _rxOutStream;
159 : }
160 :
161 :
162 : } // namespace comphelper
163 :
164 :
165 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|