LibreOffice Module sw (master)  1
num.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_SW_SOURCE_UIBASE_INC_NUM_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_NUM_HXX
21 
22 #include <sfx2/tabdlg.hxx>
23 #include "numprevw.hxx"
24 #include <numrule.hxx>
25 
26 class SwWrtShell;
27 class SvxBrushItem;
28 class SwOutlineTabDialog;
29 
31 {
32  std::unique_ptr<SwNumRule> pActNum;
35 
37  sal_uInt16 nActNumLvl;
38 
39  bool bModified : 1;
40  bool bPreset : 1;
41  bool bInInintControl : 1; // work around modify-error; should be resolved from 391 on
43 
45 
46  std::unique_ptr<weld::TreeView> m_xLevelLB;
47  std::unique_ptr<weld::Widget> m_xPositionFrame;
48 
49  // former set of controls shown for numbering rules containing list level
50  // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
51  std::unique_ptr<weld::Label> m_xDistBorderFT;
52  std::unique_ptr<weld::MetricSpinButton> m_xDistBorderMF;
53  std::unique_ptr<weld::CheckButton> m_xRelativeCB;
54  std::unique_ptr<weld::Label> m_xIndentFT;
55  std::unique_ptr<weld::MetricSpinButton> m_xIndentMF;
56  std::unique_ptr<weld::Label> m_xDistNumFT;
57  std::unique_ptr<weld::MetricSpinButton> m_xDistNumMF;
58  std::unique_ptr<weld::Label> m_xAlignFT;
59  std::unique_ptr<weld::ComboBox> m_xAlignLB;
60 
61  // new set of controls shown for numbering rules containing list level
62  // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
63  std::unique_ptr<weld::Label> m_xLabelFollowedByFT;
64  std::unique_ptr<weld::ComboBox> m_xLabelFollowedByLB;
65  std::unique_ptr<weld::Label> m_xListtabFT;
66  std::unique_ptr<weld::MetricSpinButton> m_xListtabMF;
67  std::unique_ptr<weld::Label> m_xAlign2FT;
68  std::unique_ptr<weld::ComboBox> m_xAlign2LB;
69  std::unique_ptr<weld::Label> m_xAlignedAtFT;
70  std::unique_ptr<weld::MetricSpinButton> m_xAlignedAtMF;
71  std::unique_ptr<weld::Label> m_xIndentAtFT;
72  std::unique_ptr<weld::MetricSpinButton> m_xIndentAtMF;
73  std::unique_ptr<weld::Button> m_xStandardPB;
74  std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
75 
76 
77  void InitControls();
78 
79  DECL_LINK(LevelHdl, weld::TreeView&, void);
80  DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
81  DECL_LINK(DistanceHdl, weld::MetricSpinButton&, void);
82  DECL_LINK(RelativeHdl, weld::ToggleButton&, void);
83  DECL_LINK(StandardHdl, weld::Button&, void);
84 
85  void InitPosAndSpaceMode();
87 
88  DECL_LINK(LabelFollowedByHdl_Impl, weld::ComboBox&, void);
89  DECL_LINK(ListtabPosHdl_Impl, weld::MetricSpinButton&, void);
90  DECL_LINK(AlignAtHdl_Impl, weld::MetricSpinButton&, void);
91  DECL_LINK(IndentAtHdl_Impl, weld::MetricSpinButton&, void);
92 
95 
96 public:
97 
98  SwNumPositionTabPage(TabPageParent pParent, const SfxItemSet& rSet);
99  virtual ~SwNumPositionTabPage() override;
100  virtual void dispose() override;
101 
102  virtual void ActivatePage(const SfxItemSet& rSet) override;
103  virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
104  virtual bool FillItemSet( SfxItemSet* rSet ) override;
105  virtual void Reset( const SfxItemSet* rSet ) override;
106 
107  static VclPtr<SfxTabPage> Create( TabPageParent pParent,
108  const SfxItemSet* rAttrSet);
109 
110  void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
111  void SetWrtShell(SwWrtShell* pSh);
112 #ifdef DBG_UTIL
113  void SetModified();
114 #else
115  void SetModified()
116  {
117  bModified = true;
118  m_aPreviewWIN.SetLevel(nActNumLvl);
119  m_aPreviewWIN.Invalidate();
120  }
121 #endif
122 };
123 
125 {
127 
128  virtual short Ok() override;
129  virtual void PageCreated(const OString& rPageId, SfxTabPage& rPage) override;
130  DECL_LINK(RemoveNumberingHdl, weld::Button&, void);
131 
132  std::unique_ptr<weld::ComboBox> m_xDummyCombo;
133 
134 public:
136  const SfxItemSet* pSwItemSet,
137  SwWrtShell &);
138  virtual ~SwSvxNumBulletTabDialog() override;
139 };
140 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_NUM_HXX
141 
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: num.cxx:347
void SetWrtShell(SwWrtShell *pSh)
Definition: num.cxx:506
SwNumPositionTabPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: num.cxx:58
virtual short Ok() override
Definition: num.cxx:954
SwWrtShell * pWrtSh
Definition: num.hxx:34
NumberingPreview m_aPreviewWIN
Definition: num.hxx:44
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: num.hxx:46
std::unique_ptr< weld::MetricSpinButton > m_xDistBorderMF
Definition: num.hxx:52
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: num.cxx:500
std::unique_ptr< weld::Label > m_xDistBorderFT
Definition: num.hxx:51
const SfxItemSet * pSet
void SetModified()
Definition: num.cxx:872
void SetLevel(sal_uInt16 nSet)
Definition: numprevw.hxx:62
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
Definition: num.hxx:74
virtual void ActivatePage(const SfxItemSet &)
void InitPosAndSpaceMode()
Definition: num.cxx:447
std::unique_ptr< weld::MetricSpinButton > m_xListtabMF
Definition: num.hxx:66
SwNumRule * pSaveNum
Definition: num.hxx:33
virtual void PageCreated(const OString &rPageId, SfxTabPage &rPage) override
Definition: num.cxx:902
std::unique_ptr< weld::Label > m_xIndentFT
Definition: num.hxx:54
sal_uInt16 nActNumLvl
Definition: num.hxx:37
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet)
std::unique_ptr< weld::Widget > m_xPositionFrame
Definition: num.hxx:47
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
std::unique_ptr< weld::ComboBox > m_xAlignLB
Definition: num.hxx:59
virtual void Reset(const SfxItemSet *rSet) override
Definition: num.cxx:408
std::unique_ptr< weld::Label > m_xIndentAtFT
Definition: num.hxx:71
SwOutlineTabDialog * pOutlineDlg
Definition: num.hxx:36
std::unique_ptr< weld::Label > m_xLabelFollowedByFT
Definition: num.hxx:63
std::unique_ptr< weld::Label > m_xListtabFT
Definition: num.hxx:65
std::unique_ptr< weld::Label > m_xAlign2FT
Definition: num.hxx:67
SwSvxNumBulletTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: num.cxx:880
std::unique_ptr< SwNumRule > pActNum
Definition: num.hxx:32
virtual ~SwNumPositionTabPage() override
Definition: num.cxx:137
std::unique_ptr< weld::Button > m_xStandardPB
Definition: num.hxx:73
std::unique_ptr< weld::Label > m_xAlignFT
Definition: num.hxx:58
std::unique_ptr< weld::Label > m_xDistNumFT
Definition: num.hxx:56
std::unique_ptr< weld::MetricSpinButton > m_xDistNumMF
Definition: num.hxx:57
DECL_LINK(LevelHdl, weld::TreeView &, void)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: num.cxx:395
bool bLabelAlignmentPosAndSpaceModeActive
Definition: num.hxx:42
SwWrtShell & rWrtSh
Definition: num.hxx:126
std::unique_ptr< weld::MetricSpinButton > m_xIndentMF
Definition: num.hxx:55
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: num.cxx:386
void SetOutlineTabDialog(SwOutlineTabDialog *pDlg)
Definition: num.hxx:110
void InitControls()
Definition: num.cxx:149
std::unique_ptr< weld::CheckButton > m_xRelativeCB
Definition: num.hxx:53
std::unique_ptr< weld::ComboBox > m_xDummyCombo
Definition: num.hxx:132
DeactivateRC
std::unique_ptr< weld::MetricSpinButton > m_xAlignedAtMF
Definition: num.hxx:70
std::unique_ptr< weld::MetricSpinButton > m_xIndentAtMF
Definition: num.hxx:72
virtual ~SwSvxNumBulletTabDialog() override
Definition: num.cxx:898
std::unique_ptr< weld::ComboBox > m_xLabelFollowedByLB
Definition: num.hxx:64
std::unique_ptr< weld::ComboBox > m_xAlign2LB
Definition: num.hxx:68
std::unique_ptr< weld::Label > m_xAlignedAtFT
Definition: num.hxx:69
DECL_LINK(RemoveNumberingHdl, weld::Button &, void)
virtual void dispose() override
Definition: num.cxx:142
bool bInInintControl
Definition: num.hxx:41
void ShowControlsDependingOnPosAndSpaceMode()
Definition: num.cxx:476