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( size_t nWidth, size_t nHeight );
75 
77  size_t GetColCount() const;
78 
80  size_t GetRowCount() const;
81 
83  size_t GetCellCount() const;
84 
86  size_t GetCellIndex( size_t nCol, size_t nRow, bool bRTL) const;
87 
88  // cell border styles
89 
91  void SetCellStyleLeft( size_t nCol, size_t nRow, const Style& rStyle );
92 
94  void SetCellStyleRight( size_t nCol, size_t nRow, const Style& rStyle );
95 
97  void SetCellStyleTop( size_t nCol, size_t nRow, const Style& rStyle );
98 
100  void SetCellStyleBottom( size_t nCol, size_t nRow, const Style& rStyle );
101 
103  void SetCellStyleTLBR( size_t nCol, size_t nRow, const Style& rStyle );
104 
106  void SetCellStyleBLTR( size_t nCol, size_t nRow, const Style& rStyle );
107 
109  void SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, const Style& rBLTR );
110 
112  void SetColumnStyleLeft( size_t nCol, const Style& rStyle );
113 
115  void SetColumnStyleRight( size_t nCol, const Style& rStyle );
116 
118  void SetRowStyleTop( size_t nRow, const Style& rStyle );
119 
121  void SetRowStyleBottom( size_t nRow, const Style& rStyle );
122 
124  void SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation);
125 
127  bool HasCellRotation() const;
128 
134  const Style& GetCellStyleLeft( size_t nCol, size_t nRow ) const;
135 
141  const Style& GetCellStyleRight( size_t nCol, size_t nRow ) const;
142 
148  const Style& GetCellStyleTop( size_t nCol, size_t nRow ) const;
149 
155  const Style& GetCellStyleBottom( size_t nCol, size_t nRow ) const;
156 
161  const Style& GetCellStyleTLBR( size_t nCol, size_t nRow ) const;
162 
167  const Style& GetCellStyleBLTR( size_t nCol, size_t nRow ) const;
168 
175  const Style& GetCellStyleTL( size_t nCol, size_t nRow ) const;
176 
183  const Style& GetCellStyleBR( size_t nCol, size_t nRow ) const;
184 
191  const Style& GetCellStyleBL( size_t nCol, size_t nRow ) const;
192 
199  const Style& GetCellStyleTR( size_t nCol, size_t nRow ) const;
200 
201  // cell merging
202 
205  void SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
206 
210  void SetAddMergedLeftSize( size_t nCol, size_t nRow, tools::Long nAddSize );
211 
215  void SetAddMergedRightSize( size_t nCol, size_t nRow, tools::Long nAddSize );
216 
220  void SetAddMergedTopSize( size_t nCol, size_t nRow, tools::Long nAddSize );
221 
225  void SetAddMergedBottomSize( size_t nCol, size_t nRow, tools::Long nAddSize );
226 
228  bool IsMerged( size_t nCol, size_t nRow ) const;
229 
231  void GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const;
232 
234  void GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow,
235  size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const;
236 
237  // clipping
238 
248  void SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
249 
250  // cell coordinates
251 
253  void SetXOffset( tools::Long nXOffset );
254 
256  void SetYOffset( tools::Long nYOffset );
257 
259  void SetColWidth( size_t nCol, tools::Long nWidth );
260 
262  void SetRowHeight( size_t nRow, tools::Long nHeight );
263 
265  void SetAllColWidths( tools::Long nWidth );
266 
268  void SetAllRowHeights( tools::Long nHeight );
269 
273  tools::Long GetColPosition( size_t nCol ) const;
274 
278  tools::Long GetRowPosition( size_t nRow ) const;
279 
281  tools::Long GetColWidth( size_t nFirstCol, size_t nLastCol ) const;
282 
284  tools::Long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const;
285 
287  tools::Long GetWidth() const;
288 
290  tools::Long GetHeight() const;
291 
294  basegfx::B2DRange GetCellRange( size_t nCol, size_t nRow, bool bExpandMerged ) const;
295 
296  // mirroring
297 
299  void MirrorSelfX();
300 
301  // drawing
302 
306  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange(
307  size_t nFirstCol, size_t nFirstRow,
308  size_t nLastCol, size_t nLastRow,
309  const Color* pForceColor ) const;
310 
312  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const;
313 
314 private:
315  std::unique_ptr<ArrayImpl> mxImpl;
316 };
317 
318 }
319 
320 
321 #endif
322 
323 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxRotateMode
Definition: rotmodit.hxx:29
long Long
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.