1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_AUTOFORMATPREVIEW_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_AUTOFORMATPREVIEW_HXX
22 #include <com/sun/star/i18n/XBreakIterator.hpp>
23 #include <sal/types.h>
24 #include <svx/framelinkarray.hxx>
25 #include <svl/zforlist.hxx>
26 #include <tools/gen.hxx>
27 #include <rtl/ustring.hxx>
28 #include <vcl/customweld.hxx>
29 #include <vcl/font.hxx>
32 #include <tblafmt.hxx>
34 class AutoFormatPreview
: public weld::CustomWidgetController
39 void NotifyChange(const SwTableAutoFormat
& rNewData
);
41 void DetectRTL(SwWrtShell
const* pWrtShell
);
44 SwTableAutoFormat maCurrentData
;
45 svx::frame::Array maArray
; /// Implementation to draw the frame borders.
49 tools::Long mnLabelColumnWidth
;
50 tools::Long mnDataColumnWidth1
;
51 tools::Long mnDataColumnWidth2
;
52 tools::Long mnRowHeight
;
53 const OUString maStringJan
;
54 const OUString maStringFeb
;
55 const OUString maStringMar
;
56 const OUString maStringNorth
;
57 const OUString maStringMid
;
58 const OUString maStringSouth
;
59 const OUString maStringSum
;
60 std::unique_ptr
<SvNumberFormatter
> mxNumFormat
;
62 uno::Reference
<i18n::XBreakIterator
> m_xBreak
;
65 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
66 virtual void Resize() override
;
67 void CalcCellArray(bool bFitWidth
);
69 void PaintCells(vcl::RenderContext
& rRenderContext
);
71 sal_uInt8
GetFormatIndex(size_t nCol
, size_t nRow
) const;
73 void DrawString(vcl::RenderContext
& rRenderContext
, size_t nCol
, size_t nRow
);
74 void DrawBackground(vcl::RenderContext
& rRenderContext
);
76 void MakeFonts(vcl::RenderContext
const& rRenderContext
, sal_uInt8 nIndex
, vcl::Font
& rFont
,
77 vcl::Font
& rCJKFont
, vcl::Font
& rCTLFont
);
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */