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_INSTABLE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_INSTABLE_HXX
22 #include <sfx2/basedlgs.hxx>
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
25 #include <tools/link.hxx>
26 #include <vcl/textfilter.hxx>
29 #include "autoformatpreview.hxx"
31 #include <tblafmt.hxx>
32 #include <itabenum.hxx>
34 class SwInsTableDlg
: public SfxDialogController
36 TextFilter m_aTextFilter
;
39 SwTableAutoFormatTable
* pTableTable
;
40 SwTableAutoFormat
* pTAutoFormat
;
44 sal_uInt8 minTableIndexInLb
;
45 sal_uInt8 maxTableIndexInLb
;
46 sal_Int64 nEnteredValRepeatHeaderNF
;
48 AutoFormatPreview m_aWndPreview
;
50 std::unique_ptr
<weld::Entry
> m_xNameEdit
;
51 std::unique_ptr
<weld::Label
> m_xWarning
;
52 std::unique_ptr
<weld::SpinButton
> m_xColSpinButton
;
53 std::unique_ptr
<weld::SpinButton
> m_xRowSpinButton
;
54 std::unique_ptr
<weld::CheckButton
> m_xHeaderCB
;
55 std::unique_ptr
<weld::CheckButton
> m_xRepeatHeaderCB
;
56 std::unique_ptr
<weld::SpinButton
> m_xRepeatHeaderNF
;
57 std::unique_ptr
<weld::Widget
> m_xRepeatGroup
;
58 std::unique_ptr
<weld::CheckButton
> m_xDontSplitCB
;
59 std::unique_ptr
<weld::Button
> m_xInsertBtn
;
60 std::unique_ptr
<weld::TreeView
> m_xLbFormat
;
61 std::unique_ptr
<weld::CustomWeld
> m_xWndPreview
;
62 std::unique_ptr
<weld::Frame
> m_xStyleFrame
;
64 // Returns 255 if mapping is not possible.
65 // This means there cannot be more than 255 autotable style.
66 sal_uInt8
lbIndexToTableIndex(const sal_uInt8 listboxIndex
);
67 void InitAutoTableFormat();
69 DECL_LINK(TextFilterHdl
, OUString
&, bool);
70 DECL_LINK(SelFormatHdl
, weld::TreeView
&, void);
71 DECL_LINK(ModifyName
, weld::Entry
&, void);
72 DECL_LINK(ModifyRowCol
, weld::Entry
&, void);
73 DECL_LINK(OKHdl
, weld::Button
&, void);
74 DECL_LINK(CheckBoxHdl
, weld::ToggleButton
&, void);
75 DECL_LINK(RepeatHeaderCheckBoxHdl
, weld::ToggleButton
&, void);
76 DECL_LINK(ModifyRepeatHeaderNF_Hdl
, weld::SpinButton
&, void);
79 SwInsTableDlg(SwView
& rView
);
81 void GetValues(OUString
& rName
, sal_uInt16
& rRow
, sal_uInt16
& rCol
,
82 SwInsertTableOptions
& rInsTableOpts
, OUString
& rTableAutoFormatName
,
83 std::unique_ptr
<SwTableAutoFormat
>& prTAFormat
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */