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/.
11 #include "LoggedResources.hxx"
13 namespace com::sun::star::beans
18 namespace writerfilter::dmapper
20 /// Handler for floating table positioning
21 class TablePositionHandler
: public LoggedProperties
23 OUString m_aVertAnchor
{ "margin" };
25 OUString m_aHorzAnchor
{ "text" };
29 sal_Int32 m_nLeftFromText
= 0;
30 sal_Int32 m_nRightFromText
= 0;
31 sal_Int32 m_nTopFromText
= 0;
32 sal_Int32 m_nBottomFromText
= 0;
33 Id m_nTableOverlap
= 0;
36 void lcl_attribute(Id nId
, Value
& rVal
) override
;
37 void lcl_sprm(Sprm
& sprm
) override
;
40 sal_Int32
getY() const { return m_nY
; }
41 sal_Int32
getX() const { return m_nX
; }
42 sal_Int32
getLeftFromText() const { return m_nLeftFromText
; }
43 sal_Int32
getRightFromText() const { return m_nRightFromText
; }
44 sal_Int32
getTopFromText() const { return m_nTopFromText
; }
45 sal_Int32
getBottomFromText() const { return m_nBottomFromText
; }
47 const OUString
& getVertAnchor() const { return m_aVertAnchor
; }
48 const OUString
& getYSpec() const { return m_aYSpec
; }
49 const OUString
& getHorzAnchor() const { return m_aHorzAnchor
; }
50 const OUString
& getXSpec() const { return m_aXSpec
; }
52 void setTableOverlap(Id nTableOverlap
) { m_nTableOverlap
= nTableOverlap
; }
54 TablePositionHandler();
55 ~TablePositionHandler() override
;
57 /** Compute the UNO properties for the frame containing the table based
58 on the received tokens.
60 Note that the properties will need to be adjusted with the table
61 properties before actually using them.
63 css::uno::Sequence
<css::beans::PropertyValue
> getTablePosition() const;
65 bool operator==(const TablePositionHandler
& rHandler
) const;
68 using TablePositionHandlerPtr
= tools::SvRef
<TablePositionHandler
>;
69 } // namespace writerfilter::dmapper
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */