Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / writerfilter / source / dmapper / TablePositionHandler.hxx
bloba11f103641958c5e774ed1e81aebbb965d551470
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
10 #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
12 #include "LoggedResources.hxx"
14 namespace com
16 namespace sun
18 namespace star
20 namespace beans
22 struct PropertyValue;
28 namespace writerfilter
30 namespace dmapper
33 /// Handler for floating table positioning
34 class TablePositionHandler
35 : public LoggedProperties
37 OUString m_aVertAnchor;
38 OUString m_aYSpec;
39 OUString m_aHorzAnchor;
40 OUString m_aXSpec;
41 sal_Int32 m_nY = 0;
42 sal_Int32 m_nX = 0;
43 sal_Int32 m_nLeftFromText = 0;
44 sal_Int32 m_nRightFromText = 0;
45 sal_Int32 m_nTopFromText = 0;
46 sal_Int32 m_nBottomFromText = 0;
48 // Properties
49 void lcl_attribute(Id nId, Value& rVal) override;
50 void lcl_sprm(Sprm& sprm) override;
52 public:
53 sal_Int32 getY() const
55 return m_nY;
57 sal_Int32 getX() const
59 return m_nX;
61 sal_Int32 getLeftFromText() const
63 return m_nLeftFromText;
65 sal_Int32 getRightFromText() const
67 return m_nRightFromText;
69 sal_Int32 getTopFromText() const
71 return m_nTopFromText;
73 sal_Int32 getBottomFromText() const
75 return m_nBottomFromText;
78 const OUString& getVertAnchor() const
80 return m_aVertAnchor;
82 const OUString& getYSpec() const
84 return m_aYSpec;
86 const OUString& getHorzAnchor() const
88 return m_aHorzAnchor;
90 const OUString& getXSpec() const
92 return m_aXSpec;
95 TablePositionHandler();
96 ~TablePositionHandler() override;
98 /** Compute the UNO properties for the frame containing the table based
99 on the received tokens.
101 Note that the properties will need to be adjusted with the table
102 properties before actually using them.
104 css::uno::Sequence<css::beans::PropertyValue> getTablePosition() const;
106 bool operator== (const TablePositionHandler& rHandler) const;
109 using TablePositionHandlerPtr = tools::SvRef<TablePositionHandler>;
110 } // namespace dmapper
111 } // namespace writerfilter
113 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */