bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / filter / ww8 / rtfstringbuffer.hxx
blobd02a56d91109b248e25270e2ecd4d53f4998bdf5
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
9 #ifndef _RTFSTRINGBUFFER_HXX_
10 #define _RTFSTRINGBUFFER_HXX_
12 #include <rtl/strbuf.hxx>
13 #include <vector>
15 class SwGrfNode;
16 class SwFlyFrmFmt;
17 class RtfAttributeOutput;
19 /// Contains a buffered string or graphic during RTF export.
20 class RtfStringBufferValue
22 public:
23 /// Constructor for a string buffering.
24 RtfStringBufferValue();
25 /// Constructor for graphic buffering.
26 RtfStringBufferValue(const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode* pGrfNode);
27 /// This version handles graphics.
28 void makeStringAndClear(RtfAttributeOutput* pAttributeOutput);
29 /// This one doesn't.
30 OString makeStringAndClear();
31 bool isGraphic() const;
33 OStringBuffer m_aBuffer;
34 const SwFlyFrmFmt* m_pFlyFrmFmt;
35 const SwGrfNode* m_pGrfNode;
38 /// Wrapper around OStringBuffers, so less hexdump of graphics have to be kept in memory during RTF export.
39 class RtfStringBuffer
41 public:
42 RtfStringBuffer();
43 /// Length of all the contained buffers.
44 sal_Int32 getLength() const;
45 /// Writes the contents of the buffer directly to the supplied stream.
46 void makeStringAndClear(RtfAttributeOutput* pAttributeOutput);
47 /// Returns the bufferent strings as a string (ignores graphic elements!)
48 OString makeStringAndClear();
49 /// Access to the last buffer.
50 OStringBuffer& getLastBuffer();
51 OStringBuffer* operator->();
52 /// Similar to ->setLength(0), but for all buffers.
53 void clear();
54 /// Same as ->append(), but for graphics and without expanding contents to save memory.
55 void append(const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode* pGrfNode);
56 /// Append all contained buffers and clear the argument.
57 void appendAndClear(RtfStringBuffer& rBuf);
58 private:
59 typedef std::vector<RtfStringBufferValue> Values_t;
60 Values_t m_aValues;
63 #endif // _RTFSTRINGBUFFER_HXX_
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */