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  friend class VclPtr<SvxTabulatorTabPage>;
64  static const sal_uInt16 pRanges[];
65 
66 public:
67  virtual ~SvxTabulatorTabPage() override;
68  virtual void dispose() override;
69  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
70  static const sal_uInt16* GetRanges() { return pRanges; }
71 
72  virtual bool FillItemSet( SfxItemSet* rSet ) override;
73  virtual void Reset( const SfxItemSet* rSet ) override;
74 
75  void DisableControls( const TabulatorDisableFlags nFlag );
76 
77 protected:
78  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
79 
80 private:
81  SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet& rSet);
82 
83  // local variables, internal functions
85  std::unique_ptr<SvxTabStopItem> aNewTabs;
86  long nDefDist;
87 
92 
93  // just to format the numbers, not shown
94  std::unique_ptr<weld::MetricSpinButton> m_xTabSpin;
95  // tabulators and positions
96  std::unique_ptr<weld::EntryTreeView> m_xTabBox;
97  // TabType
98  std::unique_ptr<weld::RadioButton> m_xLeftTab;
99  std::unique_ptr<weld::RadioButton> m_xRightTab;
100  std::unique_ptr<weld::RadioButton> m_xCenterTab;
101  std::unique_ptr<weld::RadioButton> m_xDezTab;
102 
103  std::unique_ptr<weld::Entry> m_xDezChar;
104  std::unique_ptr<weld::Label> m_xDezCharLabel;
105 
106  std::unique_ptr<weld::RadioButton> m_xNoFillChar;
107  std::unique_ptr<weld::RadioButton> m_xFillPoints;
108  std::unique_ptr<weld::RadioButton> m_xFillDashLine ;
109  std::unique_ptr<weld::RadioButton> m_xFillSolidLine;
110  std::unique_ptr<weld::RadioButton> m_xFillSpecial;
111  std::unique_ptr<weld::Entry> m_xFillChar;
112 
113  std::unique_ptr<weld::Button> m_xNewBtn;
114  std::unique_ptr<weld::Button> m_xDelAllBtn;
115  std::unique_ptr<weld::Button> m_xDelBtn;
116 
117  std::unique_ptr<weld::Container> m_xTypeFrame;
118  std::unique_ptr<weld::Container> m_xFillFrame;
119 
120  std::unique_ptr<weld::CustomWeld> m_xLeftWin;
121  std::unique_ptr<weld::CustomWeld> m_xRightWin;
122  std::unique_ptr<weld::CustomWeld> m_xCenterWin;
123  std::unique_ptr<weld::CustomWeld> m_xDezWin;
124 
125  void InitTabPos_Impl( sal_uInt16 nPos = 0 );
126  void SetFillAndTabType_Impl();
127  void NewHdl_Impl(const weld::Button*);
128 
129  OUString FormatTab();
130 
131  // Handler
133  DECL_LINK(DelHdl_Impl, weld::Button&, void);
134  DECL_LINK(DelAllHdl_Impl, weld::Button&, void);
135 
136  DECL_LINK(FillTypeCheckHdl_Impl, weld::ToggleButton&, void);
137  DECL_LINK(TabTypeCheckHdl_Impl, weld::ToggleButton&, void);
138 
139  DECL_LINK(SelectHdl_Impl, weld::TreeView&, void);
140  DECL_LINK(ModifyHdl_Impl, weld::ComboBox&, void);
141  DECL_LINK(ReformatHdl_Impl, weld::Widget&, void);
142  DECL_LINK(GetFillCharHdl_Impl, weld::Widget&, void);
143  DECL_LINK(GetDezCharHdl_Impl, weld::Widget&, void);
144 
145  int FindCurrentTab();
146 
147  virtual void PageCreated(const SfxAllItemSet& aSet) override;
148 };
149 
150 #endif // INCLUDED_CUI_SOURCE_INC_TABSTPGE_HXX
151 
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TabWin_Impl m_aCenterWin
Definition: tabstpge.hxx:90
virtual void dispose() override
Definition: tabstpge.cxx:152
TabulatorDisableFlags
virtual ~SvxTabulatorTabPage() override
Definition: tabstpge.cxx:147
const SfxItemSet * pSet
void SetFillAndTabType_Impl()
Definition: tabstpge.cxx:381
std::unique_ptr< weld::RadioButton > m_xFillPoints
Definition: tabstpge.hxx:107
std::unique_ptr< weld::EntryTreeView > m_xTabBox
Definition: tabstpge.hxx:96
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tabstpge.cxx:669
std::unique_ptr< SvxTabStopItem > aNewTabs
Definition: tabstpge.hxx:85
std::unique_ptr< weld::CustomWeld > m_xCenterWin
Definition: tabstpge.hxx:122
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabstpge.cxx:318
void DisableControls(const TabulatorDisableFlags nFlag)
Definition: tabstpge.cxx:275
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: tabstpge.cxx:221
std::unique_ptr< weld::RadioButton > m_xLeftTab
Definition: tabstpge.hxx:98
void InitTabPos_Impl(sal_uInt16 nPos=0)
Definition: tabstpge.cxx:325
OUString FormatTab()
Definition: tabstpge.cxx:639
DECL_LINK(NewHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::Entry > m_xDezChar
Definition: tabstpge.hxx:103
std::unique_ptr< weld::Button > m_xDelAllBtn
Definition: tabstpge.hxx:114
std::unique_ptr< weld::MetricSpinButton > m_xTabSpin
Definition: tabstpge.hxx:94
TabWin_Impl m_aLeftWin
Definition: tabstpge.hxx:88
SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabstpge.cxx:66
std::unique_ptr< weld::RadioButton > m_xFillDashLine
Definition: tabstpge.hxx:108
std::unique_ptr< weld::CustomWeld > m_xRightWin
Definition: tabstpge.hxx:121
std::unique_ptr< weld::RadioButton > m_xRightTab
Definition: tabstpge.hxx:99
TabWin_Impl m_aDezWin
Definition: tabstpge.hxx:91
std::unique_ptr< weld::RadioButton > m_xNoFillChar
Definition: tabstpge.hxx:106
std::unique_ptr< weld::Label > m_xDezCharLabel
Definition: tabstpge.hxx:104
void NewHdl_Impl(const weld::Button *)
Definition: tabstpge.cxx:431
std::unique_ptr< weld::RadioButton > m_xFillSpecial
Definition: tabstpge.hxx:110
std::unique_ptr< weld::RadioButton > m_xCenterTab
Definition: tabstpge.hxx:100
static const sal_uInt16 pRanges[]
Definition: tabstpge.hxx:64
std::unique_ptr< weld::RadioButton > m_xDezTab
Definition: tabstpge.hxx:101
std::unique_ptr< weld::CustomWeld > m_xDezWin
Definition: tabstpge.hxx:123
std::unique_ptr< weld::Container > m_xFillFrame
Definition: tabstpge.hxx:118
std::unique_ptr< weld::RadioButton > m_xFillSolidLine
Definition: tabstpge.hxx:109
std::unique_ptr< weld::Container > m_xTypeFrame
Definition: tabstpge.hxx:117
static const sal_uInt16 * GetRanges()
Definition: tabstpge.hxx:70
TabWin_Impl m_aRightWin
Definition: tabstpge.hxx:89
std::unique_ptr< weld::Entry > m_xFillChar
Definition: tabstpge.hxx:111
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
Definition: tabstpge.cxx:56
DeactivateRC
std::unique_ptr< weld::Button > m_xDelBtn
Definition: tabstpge.hxx:115
std::unique_ptr< weld::CustomWeld > m_xLeftWin
Definition: tabstpge.hxx:120
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabstpge.cxx:226
virtual void DeactivatePage()
void SetTabStyle(sal_uInt16 nStyle)
Definition: tabstpge.hxx:45
std::unique_ptr< weld::Button > m_xNewBtn
Definition: tabstpge.hxx:113
sal_uInt16 nTabStyle
Definition: tabstpge.hxx:36
SvxTabStop aCurrentTab
Definition: tabstpge.hxx:84
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabstpge.cxx:164