LibreOffice Module sc (master)  1
autofmt.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_SC_SOURCE_UI_INC_AUTOFMT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_AUTOFMT_HXX
22 
23 #include <svx/framelinkarray.hxx>
24 #include <scdllapi.h>
25 #include <vcl/customweld.hxx>
26 
27 namespace com::sun::star::i18n { class XBreakIterator; }
28 
29 class ScAutoFormatData;
30 class SvxBoxItem;
31 class SvxLineItem;
32 class SvNumberFormatter;
33 class VirtualDevice;
34 class ScViewData;
35 
37 {
38 public:
40  void DetectRTL(const ScViewData *pViewData);
41  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
42  virtual ~ScAutoFmtPreview() override;
43 
44  void NotifyChange( ScAutoFormatData* pNewData );
45 
46 protected:
47  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
48  virtual void Resize() override;
49 
50 private:
53  css::uno::Reference<css::i18n::XBreakIterator> xBreakIter;
54  bool bFitWidth;
56  bool mbRTL;
62  const OUString aStrJan;
63  const OUString aStrFeb;
64  const OUString aStrMar;
65  const OUString aStrNorth;
66  const OUString aStrMid;
67  const OUString aStrSouth;
68  const OUString aStrSum;
69  std::unique_ptr<SvNumberFormatter> pNumFmt;
70 
71  SAL_DLLPRIVATE void Init();
72  SAL_DLLPRIVATE void DoPaint(vcl::RenderContext& rRenderContext);
73  SAL_DLLPRIVATE void CalcCellArray(bool bFitWidth);
74  SAL_DLLPRIVATE void CalcLineMap();
75  SAL_DLLPRIVATE void PaintCells(vcl::RenderContext& rRenderContext);
76 
77 /* Usage of type size_t instead of SCCOL/SCROW is correct here - used in
78  conjunction with class svx::frame::Array (svx/framelinkarray.hxx), which
79  expects size_t coordinates. */
80 
81  SAL_DLLPRIVATE sal_uInt16 GetFormatIndex( size_t nCol, size_t nRow ) const;
82  SAL_DLLPRIVATE const SvxBoxItem& GetBoxItem( size_t nCol, size_t nRow ) const;
83  SAL_DLLPRIVATE const SvxLineItem& GetDiagItem( size_t nCol, size_t nRow, bool bTLBR ) const;
84 
85  SAL_DLLPRIVATE void DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow);
86  SAL_DLLPRIVATE void DrawBackground(vcl::RenderContext& rRenderContext);
87 
88  SAL_DLLPRIVATE void MakeFonts(vcl::RenderContext const& rRenderContext, sal_uInt16 nIndex,
89  vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont);
90 };
91 
92 #endif // INCLUDED_SC_SOURCE_UI_INC_AUTOFMT_HXX
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::i18n::XBreakIterator > xBreakIter
Definition: autofmt.hxx:53
void Init()
long Long
const OUString aStrJan
Definition: autofmt.hxx:62
const OUString aStrFeb
Definition: autofmt.hxx:63
const OUString aStrNorth
Definition: autofmt.hxx:65
const OUString aStrMar
Definition: autofmt.hxx:64
tools::Long mnDataColWidth1
Definition: autofmt.hxx:59
ScopedVclPtrInstance< VirtualDevice > aVD
Definition: autofmt.hxx:52
ScAutoFormatData * pCurData
Definition: autofmt.hxx:51
const OUString aStrSouth
Definition: autofmt.hxx:67
svx::frame::Array maArray
Definition: autofmt.hxx:55
bool mbRTL
Implementation to draw the frame borders.
Definition: autofmt.hxx:56
const OUString aStrSum
Definition: autofmt.hxx:68
const OUString aStrMid
Definition: autofmt.hxx:66
tools::Long mnDataColWidth2
Definition: autofmt.hxx:60
tools::Long mnLabelColWidth
Definition: autofmt.hxx:58
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
std::unique_ptr< SvNumberFormatter > pNumFmt
Definition: autofmt.hxx:69
tools::Long mnRowHeight
Definition: autofmt.hxx:61
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)=0
#define SC_DLLPUBLIC
Definition: scdllapi.h:28