1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
12 #include <dmapper/resourcemodel.hxx>
14 namespace com::sun::star
18 class XEmbeddedObject
;
26 namespace writerfilter::rtftok
31 /// Value of an RTF keyword
32 class RTFValue
: public Value
34 RTFValue(int nValue
, OUString sValue
, const RTFSprms
* pAttributes
, const RTFSprms
* pSprms
,
35 css::uno::Reference
<css::drawing::XShape
> xShape
,
36 css::uno::Reference
<css::io::XInputStream
> xStream
,
37 css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
, bool bForceString
,
38 const RTFShape
* pShape
, const RTFPicture
* pPicture
);
41 using Pointer_t
= tools::SvRef
<RTFValue
>;
43 explicit RTFValue(int nValue
);
44 RTFValue(OUString sValue
, bool bForce
= false);
45 explicit RTFValue(const RTFSprms
& rAttributes
);
46 RTFValue(const RTFSprms
& rAttributes
, const RTFSprms
& rSprms
);
47 explicit RTFValue(css::uno::Reference
<css::drawing::XShape
> xShape
);
48 explicit RTFValue(css::uno::Reference
<css::io::XInputStream
> xStream
);
49 explicit RTFValue(css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
);
50 explicit RTFValue(const RTFShape
& aShape
);
51 explicit RTFValue(const RTFPicture
& rPicture
);
53 void setString(const OUString
& sValue
);
54 int getInt() const override
;
55 OUString
getString() const override
;
56 css::uno::Any
getAny() const override
;
57 writerfilter::Reference
<Properties
>::Pointer_t
getProperties() override
;
58 writerfilter::Reference
<BinaryObj
>::Pointer_t
getBinary() override
;
60 std::string
toString() const override
;
62 RTFValue
* Clone() const;
63 RTFValue
* CloneWithSprms(RTFSprms
const& rAttributes
, RTFSprms
const& rSprms
) const;
64 RTFSprms
& getAttributes() const;
65 RTFSprms
& getSprms() const;
66 RTFShape
& getShape() const;
67 RTFPicture
& getPicture() const;
68 bool equals(const RTFValue
& rOther
) const;
69 RTFValue
& operator=(RTFValue
const& rOther
) = delete;
74 mutable tools::SvRef
<RTFSprms
> m_pAttributes
;
75 mutable tools::SvRef
<RTFSprms
> m_pSprms
;
76 css::uno::Reference
<css::drawing::XShape
> m_xShape
;
77 css::uno::Reference
<css::io::XInputStream
> m_xStream
;
78 css::uno::Reference
<css::embed::XEmbeddedObject
> m_xObject
;
79 bool m_bForceString
= false;
80 mutable tools::SvRef
<RTFShape
> m_pShape
;
81 mutable tools::SvRef
<RTFPicture
> m_pPicture
;
83 } // namespace writerfilter::rtftok
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */