Bump version to 6.4-15
[LibreOffice.git] / include / svx / rulritem.hxx
blob25e1ce88be92e08ed621b97efb0850b1f4929edc
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_RULRITEM_HXX
20 #define INCLUDED_SVX_RULRITEM_HXX
22 #include <tools/gen.hxx>
23 #include <svl/poolitem.hxx>
24 #include <svx/svxdllapi.h>
25 #include <vector>
27 class SVX_DLLPUBLIC SvxLongLRSpaceItem final : public SfxPoolItem
29 long mlLeft; // nLeft or the negative first-line indentation
30 long mlRight; // the unproblematic right edge
32 virtual bool operator==( const SfxPoolItem& ) const override;
33 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
34 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
36 virtual bool GetPresentation( SfxItemPresentation ePres,
37 MapUnit eCoreMetric,
38 MapUnit ePresMetric,
39 OUString &rText, const IntlWrapper& ) const override;
41 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
43 const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) = delete;
45 public:
46 static SfxPoolItem* CreateDefault();
47 SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
48 SvxLongLRSpaceItem();
50 long GetLeft() const { return mlLeft;}
51 long GetRight() const { return mlRight;}
52 void SetLeft(long lArgLeft);
53 void SetRight(long lArgRight);
56 class SVX_DLLPUBLIC SvxLongULSpaceItem final : public SfxPoolItem
58 long mlLeft; // nLeft or the negative first-line indentation
59 long mlRight; // the unproblematic right edge
61 virtual bool operator==( const SfxPoolItem& ) const override;
62 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
63 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
65 virtual bool GetPresentation( SfxItemPresentation ePres,
66 MapUnit eCoreMetric,
67 MapUnit ePresMetric,
68 OUString &rText, const IntlWrapper& ) const override;
70 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
72 const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) = delete;
74 public:
75 static SfxPoolItem* CreateDefault();
76 SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
77 SvxLongULSpaceItem();
79 long GetUpper() const { return mlLeft;}
80 long GetLower() const { return mlRight;}
81 void SetUpper(long lArgLeft);
82 void SetLower(long lArgRight);
85 class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
87 Point aPos;
88 long lWidth;
89 long lHeight;
90 protected:
91 virtual bool operator==( const SfxPoolItem& ) const override;
92 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
93 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
95 virtual bool GetPresentation( SfxItemPresentation ePres,
96 MapUnit eCoreMetric,
97 MapUnit ePresMetric,
98 OUString &rText, const IntlWrapper& ) const override;
100 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
102 private:
103 const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) = delete;
104 public:
105 static SfxPoolItem* CreateDefault();
106 SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
107 SvxPagePosSizeItem();
109 const Point &GetPos() const { return aPos; }
110 long GetWidth() const { return lWidth; }
111 long GetHeight() const { return lHeight; }
114 struct SVX_DLLPUBLIC SvxColumnDescription
116 long nStart; /* Start of the column */
117 long nEnd; /* End of the column */
118 bool bVisible; /* Visibility */
120 long nEndMin; //min. possible position of end
121 long nEndMax; //max. possible position of end
123 SvxColumnDescription(long start, long end, bool bVis);
125 SvxColumnDescription(long start, long end,
126 long endMin, long endMax, bool bVis);
128 bool operator==(const SvxColumnDescription &rCmp) const;
129 bool operator!=(const SvxColumnDescription &rCmp) const;
130 long GetWidth() const;
133 template<typename charT, typename traits>
134 inline std::basic_ostream<charT, traits> & operator <<(
135 std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
137 return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
138 << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin
139 << " nEndMax " << dsc.nEndMax << " }";
143 class SVX_DLLPUBLIC SvxColumnItem final : public SfxPoolItem
145 std::vector<SvxColumnDescription> aColumns; // Column array
147 long nLeft; // Left edge for the table
148 long nRight; // Right edge for the table; for columns always
149 // equal to the surrounding frame
150 sal_uInt16 nActColumn; // the current column
151 bool bTable; // table?
152 bool bOrtho; // evenly spread columns
154 virtual bool operator==( const SfxPoolItem& ) const override;
156 virtual bool GetPresentation( SfxItemPresentation ePres,
157 MapUnit eCoreMetric,
158 MapUnit ePresMetric,
159 OUString &rText,
160 const IntlWrapper& ) const override;
162 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
163 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
164 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
166 public:
167 static SfxPoolItem* CreateDefault();
168 // right edge of the surrounding frame
169 // nLeft, nRight each the distance to the surrounding frame
170 SvxColumnItem(sal_uInt16 nAct = 0);
171 SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders
173 SvxColumnDescription& operator[](sal_uInt16 index);
174 const SvxColumnDescription& operator[](sal_uInt16 index) const;
175 SvxColumnDescription& At(sal_uInt16 index);
176 SvxColumnDescription& GetActiveColumnDescription();
178 sal_uInt16 Count() const;
179 void Append(const SvxColumnDescription& rDesc);
180 void SetLeft(long aLeft);
181 void SetRight(long aRight);
182 sal_uInt16 GetActColumn() const { return nActColumn;}
183 bool IsFirstAct() const;
184 bool IsLastAct() const;
185 long GetLeft() const { return nLeft;}
186 long GetRight() const { return nRight;}
187 bool IsTable() const { return bTable;}
188 bool CalcOrtho() const;
189 void SetOrtho(bool bVal);
190 bool IsConsistent() const;
193 class SVX_DLLPUBLIC SvxObjectItem final : public SfxPoolItem
195 long nStartX; /* Start in x direction */
196 long nEndX; /* End in x direction */
197 long nStartY; /* Start in y direction */
198 long nEndY; /* End in y direction */
199 bool bLimits; /* boundary limit control by the application */
201 virtual bool operator==( const SfxPoolItem& ) const override;
203 virtual bool GetPresentation( SfxItemPresentation ePres,
204 MapUnit eCoreMetric,
205 MapUnit ePresMetric,
206 OUString &rText, const IntlWrapper& ) const override;
208 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
209 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
210 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
212 const SvxObjectItem &operator=(const SvxObjectItem &) = delete;
214 public:
215 static SfxPoolItem* CreateDefault();
216 SvxObjectItem(long nStartX, long nEndX,
217 long nStartY, long nEndY);
219 long GetStartX() const { return nStartX;}
220 long GetEndX() const { return nEndX;}
221 long GetStartY() const { return nStartY;}
222 long GetEndY() const { return nEndY;}
224 void SetStartX(long lValue);
225 void SetEndX(long lValue);
226 void SetStartY(long lValue);
227 void SetEndY(long lValue);
230 #endif
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */