LibreOffice Module svx (master)  1
rulritem.hxx
Go to the documentation of this file.
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 
28 {
29  long mlLeft; // nLeft or the negative first-line indentation
30  long mlRight; // the unproblematic right edge
31 
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;
35 
36  virtual bool GetPresentation( SfxItemPresentation ePres,
37  MapUnit eCoreMetric,
38  MapUnit ePresMetric,
39  OUString &rText, const IntlWrapper& ) const override;
40 
41  virtual SvxLongLRSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override;
42 
43  const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) = delete;
44 
45 public:
46  static SfxPoolItem* CreateDefault();
47  SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
49 
50  long GetLeft() const { return mlLeft;}
51  long GetRight() const { return mlRight;}
52  void SetLeft(long lArgLeft);
53  void SetRight(long lArgRight);
54 };
55 
57 {
58  long mlLeft; // nLeft or the negative first-line indentation
59  long mlRight; // the unproblematic right edge
60 
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;
64 
65  virtual bool GetPresentation( SfxItemPresentation ePres,
66  MapUnit eCoreMetric,
67  MapUnit ePresMetric,
68  OUString &rText, const IntlWrapper& ) const override;
69 
70  virtual SvxLongULSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override;
71 
72  const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) = delete;
73 
74 public:
75  static SfxPoolItem* CreateDefault();
76  SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
78 
79  long GetUpper() const { return mlLeft;}
80  long GetLower() const { return mlRight;}
81  void SetUpper(long lArgLeft);
82  void SetLower(long lArgRight);
83 };
84 
86 {
88  long lWidth;
89  long lHeight;
90 
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;
94 
95  virtual bool GetPresentation( SfxItemPresentation ePres,
96  MapUnit eCoreMetric,
97  MapUnit ePresMetric,
98  OUString &rText, const IntlWrapper& ) const override;
99 
100  virtual SvxPagePosSizeItem* Clone( SfxItemPool *pPool = nullptr ) const override;
101 
102 private:
103  const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) = delete;
104 public:
105  static SfxPoolItem* CreateDefault();
106  SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
108 
109  const Point &GetPos() const { return aPos; }
110  long GetWidth() const { return lWidth; }
111  long GetHeight() const { return lHeight; }
112 };
113 
115 {
116  long nStart; /* Start of the column */
117  long nEnd; /* End of the column */
118  bool bVisible; /* Visibility */
119 
120  long nEndMin; //min. possible position of end
121  long nEndMax; //max. possible position of end
122 
123  SvxColumnDescription(long start, long end, bool bVis);
124 
125  SvxColumnDescription(long start, long end,
126  long endMin, long endMax, bool bVis);
127 
128  bool operator==(const SvxColumnDescription &rCmp) const;
129  bool operator!=(const SvxColumnDescription &rCmp) const;
130  long GetWidth() const;
131 };
132 
133 template<typename charT, typename traits>
134 inline std::basic_ostream<charT, traits> & operator <<(
135  std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
136 {
137  return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
138  << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin
139  << " nEndMax " << dsc.nEndMax << " }";
140 }
141 
142 
144 {
145  std::vector<SvxColumnDescription> aColumns; // Column array
146 
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
153 
154  virtual bool operator==( const SfxPoolItem& ) const override;
155 
156  virtual bool GetPresentation( SfxItemPresentation ePres,
157  MapUnit eCoreMetric,
158  MapUnit ePresMetric,
159  OUString &rText,
160  const IntlWrapper& ) const override;
161 
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;
165 
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
172 
173  SvxColumnDescription& operator[](sal_uInt16 index);
174  const SvxColumnDescription& operator[](sal_uInt16 index) const;
175  SvxColumnDescription& At(sal_uInt16 index);
176  SvxColumnDescription& GetActiveColumnDescription();
177 
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;
191 };
192 
194 {
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 */
200 
201  virtual bool operator==( const SfxPoolItem& ) const override;
202 
203  virtual bool GetPresentation( SfxItemPresentation ePres,
204  MapUnit eCoreMetric,
205  MapUnit ePresMetric,
206  OUString &rText, const IntlWrapper& ) const override;
207 
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;
211 
212  const SvxObjectItem &operator=(const SvxObjectItem &) = delete;
213 
214 public:
215  static SfxPoolItem* CreateDefault();
216  SvxObjectItem(long nStartX, long nEndX,
217  long nStartY, long nEndY);
218 
219  long GetStartX() const { return nStartX;}
220  long GetEndX() const { return nEndX;}
221  long GetStartY() const { return nStartY;}
222  long GetEndY() const { return nEndY;}
223 
224  void SetStartX(long lValue);
225  void SetEndX(long lValue);
226  void SetStartY(long lValue);
227  void SetEndY(long lValue);
228 };
229 
230 #endif
231 
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
long GetEndX() const
Definition: rulritem.hxx:220
SfxPoolItem & operator=(const SfxPoolItem &)=delete
std::vector< SvxColumnDescription > aColumns
Definition: rulritem.hxx:145
bool IsTable() const
Definition: rulritem.hxx:187
long GetWidth() const
Definition: rulritem.hxx:110
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
long GetRight() const
Definition: rulritem.hxx:186
long GetLower() const
Definition: rulritem.hxx:80
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
sal_uInt16 nActColumn
Definition: rulritem.hxx:150
SfxItemPresentation
long GetStartY() const
Definition: rulritem.hxx:221
Count
long GetHeight() const
Definition: rulritem.hxx:111
long GetRight() const
Definition: rulritem.hxx:51
bool operator!=(const ScCsvLayoutData &rData1, const ScCsvLayoutData &rData2)
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
long GetLeft() const
Definition: rulritem.hxx:50
unsigned char sal_uInt8
sal_uInt16 GetActColumn() const
Definition: rulritem.hxx:182
const Point & GetPos() const
Definition: rulritem.hxx:109
MapUnit
long GetLeft() const
Definition: rulritem.hxx:185
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, SvxColumnDescription const &dsc)
Definition: rulritem.hxx:134
long GetEndY() const
Definition: rulritem.hxx:222
long GetUpper() const
Definition: rulritem.hxx:79
bool operator==(const ScCsvLayoutData &rData1, const ScCsvLayoutData &rData2)
long GetStartX() const
Definition: rulritem.hxx:219