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/.
10 #ifndef INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFVALUE_HXX
11 #define INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFVALUE_HXX
13 #include <dmapper/resourcemodel.hxx>
23 class XEmbeddedObject
;
33 namespace writerfilter
40 /// Value of an RTF keyword
41 class RTFValue
: public Value
44 using Pointer_t
= tools::SvRef
<RTFValue
>;
45 RTFValue(int nValue
, OUString sValue
, const RTFSprms
& rAttributes
, const RTFSprms
& rSprms
,
46 css::uno::Reference
<css::drawing::XShape
> xShape
,
47 css::uno::Reference
<css::io::XInputStream
> xStream
,
48 css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
, bool bForceString
,
49 const RTFShape
& aShape
, const RTFPicture
& rPicture
);
51 explicit RTFValue(int nValue
);
52 RTFValue(OUString sValue
, bool bForce
= false);
53 explicit RTFValue(const RTFSprms
& rAttributes
);
54 RTFValue(const RTFSprms
& rAttributes
, const RTFSprms
& rSprms
);
55 explicit RTFValue(css::uno::Reference
<css::drawing::XShape
> xShape
);
56 explicit RTFValue(css::uno::Reference
<css::io::XInputStream
> xStream
);
57 explicit RTFValue(css::uno::Reference
<css::embed::XEmbeddedObject
> xObject
);
58 explicit RTFValue(const RTFShape
& aShape
);
59 explicit RTFValue(const RTFPicture
& rPicture
);
61 void setString(const OUString
& sValue
);
62 int getInt() const override
;
63 OUString
getString() const override
;
64 css::uno::Any
getAny() const override
;
65 writerfilter::Reference
<Properties
>::Pointer_t
getProperties() override
;
66 writerfilter::Reference
<BinaryObj
>::Pointer_t
getBinary() override
;
68 std::string
toString() const override
;
71 RTFValue
* CloneWithSprms(RTFSprms
const& rAttributes
, RTFSprms
const& rSprms
);
72 RTFSprms
& getAttributes();
74 RTFShape
& getShape() const;
75 RTFPicture
& getPicture() const;
76 bool equals(const RTFValue
& rOther
) const;
77 RTFValue
& operator=(RTFValue
const& rOther
) = delete;
80 int const m_nValue
= 0;
82 tools::SvRef
<RTFSprms
> m_pAttributes
;
83 tools::SvRef
<RTFSprms
> m_pSprms
;
84 css::uno::Reference
<css::drawing::XShape
> m_xShape
;
85 css::uno::Reference
<css::io::XInputStream
> m_xStream
;
86 css::uno::Reference
<css::embed::XEmbeddedObject
> m_xObject
;
87 bool const m_bForceString
= false;
88 tools::SvRef
<RTFShape
> m_pShape
;
89 tools::SvRef
<RTFPicture
> m_pPicture
;
92 } // namespace writerfilter
94 #endif // INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFVALUE_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */