Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SVX_RULRITEM_HXX
20 : #define INCLUDED_SVX_RULRITEM_HXX
21 :
22 : #include <tools/gen.hxx>
23 : #include <svl/poolitem.hxx>
24 : #include <svx/svxdllapi.h>
25 : #include <vector>
26 :
27 8955 : class SVX_DLLPUBLIC SvxLongLRSpaceItem : public SfxPoolItem
28 : {
29 : long mlLeft; // nLeft or the negativ first-line indentation
30 : long mlRight; // the unproblematic right edge
31 :
32 : protected:
33 :
34 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
35 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
36 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
37 :
38 : virtual bool GetPresentation( SfxItemPresentation ePres,
39 : SfxMapUnit eCoreMetric,
40 : SfxMapUnit ePresMetric,
41 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
42 :
43 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
44 :
45 : private:
46 : const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) SAL_DELETED_FUNCTION;
47 :
48 : public:
49 : TYPEINFO_OVERRIDE();
50 : SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
51 : SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
52 : SvxLongLRSpaceItem();
53 :
54 3291 : long GetLeft() const { return mlLeft;}
55 2919 : long GetRight() const { return mlRight;}
56 : void SetLeft(long lArgLeft);
57 : void SetRight(long lArgRight);
58 : };
59 :
60 9142 : class SVX_DLLPUBLIC SvxLongULSpaceItem : public SfxPoolItem
61 : {
62 : long mlLeft; // nLeft or the negative first-line indentation
63 : long mlRight; // the unproblematic right edge
64 :
65 : protected:
66 :
67 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
68 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
69 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
70 :
71 : virtual bool GetPresentation( SfxItemPresentation ePres,
72 : SfxMapUnit eCoreMetric,
73 : SfxMapUnit ePresMetric,
74 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
75 :
76 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
77 :
78 : private:
79 : const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) SAL_DELETED_FUNCTION;
80 :
81 : public:
82 : TYPEINFO_OVERRIDE();
83 : SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
84 : SvxLongULSpaceItem(const SvxLongULSpaceItem &);
85 : SvxLongULSpaceItem();
86 :
87 1604 : long GetUpper() const { return mlLeft;}
88 1265 : long GetLower() const { return mlRight;}
89 : void SetUpper(long lArgLeft);
90 : void SetLower(long lArgRight);
91 : };
92 :
93 4656 : class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
94 : {
95 : Point aPos;
96 : long lWidth;
97 : long lHeight;
98 : protected:
99 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
100 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
101 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
102 :
103 : virtual bool GetPresentation( SfxItemPresentation ePres,
104 : SfxMapUnit eCoreMetric,
105 : SfxMapUnit ePresMetric,
106 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
107 :
108 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
109 :
110 : private:
111 : const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) SAL_DELETED_FUNCTION;
112 : public:
113 : TYPEINFO_OVERRIDE();
114 : SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
115 : SvxPagePosSizeItem(const SvxPagePosSizeItem &);
116 : SvxPagePosSizeItem();
117 :
118 1162 : const Point &GetPos() const { return aPos; }
119 3496 : long GetWidth() const { return lWidth; }
120 1184 : long GetHeight() const { return lHeight; }
121 : };
122 :
123 : struct SVX_DLLPUBLIC SvxColumnDescription
124 : {
125 : long nStart; /* Start of the column */
126 : long nEnd; /* End of the column */
127 : bool bVisible; /* Visibility */
128 :
129 : long nEndMin; //min. possible position of end
130 : long nEndMax; //max. possible position of end
131 :
132 : SvxColumnDescription();
133 :
134 : SvxColumnDescription(const SvxColumnDescription &rCopy);
135 :
136 : SvxColumnDescription(long start, long end, bool bVis = true);
137 :
138 : SvxColumnDescription(long start, long end,
139 : long endMin, long endMax, bool bVis = true);
140 :
141 : bool operator==(const SvxColumnDescription &rCmp) const;
142 : bool operator!=(const SvxColumnDescription &rCmp) const;
143 : long GetWidth() const;
144 : };
145 :
146 : template<typename charT, typename traits>
147 : inline std::basic_ostream<charT, traits> & operator <<(
148 : std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
149 : {
150 : return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
151 : << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin
152 : << " nEndMax " << dsc.nEndMax << " }";
153 : }
154 :
155 :
156 : class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
157 : {
158 : typedef std::vector<SvxColumnDescription> SvxColumnDescriptionVector;
159 : SvxColumnDescriptionVector aColumns; // Column array
160 :
161 : long nLeft; // Left edge for the table
162 : long nRight; // Right edge for the table; for columns always
163 : // equal to the surrounding frame
164 : sal_uInt16 nActColumn; // the current column
165 : bool bTable; // table?
166 : bool bOrtho; // evenly spread columns
167 :
168 : protected:
169 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
170 :
171 : virtual bool GetPresentation( SfxItemPresentation ePres,
172 : SfxMapUnit eCoreMetric,
173 : SfxMapUnit ePresMetric,
174 : OUString &rText,
175 : const IntlWrapper * = 0 ) const SAL_OVERRIDE;
176 :
177 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
178 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
179 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
180 :
181 : public:
182 : TYPEINFO_OVERRIDE();
183 : // right edge of the surrounding frame
184 : // nLeft, nRight each the distance to the surrounding frame
185 : SvxColumnItem(sal_uInt16 nAct = 0);
186 : SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight = 0); // Table with borders
187 : SvxColumnItem(const SvxColumnItem& aItem);
188 : virtual ~SvxColumnItem();
189 :
190 : const SvxColumnItem &operator=(const SvxColumnItem &);
191 :
192 : SvxColumnDescription& operator[](sal_uInt16 index);
193 : const SvxColumnDescription& operator[](sal_uInt16 index) const;
194 : SvxColumnDescription& At(sal_uInt16 index);
195 : SvxColumnDescription& GetActiveColumnDescription();
196 :
197 : sal_uInt16 Count() const;
198 : void Insert(const SvxColumnDescription& rDesc, sal_uInt16 nPos);
199 : void Append(const SvxColumnDescription& rDesc);
200 : void SetLeft(long aLeft);
201 : void SetRight(long aRight);
202 18 : sal_uInt16 GetActColumn() const { return nActColumn;}
203 : bool IsFirstAct() const;
204 : bool IsLastAct() const;
205 8 : long GetLeft() { return nLeft;}
206 8 : long GetRight() { return nRight;}
207 6 : bool IsTable() const { return bTable;}
208 : bool CalcOrtho() const;
209 : void SetOrtho(bool bVal);
210 : bool IsConsistent() const;
211 : };
212 :
213 : // class SvxObjectItem ---------------------------------------------------
214 :
215 0 : class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
216 : {
217 : private:
218 : long nStartX; /* Start in x direction */
219 : long nEndX; /* End in x direction */
220 : long nStartY; /* Start in y direction */
221 : long nEndY; /* Ende in y direction */
222 : bool bLimits; /* boundary limit control by the application */
223 :
224 : protected:
225 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
226 :
227 : virtual bool GetPresentation( SfxItemPresentation ePres,
228 : SfxMapUnit eCoreMetric,
229 : SfxMapUnit ePresMetric,
230 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
231 :
232 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
233 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
234 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
235 :
236 : private:
237 : const SvxObjectItem &operator=(const SvxObjectItem &) SAL_DELETED_FUNCTION;
238 :
239 : public:
240 : TYPEINFO_OVERRIDE();
241 : SvxObjectItem(long nStartX, long nEndX,
242 : long nStartY, long nEndY,
243 : bool bLimits = false);
244 : SvxObjectItem(const SvxObjectItem& rCopy);
245 :
246 0 : bool HasLimits() const { return bLimits;}
247 :
248 0 : long GetStartX() const { return nStartX;}
249 0 : long GetEndX() const { return nEndX;}
250 0 : long GetStartY() const { return nStartY;}
251 0 : long GetEndY() const { return nEndY;}
252 :
253 : void SetStartX(long lValue);
254 : void SetEndX(long lValue);
255 : void SetStartY(long lValue);
256 : void SetEndY(long lValue);
257 : };
258 :
259 :
260 : #endif
261 :
262 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|