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 #include <com/sun/star/text/GraphicCrop.hpp>
18 namespace com::sun::star
22 class XEmbeddedObject
;
30 namespace writerfilter::rtftok
35 /// Value of an RTF keyword
36 class RTFValue
: public Value
38 RTFValue(int nValue
, OUString sValue
, const RTFSprms
* pAttributes
, const RTFSprms
* pSprms
,
39 css::uno::Reference
<css::drawing::XShape
> xShape
,
40 css::uno::Reference
<css::io::XInputStream
> xStream
,
41 css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
, bool bForceString
,
42 const RTFShape
* pShape
, const RTFPicture
* pPicture
);
45 using Pointer_t
= tools::SvRef
<RTFValue
>;
47 explicit RTFValue(int nValue
);
48 RTFValue(OUString sValue
, bool bForce
= false);
49 explicit RTFValue(const RTFSprms
& rAttributes
);
50 RTFValue(const RTFSprms
& rAttributes
, const RTFSprms
& rSprms
);
51 explicit RTFValue(css::uno::Reference
<css::drawing::XShape
> xShape
);
52 explicit RTFValue(css::uno::Reference
<css::io::XInputStream
> xStream
);
53 explicit RTFValue(css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
);
54 explicit RTFValue(const RTFShape
& aShape
);
55 explicit RTFValue(const RTFPicture
& rPicture
);
56 explicit RTFValue(css::text::GraphicCrop
const& rCrop
);
58 void setString(const OUString
& sValue
);
59 int getInt() const override
;
60 OUString
getString() const override
;
61 css::uno::Any
getAny() const override
;
62 writerfilter::Reference
<Properties
>::Pointer_t
getProperties() override
;
63 writerfilter::Reference
<BinaryObj
>::Pointer_t
getBinary() override
;
65 std::string
toString() const override
;
67 RTFValue
* Clone() const;
68 RTFValue
* CloneWithSprms(RTFSprms
const& rAttributes
, RTFSprms
const& rSprms
) const;
69 RTFSprms
& getAttributes() const;
70 RTFSprms
& getSprms() const;
71 RTFShape
& getShape() const;
72 RTFPicture
& getPicture() const;
73 bool equals(const RTFValue
& rOther
) const;
74 RTFValue
& operator=(RTFValue
const& rOther
) = delete;
79 mutable tools::SvRef
<RTFSprms
> m_pAttributes
;
80 mutable tools::SvRef
<RTFSprms
> m_pSprms
;
81 css::uno::Reference
<css::drawing::XShape
> m_xShape
;
82 css::uno::Reference
<css::io::XInputStream
> m_xStream
;
83 css::uno::Reference
<css::embed::XEmbeddedObject
> m_xObject
;
84 bool m_bForceString
= false;
85 mutable tools::SvRef
<RTFShape
> m_pShape
;
86 mutable tools::SvRef
<RTFPicture
> m_pPicture
;
87 ::std::optional
<css::text::GraphicCrop
> m_oCrop
;
89 } // namespace writerfilter::rtftok
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */