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
: public SfxPoolItem
29 long mlLeft
; // nLeft or the negative first-line indentation
30 long mlRight
; // the unproblematic right edge
34 virtual bool operator==( const SfxPoolItem
& ) const override
;
35 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
36 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
38 virtual bool GetPresentation( SfxItemPresentation ePres
,
41 OUString
&rText
, const IntlWrapper
& ) const override
;
43 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
46 const SvxLongLRSpaceItem
& operator=(const SvxLongLRSpaceItem
&) = delete;
49 static SfxPoolItem
* CreateDefault();
50 SvxLongLRSpaceItem(long lLeft
, long lRight
, sal_uInt16 nId
);
53 long GetLeft() const { return mlLeft
;}
54 long GetRight() const { return mlRight
;}
55 void SetLeft(long lArgLeft
);
56 void SetRight(long lArgRight
);
59 class SVX_DLLPUBLIC SvxLongULSpaceItem
: public SfxPoolItem
61 long mlLeft
; // nLeft or the negative first-line indentation
62 long mlRight
; // the unproblematic right edge
66 virtual bool operator==( const SfxPoolItem
& ) const override
;
67 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
68 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
70 virtual bool GetPresentation( SfxItemPresentation ePres
,
73 OUString
&rText
, const IntlWrapper
& ) const override
;
75 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
78 const SvxLongULSpaceItem
& operator=(const SvxLongULSpaceItem
&) = delete;
81 static SfxPoolItem
* CreateDefault();
82 SvxLongULSpaceItem(long lUpper
, long lLower
, sal_uInt16 nId
);
85 long GetUpper() const { return mlLeft
;}
86 long GetLower() const { return mlRight
;}
87 void SetUpper(long lArgLeft
);
88 void SetLower(long lArgRight
);
91 class SVX_DLLPUBLIC SvxPagePosSizeItem
: public SfxPoolItem
97 virtual bool operator==( const SfxPoolItem
& ) const override
;
98 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
99 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
101 virtual bool GetPresentation( SfxItemPresentation ePres
,
104 OUString
&rText
, const IntlWrapper
& ) const override
;
106 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
109 const SvxPagePosSizeItem
& operator=(const SvxPagePosSizeItem
&) = delete;
111 static SfxPoolItem
* CreateDefault();
112 SvxPagePosSizeItem(const Point
&rPos
, long lWidth
, long lHeight
);
113 SvxPagePosSizeItem();
115 const Point
&GetPos() const { return aPos
; }
116 long GetWidth() const { return lWidth
; }
117 long GetHeight() const { return lHeight
; }
120 struct SVX_DLLPUBLIC SvxColumnDescription
122 long nStart
; /* Start of the column */
123 long nEnd
; /* End of the column */
124 bool bVisible
; /* Visibility */
126 long nEndMin
; //min. possible position of end
127 long nEndMax
; //max. possible position of end
129 SvxColumnDescription(long start
, long end
, bool bVis
);
131 SvxColumnDescription(long start
, long end
,
132 long endMin
, long endMax
, bool bVis
);
134 bool operator==(const SvxColumnDescription
&rCmp
) const;
135 bool operator!=(const SvxColumnDescription
&rCmp
) const;
136 long GetWidth() const;
139 template<typename charT
, typename traits
>
140 inline std::basic_ostream
<charT
, traits
> & operator <<(
141 std::basic_ostream
<charT
, traits
> & stream
, SvxColumnDescription
const& dsc
)
143 return stream
<< "{ nStart " << dsc
.nStart
<< " nEnd " << dsc
.nEnd
144 << " bVisible " << dsc
.bVisible
<< " nEndMin " << dsc
.nEndMin
145 << " nEndMax " << dsc
.nEndMax
<< " }";
149 class SVX_DLLPUBLIC SvxColumnItem
: public SfxPoolItem
151 std::vector
<SvxColumnDescription
> aColumns
; // Column array
153 long nLeft
; // Left edge for the table
154 long nRight
; // Right edge for the table; for columns always
155 // equal to the surrounding frame
156 sal_uInt16 nActColumn
; // the current column
157 bool bTable
; // table?
158 bool bOrtho
; // evenly spread columns
161 virtual bool operator==( const SfxPoolItem
& ) const override
;
163 virtual bool GetPresentation( SfxItemPresentation ePres
,
167 const IntlWrapper
& ) const override
;
169 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
170 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
171 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
174 static SfxPoolItem
* CreateDefault();
175 // right edge of the surrounding frame
176 // nLeft, nRight each the distance to the surrounding frame
177 SvxColumnItem(sal_uInt16 nAct
= 0);
178 SvxColumnItem(sal_uInt16 nActCol
, sal_uInt16 nLeft
, sal_uInt16 nRight
); // Table with borders
180 SvxColumnDescription
& operator[](sal_uInt16 index
);
181 const SvxColumnDescription
& operator[](sal_uInt16 index
) const;
182 SvxColumnDescription
& At(sal_uInt16 index
);
183 SvxColumnDescription
& GetActiveColumnDescription();
185 sal_uInt16
Count() const;
186 void Append(const SvxColumnDescription
& rDesc
);
187 void SetLeft(long aLeft
);
188 void SetRight(long aRight
);
189 sal_uInt16
GetActColumn() const { return nActColumn
;}
190 bool IsFirstAct() const;
191 bool IsLastAct() const;
192 long GetLeft() { return nLeft
;}
193 long GetRight() { return nRight
;}
194 bool IsTable() const { return bTable
;}
195 bool CalcOrtho() const;
196 void SetOrtho(bool bVal
);
197 bool IsConsistent() const;
200 class SVX_DLLPUBLIC SvxObjectItem
: public SfxPoolItem
203 long nStartX
; /* Start in x direction */
204 long nEndX
; /* End in x direction */
205 long nStartY
; /* Start in y direction */
206 long nEndY
; /* End in y direction */
207 bool bLimits
; /* boundary limit control by the application */
210 virtual bool operator==( const SfxPoolItem
& ) const override
;
212 virtual bool GetPresentation( SfxItemPresentation ePres
,
215 OUString
&rText
, const IntlWrapper
& ) const override
;
217 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
218 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
219 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
222 const SvxObjectItem
&operator=(const SvxObjectItem
&) = delete;
225 static SfxPoolItem
* CreateDefault();
226 SvxObjectItem(long nStartX
, long nEndX
,
227 long nStartY
, long nEndY
);
229 long GetStartX() const { return nStartX
;}
230 long GetEndX() const { return nEndX
;}
231 long GetStartY() const { return nStartY
;}
232 long GetEndY() const { return nEndY
;}
234 void SetStartX(long lValue
);
235 void SetEndX(long lValue
);
236 void SetStartY(long lValue
);
237 void SetEndY(long lValue
);
242 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */