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_CUI_SOURCE_INC_TABSTPGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
22 #include <vcl/customweld.hxx>
23 #include <vcl/weld.hxx>
24 #include <sfx2/tabdlg.hxx>
26 #include <editeng/tstpitem.hxx>
27 #include <svx/flagsdef.hxx>
29 class SvxTabulatorTabPage
;
31 // class TabWin_Impl -----------------------------------------------------
33 class TabWin_Impl
: public weld::CustomWidgetController
40 TabWin_Impl() : nTabStyle(0)
43 virtual void Paint(vcl::RenderContext
& rRenderContext
, const ::tools::Rectangle
& rRect
) override
;
45 void SetTabStyle(sal_uInt16 nStyle
) {nTabStyle
= nStyle
; }
48 // class SvxTabulatorTabPage ---------------------------------------------
51 In this TabPage tabulators are managed.
54 <SvxTabStopItem><SID_ATTR_TABSTOP>
55 <SfxUInt16Item><SID_ATTR_TABSTOP_DEFAULTS>
56 <SfxUInt16Item><SID_ATTR_TABSTOP_POS>
57 <SfxInt32Item><SID_ATTR_TABSTOP_OFFSET>
60 class SvxTabulatorTabPage
: public SfxTabPage
62 static const sal_uInt16 pRanges
[];
65 SvxTabulatorTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
66 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rSet
);
67 virtual ~SvxTabulatorTabPage() override
;
69 static const sal_uInt16
* GetRanges() { return pRanges
; }
71 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
72 virtual void Reset( const SfxItemSet
* rSet
) override
;
74 void DisableControls( const TabulatorDisableFlags nFlag
);
77 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
80 // local variables, internal functions
81 SvxTabStop aCurrentTab
;
82 std::unique_ptr
<SvxTabStopItem
> aNewTabs
;
85 TabWin_Impl m_aLeftWin
;
86 TabWin_Impl m_aRightWin
;
87 TabWin_Impl m_aCenterWin
;
88 TabWin_Impl m_aDezWin
;
90 // just to format the numbers, not shown
91 std::unique_ptr
<weld::MetricSpinButton
> m_xTabSpin
;
92 // tabulators and positions
93 std::unique_ptr
<weld::EntryTreeView
> m_xTabBox
;
95 std::unique_ptr
<weld::RadioButton
> m_xLeftTab
;
96 std::unique_ptr
<weld::RadioButton
> m_xRightTab
;
97 std::unique_ptr
<weld::RadioButton
> m_xCenterTab
;
98 std::unique_ptr
<weld::RadioButton
> m_xDezTab
;
100 std::unique_ptr
<weld::Entry
> m_xDezChar
;
101 std::unique_ptr
<weld::Label
> m_xDezCharLabel
;
103 std::unique_ptr
<weld::RadioButton
> m_xNoFillChar
;
104 std::unique_ptr
<weld::RadioButton
> m_xFillPoints
;
105 std::unique_ptr
<weld::RadioButton
> m_xFillDashLine
;
106 std::unique_ptr
<weld::RadioButton
> m_xFillSolidLine
;
107 std::unique_ptr
<weld::RadioButton
> m_xFillSpecial
;
108 std::unique_ptr
<weld::Entry
> m_xFillChar
;
110 std::unique_ptr
<weld::Button
> m_xNewBtn
;
111 std::unique_ptr
<weld::Button
> m_xDelAllBtn
;
112 std::unique_ptr
<weld::Button
> m_xDelBtn
;
114 std::unique_ptr
<weld::Container
> m_xTypeFrame
;
115 std::unique_ptr
<weld::Container
> m_xFillFrame
;
117 std::unique_ptr
<weld::CustomWeld
> m_xLeftWin
;
118 std::unique_ptr
<weld::CustomWeld
> m_xRightWin
;
119 std::unique_ptr
<weld::CustomWeld
> m_xCenterWin
;
120 std::unique_ptr
<weld::CustomWeld
> m_xDezWin
;
122 void InitTabPos_Impl( sal_uInt16 nPos
= 0 );
123 void SetFillAndTabType_Impl();
124 void NewHdl_Impl(const weld::Button
*);
126 OUString
FormatTab();
129 DECL_LINK(NewHdl_Impl
, weld::Button
&, void);
130 DECL_LINK(DelHdl_Impl
, weld::Button
&, void);
131 DECL_LINK(DelAllHdl_Impl
, weld::Button
&, void);
133 DECL_LINK(FillTypeCheckHdl_Impl
, weld::ToggleButton
&, void);
134 DECL_LINK(TabTypeCheckHdl_Impl
, weld::ToggleButton
&, void);
136 DECL_LINK(SelectHdl_Impl
, weld::TreeView
&, bool);
137 DECL_LINK(ModifyHdl_Impl
, weld::ComboBox
&, void);
138 DECL_LINK(ReformatHdl_Impl
, weld::Widget
&, void);
139 DECL_LINK(GetFillCharHdl_Impl
, weld::Widget
&, void);
140 DECL_LINK(GetDezCharHdl_Impl
, weld::Widget
&, void);
142 int FindCurrentTab();
144 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
147 #endif // INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */