tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / cui / source / inc / tabstpge.hxx
blob189e9a579373f3ea7447605512e9466317216ae0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <vcl/customweld.hxx>
22 #include <vcl/weld.hxx>
23 #include <sfx2/tabdlg.hxx>
25 #include <editeng/tstpitem.hxx>
26 #include <svx/flagsdef.hxx>
28 class SvxTabulatorTabPage;
30 // class TabWin_Impl -----------------------------------------------------
32 class TabWin_Impl : public weld::CustomWidgetController
34 private:
35 sal_uInt16 nTabStyle;
37 public:
39 TabWin_Impl() : nTabStyle(0)
42 virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
44 void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; }
47 // class SvxTabulatorTabPage ---------------------------------------------
49 [Description]
50 In this TabPage tabulators are managed.
52 [Items]
53 <SvxTabStopItem><SID_ATTR_TABSTOP>
54 <SfxUInt16Item><SID_ATTR_TABSTOP_DEFAULTS>
55 <SfxUInt16Item><SID_ATTR_TABSTOP_POS>
56 <SfxInt32Item><SID_ATTR_TABSTOP_OFFSET>
59 class SvxTabulatorTabPage : public SfxTabPage
61 static const WhichRangesContainer pRanges;
63 public:
64 SvxTabulatorTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
65 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
66 virtual ~SvxTabulatorTabPage() override;
68 static const WhichRangesContainer & GetRanges() { return pRanges; }
70 virtual bool FillItemSet( SfxItemSet* rSet ) override;
71 virtual void Reset( const SfxItemSet* rSet ) override;
73 void DisableControls( const TabulatorDisableFlags nFlag );
75 protected:
76 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
78 private:
79 // local variables, internal functions
80 SvxTabStop aCurrentTab;
81 std::unique_ptr<SvxTabStopItem> aNewTabs;
82 tools::Long nDefDist;
84 TabWin_Impl m_aLeftWin;
85 TabWin_Impl m_aRightWin;
86 TabWin_Impl m_aCenterWin;
87 TabWin_Impl m_aDezWin;
89 // just to format the numbers, not shown
90 std::unique_ptr<weld::MetricSpinButton> m_xTabSpin;
91 // tabulators and positions
92 std::unique_ptr<weld::EntryTreeView> m_xTabBox;
93 // TabType
94 std::unique_ptr<weld::RadioButton> m_xLeftTab;
95 std::unique_ptr<weld::RadioButton> m_xRightTab;
96 std::unique_ptr<weld::RadioButton> m_xCenterTab;
97 std::unique_ptr<weld::RadioButton> m_xDezTab;
99 std::unique_ptr<weld::Entry> m_xDezChar;
100 std::unique_ptr<weld::Label> m_xDezCharLabel;
102 std::unique_ptr<weld::RadioButton> m_xNoFillChar;
103 std::unique_ptr<weld::RadioButton> m_xFillPoints;
104 std::unique_ptr<weld::RadioButton> m_xFillDashLine ;
105 std::unique_ptr<weld::RadioButton> m_xFillSolidLine;
106 std::unique_ptr<weld::RadioButton> m_xFillSpecial;
107 std::unique_ptr<weld::Entry> m_xFillChar;
109 std::unique_ptr<weld::Button> m_xNewBtn;
110 std::unique_ptr<weld::Button> m_xDelAllBtn;
111 std::unique_ptr<weld::Button> m_xDelBtn;
113 std::unique_ptr<weld::Container> m_xTypeFrame;
114 std::unique_ptr<weld::Container> m_xFillFrame;
116 std::unique_ptr<weld::CustomWeld> m_xLeftWin;
117 std::unique_ptr<weld::CustomWeld> m_xRightWin;
118 std::unique_ptr<weld::CustomWeld> m_xCenterWin;
119 std::unique_ptr<weld::CustomWeld> m_xDezWin;
121 void InitTabPos_Impl( sal_uInt16 nPos = 0 );
122 void SetFillAndTabType_Impl();
123 void NewHdl_Impl(const weld::Button*);
125 OUString FormatTab();
127 // Handler
128 DECL_LINK(NewHdl_Impl, weld::Button&, void);
129 DECL_LINK(DelHdl_Impl, weld::Button&, void);
130 DECL_LINK(DelAllHdl_Impl, weld::Button&, void);
132 DECL_LINK(FillTypeCheckHdl_Impl, weld::Toggleable&, void);
133 DECL_LINK(TabTypeCheckHdl_Impl, weld::Toggleable&, void);
135 DECL_LINK(SelectHdl_Impl, weld::TreeView&, bool);
136 DECL_LINK(ModifyHdl_Impl, weld::ComboBox&, void);
137 DECL_LINK(ReformatHdl_Impl, weld::Widget&, void);
138 DECL_LINK(GetFillCharHdl_Impl, weld::Widget&, void);
139 DECL_LINK(GetDezCharHdl_Impl, weld::Widget&, void);
141 int FindCurrentTab();
143 virtual void PageCreated(const SfxAllItemSet& aSet) override;
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */