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 negativ first-line indentation
30 long mlRight
; // the unproblematic right edge
34 virtual int operator==( const SfxPoolItem
& ) const;
35 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
36 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
38 virtual OUString
GetValueText() const;
39 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
40 SfxMapUnit eCoreMetric
,
41 SfxMapUnit ePresMetric
,
42 OUString
&rText
, const IntlWrapper
* = 0 ) const;
44 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
47 SVX_DLLPRIVATE
const SvxLongLRSpaceItem
& operator=(const SvxLongLRSpaceItem
&); // n.i.
51 SvxLongLRSpaceItem(long lLeft
, long lRight
, sal_uInt16 nId
);
52 SvxLongLRSpaceItem(const SvxLongLRSpaceItem
&);
56 long GetRight() const;
57 void SetLeft(long lArgLeft
);
58 void SetRight(long lArgRight
);
61 class SVX_DLLPUBLIC SvxLongULSpaceItem
: public SfxPoolItem
63 long mlLeft
; // nLeft or the negative first-line indentation
64 long mlRight
; // the unproblematic right edge
68 virtual int operator==( const SfxPoolItem
& ) const;
69 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
70 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
72 virtual OUString
GetValueText() const;
73 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
74 SfxMapUnit eCoreMetric
,
75 SfxMapUnit ePresMetric
,
76 OUString
&rText
, const IntlWrapper
* = 0 ) const;
78 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
81 SVX_DLLPRIVATE
const SvxLongULSpaceItem
& operator=(const SvxLongULSpaceItem
&); // n.i.
85 SvxLongULSpaceItem(long lUpper
, long lLower
, sal_uInt16 nId
);
86 SvxLongULSpaceItem(const SvxLongULSpaceItem
&);
89 long GetUpper() const;
90 long GetLower() const;
91 void SetUpper(long lArgLeft
);
92 void SetLower(long lArgRight
);
95 class SVX_DLLPUBLIC SvxPagePosSizeItem
: public SfxPoolItem
101 virtual int operator==( const SfxPoolItem
& ) const;
102 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
103 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
105 virtual OUString
GetValueText() const;
106 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
107 SfxMapUnit eCoreMetric
,
108 SfxMapUnit ePresMetric
,
109 OUString
&rText
, const IntlWrapper
* = 0 ) const;
111 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
114 SVX_DLLPRIVATE
const SvxPagePosSizeItem
& operator=(const SvxPagePosSizeItem
&); // n.i.
117 SvxPagePosSizeItem(const Point
&rPos
, long lWidth
, long lHeight
);
118 SvxPagePosSizeItem(const SvxPagePosSizeItem
&);
119 SvxPagePosSizeItem();
121 const Point
&GetPos() const { return aPos
; }
122 long GetWidth() const { return lWidth
; }
123 long GetHeight() const { return lHeight
; }
126 struct SVX_DLLPUBLIC SvxColumnDescription
128 long nStart
; /* Start of the column */
129 long nEnd
; /* End of the column */
130 sal_Bool bVisible
; /* Visibility */
132 long nEndMin
; //min. possible position of end
133 long nEndMax
; //max. possible position of end
135 SvxColumnDescription();
137 SvxColumnDescription(const SvxColumnDescription
&rCopy
);
139 SvxColumnDescription(long start
, long end
, sal_Bool bVis
= sal_True
);
141 SvxColumnDescription(long start
, long end
,
142 long endMin
, long endMax
, sal_Bool bVis
= sal_True
);
144 int operator==(const SvxColumnDescription
&rCmp
) const;
145 int operator!=(const SvxColumnDescription
&rCmp
) const;
146 long GetWidth() const;
149 class SVX_DLLPUBLIC SvxColumnItem
: public SfxPoolItem
151 typedef std::vector
<SvxColumnDescription
> SvxColumnDescriptionVector
;
152 SvxColumnDescriptionVector aColumns
; // Column array
154 long nLeft
; // Left edge for the table
155 long nRight
; // Right edge for the table; for columns always
156 // equal to the surrounding frame
157 sal_uInt16 nActColumn
; // the current column
158 sal_uInt8 bTable
; // table?
159 sal_uInt8 bOrtho
; // evenly spread columns
162 virtual int operator==( const SfxPoolItem
& ) const;
164 virtual OUString
GetValueText() const;
166 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
167 SfxMapUnit eCoreMetric
,
168 SfxMapUnit ePresMetric
,
170 const IntlWrapper
* = 0 ) const;
172 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
173 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
174 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
178 // right edge of the surrounding frame
179 // nLeft, nRight each the distance to the surrounding frame
180 SvxColumnItem(sal_uInt16 nAct
= 0);
181 SvxColumnItem(sal_uInt16 nActCol
, sal_uInt16 nLeft
, sal_uInt16 nRight
= 0); // Table with borders
182 SvxColumnItem(const SvxColumnItem
& aItem
);
185 const SvxColumnItem
&operator=(const SvxColumnItem
&);
187 SvxColumnDescription
& operator[](sal_uInt16 index
);
188 const SvxColumnDescription
& operator[](sal_uInt16 index
) const;
189 SvxColumnDescription
& At(sal_uInt16 index
);
190 SvxColumnDescription
& GetActiveColumnDescription();
192 sal_uInt16
Count() const;
193 void Insert(const SvxColumnDescription
& rDesc
, sal_uInt16 nPos
);
194 void Append(const SvxColumnDescription
& rDesc
);
195 void SetLeft(long aLeft
);
196 void SetRight(long aRight
);
197 sal_uInt16
GetActColumn() const;
198 sal_Bool
IsFirstAct() const;
199 sal_Bool
IsLastAct() const;
202 sal_Bool
IsTable() const;
203 sal_Bool
CalcOrtho() const;
204 void SetOrtho(sal_Bool bVal
);
205 sal_Bool
IsConsistent() const;
208 // class SvxObjectItem ---------------------------------------------------
210 class SVX_DLLPUBLIC SvxObjectItem
: public SfxPoolItem
213 long nStartX
; /* Start in x direction */
214 long nEndX
; /* End in x direction */
215 long nStartY
; /* Start in y direction */
216 long nEndY
; /* Ende in y direction */
217 sal_Bool bLimits
; /* boundary limit control by the application */
220 virtual int operator==( const SfxPoolItem
& ) const;
222 virtual OUString
GetValueText() const;
223 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
224 SfxMapUnit eCoreMetric
,
225 SfxMapUnit ePresMetric
,
226 OUString
&rText
, const IntlWrapper
* = 0 ) const;
228 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
229 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
230 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
233 SVX_DLLPRIVATE
const SvxObjectItem
&operator=(const SvxObjectItem
&); // n.i.
237 SvxObjectItem(long nStartX
, long nEndX
,
238 long nStartY
, long nEndY
,
239 sal_Bool bLimits
= sal_False
);
240 SvxObjectItem(const SvxObjectItem
& rCopy
);
242 sal_Bool
HasLimits() const;
244 long GetStartX() const;
245 long GetEndX() const;
246 long GetStartY() const;
247 long GetEndY() const;
249 void SetStartX(long lValue
);
250 void SetEndX(long lValue
);
251 void SetStartY(long lValue
);
252 void SetEndY(long lValue
);
258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */