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 {
31 namespace frame {
32 
33 struct ArrayImpl;
34 class Style;
35 
64 {
65 public:
67  explicit Array();
68 
70  ~Array();
71 
72  // array size and column/row indexes
73 
75  void Initialize( size_t nWidth, size_t nHeight );
76 
78  size_t GetColCount() const;
79 
81  size_t GetRowCount() const;
82 
84  size_t GetCellCount() const;
85 
87  size_t GetCellIndex( size_t nCol, size_t nRow, bool bRTL) const;
88 
89  // cell border styles
90 
92  void SetCellStyleLeft( size_t nCol, size_t nRow, const Style& rStyle );
93 
95  void SetCellStyleRight( size_t nCol, size_t nRow, const Style& rStyle );
96 
98  void SetCellStyleTop( size_t nCol, size_t nRow, const Style& rStyle );
99 
101  void SetCellStyleBottom( size_t nCol, size_t nRow, const Style& rStyle );
102 
104  void SetCellStyleTLBR( size_t nCol, size_t nRow, const Style& rStyle );
105 
107  void SetCellStyleBLTR( size_t nCol, size_t nRow, const Style& rStyle );
108 
110  void SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, const Style& rBLTR );
111 
113  void SetColumnStyleLeft( size_t nCol, const Style& rStyle );
114 
116  void SetColumnStyleRight( size_t nCol, const Style& rStyle );
117 
119  void SetRowStyleTop( size_t nRow, const Style& rStyle );
120 
122  void SetRowStyleBottom( size_t nRow, const Style& rStyle );
123 
125  void SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation);
126 
128  bool HasCellRotation() const;
129 
135  const Style& GetCellStyleLeft( size_t nCol, size_t nRow ) const;
136 
142  const Style& GetCellStyleRight( size_t nCol, size_t nRow ) const;
143 
149  const Style& GetCellStyleTop( size_t nCol, size_t nRow ) const;
150 
156  const Style& GetCellStyleBottom( size_t nCol, size_t nRow ) const;
157 
162  const Style& GetCellStyleTLBR( size_t nCol, size_t nRow ) const;
163 
168  const Style& GetCellStyleBLTR( size_t nCol, size_t nRow ) const;
169 
176  const Style& GetCellStyleTL( size_t nCol, size_t nRow ) const;
177 
184  const Style& GetCellStyleBR( size_t nCol, size_t nRow ) const;
185 
192  const Style& GetCellStyleBL( size_t nCol, size_t nRow ) const;
193 
200  const Style& GetCellStyleTR( size_t nCol, size_t nRow ) const;
201 
202  // cell merging
203 
206  void SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
207 
211  void SetAddMergedLeftSize( size_t nCol, size_t nRow, long nAddSize );
212 
216  void SetAddMergedRightSize( size_t nCol, size_t nRow, long nAddSize );
217 
221  void SetAddMergedTopSize( size_t nCol, size_t nRow, long nAddSize );
222 
226  void SetAddMergedBottomSize( size_t nCol, size_t nRow, long nAddSize );
227 
229  bool IsMerged( size_t nCol, size_t nRow ) const;
230 
232  void GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const;
233 
235  void GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow,
236  size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const;
237 
238  // clipping
239 
249  void SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
250 
251  // cell coordinates
252 
254  void SetXOffset( long nXOffset );
255 
257  void SetYOffset( long nYOffset );
258 
260  void SetColWidth( size_t nCol, long nWidth );
261 
263  void SetRowHeight( size_t nRow, long nHeight );
264 
266  void SetAllColWidths( long nWidth );
267 
269  void SetAllRowHeights( long nHeight );
270 
274  long GetColPosition( size_t nCol ) const;
275 
279  long GetRowPosition( size_t nRow ) const;
280 
282  long GetColWidth( size_t nFirstCol, size_t nLastCol ) const;
283 
285  long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const;
286 
288  long GetWidth() const;
289 
291  long GetHeight() const;
292 
295  basegfx::B2DRange GetCellRange( size_t nCol, size_t nRow, bool bExpandMerged ) const;
296 
297  // mirroring
298 
300  void MirrorSelfX();
301 
302  // drawing
303 
307  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange(
308  size_t nFirstCol, size_t nFirstRow,
309  size_t nLastCol, size_t nLastRow,
310  const Color* pForceColor ) const;
311 
313  drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const;
314 
315 private:
316  std::unique_ptr<ArrayImpl> mxImpl;
317 };
318 
319 }
320 }
321 
322 #endif
323 
324 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxRotateMode
Definition: rotmodit.hxx:29
exports com.sun.star. frame
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:101
Stores frame styles of an array of cells, supports merged ranges.