LibreOffice Module cui (master)  1
tabstpge.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
21 
22 #include <vcl/customweld.hxx>
23 #include <vcl/weld.hxx>
24 #include <sfx2/tabdlg.hxx>
25 
26 #include <editeng/tstpitem.hxx>
27 #include <svx/flagsdef.hxx>
28 
30 
31 // class TabWin_Impl -----------------------------------------------------
32 
34 {
35 private:
36  sal_uInt16 nTabStyle;
37 
38 public:
39 
40  TabWin_Impl() : nTabStyle(0)
41  {
42  }
43  virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
44 
45  void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; }
46 };
47 
48 // class SvxTabulatorTabPage ---------------------------------------------
49 /*
50  [Description]
51  In this TabPage tabulators are managed.
52 
53  [Items]
54  <SvxTabStopItem><SID_ATTR_TABSTOP>
55  <SfxUInt16Item><SID_ATTR_TABSTOP_DEFAULTS>
56  <SfxUInt16Item><SID_ATTR_TABSTOP_POS>
57  <SfxInt32Item><SID_ATTR_TABSTOP_OFFSET>
58 */
59 
61 {
62  static const sal_uInt16 pRanges[];
63 
64 public:
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;
68 
69  static const sal_uInt16* GetRanges() { return pRanges; }
70 
71  virtual bool FillItemSet( SfxItemSet* rSet ) override;
72  virtual void Reset( const SfxItemSet* rSet ) override;
73 
74  void DisableControls( const TabulatorDisableFlags nFlag );
75 
76 protected:
77  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
78 
79 private:
80  // local variables, internal functions
82  std::unique_ptr<SvxTabStopItem> aNewTabs;
83  long nDefDist;
84 
89 
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;
94  // TabType
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;
99 
100  std::unique_ptr<weld::Entry> m_xDezChar;
101  std::unique_ptr<weld::Label> m_xDezCharLabel;
102 
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;
109 
110  std::unique_ptr<weld::Button> m_xNewBtn;
111  std::unique_ptr<weld::Button> m_xDelAllBtn;
112  std::unique_ptr<weld::Button> m_xDelBtn;
113 
114  std::unique_ptr<weld::Container> m_xTypeFrame;
115  std::unique_ptr<weld::Container> m_xFillFrame;
116 
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;
121 
122  void InitTabPos_Impl( sal_uInt16 nPos = 0 );
123  void SetFillAndTabType_Impl();
124  void NewHdl_Impl(const weld::Button*);
125 
126  OUString FormatTab();
127 
128  // Handler
130  DECL_LINK(DelHdl_Impl, weld::Button&, void);
131  DECL_LINK(DelAllHdl_Impl, weld::Button&, void);
132 
133  DECL_LINK(FillTypeCheckHdl_Impl, weld::ToggleButton&, void);
134  DECL_LINK(TabTypeCheckHdl_Impl, weld::ToggleButton&, void);
135 
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);
141 
142  int FindCurrentTab();
143 
144  virtual void PageCreated(const SfxAllItemSet& aSet) override;
145 };
146 
147 #endif // INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
148 
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TabWin_Impl m_aCenterWin
Definition: tabstpge.hxx:87
TabulatorDisableFlags
virtual ~SvxTabulatorTabPage() override
Definition: tabstpge.cxx:143
const SfxItemSet * pSet
SvxTabulatorTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabstpge.cxx:62
void SetFillAndTabType_Impl()
Definition: tabstpge.cxx:371
std::unique_ptr< weld::RadioButton > m_xFillPoints
Definition: tabstpge.hxx:104
std::unique_ptr< weld::EntryTreeView > m_xTabBox
Definition: tabstpge.hxx:93
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tabstpge.cxx:660
std::unique_ptr< SvxTabStopItem > aNewTabs
Definition: tabstpge.hxx:82
std::unique_ptr< weld::CustomWeld > m_xCenterWin
Definition: tabstpge.hxx:119
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabstpge.cxx:308
void DisableControls(const TabulatorDisableFlags nFlag)
Definition: tabstpge.cxx:265
std::unique_ptr< weld::RadioButton > m_xLeftTab
Definition: tabstpge.hxx:95
void InitTabPos_Impl(sal_uInt16 nPos=0)
Definition: tabstpge.cxx:315
OUString FormatTab()
Definition: tabstpge.cxx:630
DECL_LINK(NewHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::Entry > m_xDezChar
Definition: tabstpge.hxx:100
std::unique_ptr< weld::Button > m_xDelAllBtn
Definition: tabstpge.hxx:111
std::unique_ptr< weld::MetricSpinButton > m_xTabSpin
Definition: tabstpge.hxx:91
TabWin_Impl m_aLeftWin
Definition: tabstpge.hxx:85
std::unique_ptr< weld::RadioButton > m_xFillDashLine
Definition: tabstpge.hxx:105
std::unique_ptr< weld::CustomWeld > m_xRightWin
Definition: tabstpge.hxx:118
std::unique_ptr< weld::RadioButton > m_xRightTab
Definition: tabstpge.hxx:96
TabWin_Impl m_aDezWin
Definition: tabstpge.hxx:88
std::unique_ptr< weld::RadioButton > m_xNoFillChar
Definition: tabstpge.hxx:103
std::unique_ptr< weld::Label > m_xDezCharLabel
Definition: tabstpge.hxx:101
void NewHdl_Impl(const weld::Button *)
Definition: tabstpge.cxx:421
std::unique_ptr< weld::RadioButton > m_xFillSpecial
Definition: tabstpge.hxx:107
std::unique_ptr< weld::RadioButton > m_xCenterTab
Definition: tabstpge.hxx:97
static const sal_uInt16 pRanges[]
Definition: tabstpge.hxx:62
std::unique_ptr< weld::RadioButton > m_xDezTab
Definition: tabstpge.hxx:98
std::unique_ptr< weld::CustomWeld > m_xDezWin
Definition: tabstpge.hxx:120
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: tabstpge.cxx:211
std::unique_ptr< weld::Container > m_xFillFrame
Definition: tabstpge.hxx:115
std::unique_ptr< weld::RadioButton > m_xFillSolidLine
Definition: tabstpge.hxx:106
std::unique_ptr< weld::Container > m_xTypeFrame
Definition: tabstpge.hxx:114
static const sal_uInt16 * GetRanges()
Definition: tabstpge.hxx:69
TabWin_Impl m_aRightWin
Definition: tabstpge.hxx:86
std::unique_ptr< weld::Entry > m_xFillChar
Definition: tabstpge.hxx:108
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
Definition: tabstpge.cxx:52
DeactivateRC
std::unique_ptr< weld::Button > m_xDelBtn
Definition: tabstpge.hxx:112
std::unique_ptr< weld::CustomWeld > m_xLeftWin
Definition: tabstpge.hxx:117
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabstpge.cxx:216
void SetTabStyle(sal_uInt16 nStyle)
Definition: tabstpge.hxx:45
std::unique_ptr< weld::Button > m_xNewBtn
Definition: tabstpge.hxx:110
sal_uInt16 nTabStyle
Definition: tabstpge.hxx:36
SvxTabStop aCurrentTab
Definition: tabstpge.hxx:81
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabstpge.cxx:154