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 .
21 #include <com/sun/star/i18n/XBreakIterator.hpp>
22 #include <sal/types.h>
23 #include <svx/framelinkarray.hxx>
24 #include <svl/numformat.hxx>
25 #include <tools/gen.hxx>
26 #include <rtl/ustring.hxx>
27 #include <vcl/customweld.hxx>
28 #include <vcl/font.hxx>
31 #include <tblafmt.hxx>
33 class AutoFormatPreview final
: public weld::CustomWidgetController
38 void NotifyChange(const SwTableAutoFormat
& rNewData
);
40 void DetectRTL(SwWrtShell
const* pWrtShell
);
43 SwTableAutoFormat maCurrentData
;
44 svx::frame::Array maArray
; /// Implementation to draw the frame borders.
48 tools::Long mnLabelColumnWidth
;
49 tools::Long mnDataColumnWidth1
;
50 tools::Long mnDataColumnWidth2
;
51 tools::Long mnRowHeight
;
52 const OUString maStringJan
;
53 const OUString maStringFeb
;
54 const OUString maStringMar
;
55 const OUString maStringNorth
;
56 const OUString maStringMid
;
57 const OUString maStringSouth
;
58 const OUString maStringSum
;
59 std::unique_ptr
<SvNumberFormatter
> mxNumFormat
;
61 uno::Reference
<i18n::XBreakIterator
> m_xBreak
;
64 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
65 virtual void Resize() override
;
66 void CalcCellArray(bool bFitWidth
);
68 void PaintCells(vcl::RenderContext
& rRenderContext
);
70 sal_uInt8
GetFormatIndex(size_t nCol
, size_t nRow
) const;
72 void DrawString(vcl::RenderContext
& rRenderContext
, size_t nCol
, size_t nRow
);
73 void DrawBackground(vcl::RenderContext
& rRenderContext
);
75 void MakeFonts(vcl::RenderContext
const& rRenderContext
, sal_uInt8 nIndex
, vcl::Font
& rFont
,
76 vcl::Font
& rCJKFont
, vcl::Font
& rCTLFont
);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */