LibreOffice Module svx (master)  1
framelinkarray.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 
20 #ifndef INCLUDED_SVX_FRAMELINKARRAY_HXX
21 #define INCLUDED_SVX_FRAMELINKARRAY_HXX
22 
24 #include <svx/svxdllapi.h>
25 #include <svx/rotmodit.hxx>
26 #include <memory>
27 
28 class Color;
29 
30 namespace svx::frame {
31 
32 struct ArrayImpl;
33 class Style;
34 
63 {
64 public:
66  explicit Array();
67 
69  ~Array();
70 
71  // array size and column/row indexes
72 
74  void Initialize( sal_Int32 nWidth, sal_Int32 nHeight );
75 
77  sal_Int32 GetColCount() const;
78 
80  sal_Int32 GetRowCount() const;
81 
83  sal_Int32 GetCellCount() const;
84 
86  sal_Int32 GetCellIndex( sal_Int32 nCol, sal_Int32 nRow, bool bRTL) const;
87 
88  // cell border styles
89 
91  void SetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
92 
94  void SetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
95 
97  void SetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
98 
100  void SetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
101 
103  void SetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
104 
106  void SetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
107 
109  void SetCellStyleDiag( sal_Int32 nCol, sal_Int32 nRow, const Style& rTLBR, const Style& rBLTR );
110 
112  void SetColumnStyleLeft( sal_Int32 nCol, const Style& rStyle );
113 
115  void SetColumnStyleRight( sal_Int32 nCol, const Style& rStyle );
116 
118  void SetRowStyleTop( sal_Int32 nRow, const Style& rStyle );
119 
121  void SetRowStyleBottom( sal_Int32 nRow, const Style& rStyle );
122 
124  void SetCellRotation(sal_Int32 nCol, sal_Int32 nRow, SvxRotateMode eRotMode, double fOrientation);
125 
127  bool HasCellRotation() const;
128 
134  const Style& GetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow ) const;
135 
141  const Style& GetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow ) const;
142 
148  const Style& GetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow ) const;
149 
155  const Style& GetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow ) const;
156 
161  const Style& GetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow ) const;
162 
167  const Style& GetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow ) const;
168 
175  const Style& GetCellStyleTL( sal_Int32 nCol, sal_Int32 nRow ) const;
176 
183  const Style& GetCellStyleBR( sal_Int32 nCol, sal_Int32 nRow ) const;
184 
191  const Style& GetCellStyleBL( sal_Int32 nCol, sal_Int32 nRow ) const;
192 
199  const Style& GetCellStyleTR( sal_Int32 nCol, sal_Int32 nRow ) const;
200 
201  // cell merging
202 
205  void SetMergedRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
206 
210  void SetAddMergedLeftSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
211 
215  void SetAddMergedRightSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
216 
220  void SetAddMergedTopSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
221 
225  void SetAddMergedBottomSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
226 
228  bool IsMerged( sal_Int32 nCol, sal_Int32 nRow ) const;
229 
231  void GetMergedOrigin( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow, sal_Int32 nCol, sal_Int32 nRow ) const;
232 
234  void GetMergedRange( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow,
235  sal_Int32& rnLastCol, sal_Int32& rnLastRow, sal_Int32 nCol, sal_Int32 nRow ) const;
236 
237  // clipping
238 
248  void SetClipRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
249 
250  // cell coordinates
251 
253  void SetXOffset( sal_Int32 nXOffset );
254 
256  void SetYOffset( sal_Int32 nYOffset );
257 
259  void SetColWidth( sal_Int32 nCol, sal_Int32 nWidth );
260 
262  void SetRowHeight( sal_Int32 nRow, sal_Int32 nHeight );
263 
265  void SetAllColWidths( sal_Int32 nWidth );
266 
268  void SetAllRowHeights( sal_Int32 nHeight );
269 
273  sal_Int32 GetColPosition( sal_Int32 nCol ) const;
274 
278  sal_Int32 GetRowPosition( sal_Int32 nRow ) const;
279 
281  sal_Int32 GetColWidth( sal_Int32 nFirstCol, sal_Int32 nLastCol ) const;
282 
284  sal_Int32 GetRowHeight( sal_Int32 nFirstRow, sal_Int32 nLastRow ) const;
285 
287  sal_Int32 GetWidth() const;
288 
290  sal_Int32 GetHeight() const;
291 
294  basegfx::B2DRange GetCellRange( sal_Int32 nCol, sal_Int32 nRow ) const;
295 
296  // return output range of given row/col range in logical coordinates
297  basegfx::B2DRange GetB2DRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ) const;
298 
299  // mirroring
300 
302  void MirrorSelfX();
303 
304  // drawing
305 
309  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange(
310  sal_Int32 nFirstCol, sal_Int32 nFirstRow,
311  sal_Int32 nLastCol, sal_Int32 nLastRow,
312  const Color* pForceColor ) const;
313 
315  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const;
316 
317 private:
318  std::unique_ptr<ArrayImpl> mxImpl;
319 };
320 
321 }
322 
323 
324 #endif
325 
326 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxRotateMode
Definition: rotmodit.hxx:29
std::unique_ptr< ArrayImpl > mxImpl
#define SAL_WARN_UNUSED
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
Contains the widths of primary and secondary line of a frame style.
Definition: framelink.hxx:98
Stores frame styles of an array of cells, supports merged ranges.