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_TAUTOFMT_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_TAUTOFMT_HXX
22 #include <tools/link.hxx>
23 #include <sfx2/basedlgs.hxx>
24 #include <sal/types.h>
25 #include <rtl/ustring.hxx>
26 #include <vcl/weld.hxx>
29 #include "autoformatpreview.hxx"
30 #include <tblafmt.hxx>
32 class SwTableAutoFormat
;
33 class SwTableAutoFormatTable
;
36 class SwAutoFormatDlg final
: public SfxDialogController
41 OUString m_aStrDelTitle
;
42 OUString m_aStrDelMsg
;
43 OUString m_aStrRenameTitle
;
44 OUString m_aStrInvalidFormat
;
48 sal_uInt8 m_nDfltStylePos
;
49 bool m_bCoreDataChanged
: 1;
50 bool m_bSetAutoFormat
: 1;
52 AutoFormatPreview m_aWndPreview
;
53 std::unique_ptr
<SwTableAutoFormatTable
> m_xTableTable
;
55 std::unique_ptr
<weld::TreeView
> m_xLbFormat
;
56 std::unique_ptr
<weld::CheckButton
> m_xBtnNumFormat
;
57 std::unique_ptr
<weld::CheckButton
> m_xBtnBorder
;
58 std::unique_ptr
<weld::CheckButton
> m_xBtnFont
;
59 std::unique_ptr
<weld::CheckButton
> m_xBtnPattern
;
60 std::unique_ptr
<weld::CheckButton
> m_xBtnAlignment
;
61 std::unique_ptr
<weld::Button
> m_xBtnCancel
;
62 std::unique_ptr
<weld::Button
> m_xBtnAdd
;
63 std::unique_ptr
<weld::Button
> m_xBtnRemove
;
64 std::unique_ptr
<weld::Button
> m_xBtnRename
;
65 std::unique_ptr
<weld::CustomWeld
> m_xWndPreview
;
67 void Init( const SwTableAutoFormat
* pSelFormat
);
68 void UpdateChecks( const SwTableAutoFormat
&, bool bEnableBtn
);
70 DECL_LINK(CheckHdl
, weld::Toggleable
&, void);
71 DECL_LINK(AddHdl
, weld::Button
&, void);
72 DECL_LINK(RemoveHdl
, weld::Button
&, void);
73 DECL_LINK(RenameHdl
, weld::Button
&, void);
74 DECL_LINK(SelFormatHdl
, weld::TreeView
&, void);
77 SwAutoFormatDlg(weld::Window
* pParent
, SwWrtShell
* pShell
,
78 bool bSetAutoFormat
, const SwTableAutoFormat
* pSelFormat
);
80 virtual short run() override
;
82 std::unique_ptr
<SwTableAutoFormat
> FillAutoFormatOfIndex() const;
84 virtual ~SwAutoFormatDlg() override
;
87 #endif // SW_AUTOFMT_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */