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/.
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>
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
,
39 OUString
&rText
, const IntlWrapper
& ) const override
;
41 virtual SvxLongLRSpaceItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
43 const SvxLongLRSpaceItem
& operator=(const SvxLongLRSpaceItem
&) = delete;
46 static SfxPoolItem
* CreateDefault();
47 SvxLongLRSpaceItem(long lLeft
, long lRight
, sal_uInt16 nId
);
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
,
68 OUString
&rText
, const IntlWrapper
& ) const override
;
70 virtual SvxLongULSpaceItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
72 const SvxLongULSpaceItem
& operator=(const SvxLongULSpaceItem
&) = delete;
75 static SfxPoolItem
* CreateDefault();
76 SvxLongULSpaceItem(long lUpper
, long lLower
, sal_uInt16 nId
);
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 final
: public SfxPoolItem
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
,
98 OUString
&rText
, const IntlWrapper
& ) const override
;
100 virtual SvxPagePosSizeItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
103 const SvxPagePosSizeItem
& operator=(const SvxPagePosSizeItem
&) = delete;
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
,
160 const IntlWrapper
& ) const override
;
162 virtual SvxColumnItem
* 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
;
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
,
206 OUString
&rText
, const IntlWrapper
& ) const override
;
208 virtual SvxObjectItem
* 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;
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
);
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */