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