LibreOffice Module sw (master)  1
outline.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_OUTLINE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_OUTLINE_HXX
21 
22 #include <memory>
23 #include <sfx2/tabdlg.hxx>
24 #include <swtypes.hxx>
25 #include "numprevw.hxx"
26 #include "numberingtypelistbox.hxx"
27 #include <rtl/ustring.hxx>
28 
29 class SwWrtShell;
30 class SwNumRule;
31 class SwChapterNumRules;
32 
34 {
35  static sal_uInt16 nNumLevel;
36 
37  OUString aCollNames[MAXLEVEL];
38 
40  std::unique_ptr<SwNumRule> xNumRule;
42 
43  bool const bModified : 1;
44 
45  std::unique_ptr<weld::MenuButton> m_xMenuButton;
46 
47  DECL_LINK(CancelHdl, weld::Button&, void);
48  DECL_LINK(FormHdl, weld::Button&, void);
49  DECL_LINK(MenuSelectHdl, const OString&, void);
50 
51  virtual void PageCreated(const OString& rPageId, SfxTabPage& rPage) override;
52  virtual short Ok() override;
53 
54 public:
55  SwOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell &);
56  virtual ~SwOutlineTabDialog() override;
57 
58  SwNumRule* GetNumRule() { return xNumRule.get(); }
59  sal_uInt16 GetLevel(const OUString &rFormatName) const;
60  OUString* GetCollNames() {return aCollNames;}
61 
62  static sal_uInt16 GetActNumLevel() {return nNumLevel;}
63  static void SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;}
64 };
65 
67 {
68  OUString const aNoFormatName;
72  OUString* pCollNames;
73  sal_uInt16 nActLevel;
75 
76  std::unique_ptr<weld::TreeView> m_xLevelLB;
77  std::unique_ptr<weld::ComboBox> m_xCollBox;
78  std::unique_ptr<SwNumberingTypeListBox> m_xNumberBox;
79  std::unique_ptr<weld::ComboBox> m_xCharFormatLB;
80  std::unique_ptr<weld::Label> m_xAllLevelFT;
81  std::unique_ptr<weld::SpinButton> m_xAllLevelNF;
82  std::unique_ptr<weld::Entry> m_xPrefixED;
83  std::unique_ptr<weld::Entry> m_xSuffixED;
84  std::unique_ptr<weld::SpinButton> m_xStartEdit;
85  std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
86 
87  DECL_LINK( LevelHdl, weld::TreeView&, void );
88  DECL_LINK( ToggleComplete, weld::SpinButton&, void );
89  DECL_LINK( CollSelect, weld::ComboBox&, void );
90  void CollSave();
91  DECL_LINK( NumberSelect, weld::ComboBox&, void );
92  DECL_LINK( DelimModify, weld::Entry&, void );
93  DECL_LINK( StartModified, weld::SpinButton&, void );
94  DECL_LINK( CharFormatHdl, weld::ComboBox&, void );
95 
96  void Update();
97 
98  void SetModified() { m_aPreviewWIN.Invalidate(); }
99  void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
100 
101 public:
103  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
104  const SfxItemSet* rAttrSet);
105  virtual ~SwOutlineSettingsTabPage() override;
106 
107  void SetWrtShell(SwWrtShell* pShell);
108 
109  virtual void ActivatePage(const SfxItemSet& rSet) override;
110  virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
111 
112  virtual bool FillItemSet( SfxItemSet* rSet ) override;
113  virtual void Reset( const SfxItemSet* rSet ) override;
114  void SetNumRule(SwNumRule *pRule)
115  {
116  pNumRule = pRule;
117  m_aPreviewWIN.SetNumRule(pNumRule);
118  }
119 };
120 
121 #endif
122 
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:799
OUString * GetCollNames()
Definition: outline.hxx:60
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: outline.cxx:804
std::unique_ptr< weld::ComboBox > m_xCharFormatLB
Definition: outline.hxx:79
const SfxItemSet * pSet
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:810
OUString aCollNames[MAXLEVEL]
Definition: outline.hxx:37
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: outline.hxx:83
static sal_uInt16 nNumLevel
Definition: outline.hxx:35
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: outline.hxx:82
DECL_LINK(CancelHdl, weld::Button &, void)
std::unique_ptr< SwNumRule > xNumRule
Definition: outline.hxx:40
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:81
SwNumRule * pNumRule
Definition: outline.hxx:71
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:387
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:144
std::unique_ptr< weld::SpinButton > m_xStartEdit
Definition: outline.hxx:84
void SetNumRule(SwNumRule *pRule)
Definition: outline.hxx:114
NumberingPreview m_aPreviewWIN
Definition: outline.hxx:74
OUString const aNoFormatName
Definition: outline.hxx:68
SwNumRule * GetNumRule()
Definition: outline.hxx:58
sal_uInt16 GetLevel(const OUString &rFormatName) const
Definition: outline.cxx:295
virtual short Ok() override
Definition: outline.cxx:305
bool const bModified
Definition: outline.hxx:43
std::unique_ptr< SwNumberingTypeListBox > m_xNumberBox
Definition: outline.hxx:78
std::unique_ptr< weld::MenuButton > m_xMenuButton
Definition: outline.hxx:45
void SetNumRule(const SwNumRule *pNum)
Definition: numprevw.hxx:50
virtual void PageCreated(const OString &rPageId, SfxTabPage &rPage) override
Definition: outline.cxx:193
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:63
SwChapterNumRules * pChapterNumRules
Definition: outline.hxx:41
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:716
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:778
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:788
DeactivateRC
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
Definition: outline.hxx:85
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:720
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: outline.hxx:76
DECL_LINK(LevelHdl, weld::TreeView &, void)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: outline.cxx:794
OUString aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:69
std::unique_ptr< weld::ComboBox > m_xCollBox
Definition: outline.hxx:77
SwWrtShell & rWrtSh
Definition: outline.hxx:39
virtual ~SwOutlineTabDialog() override
Definition: outline.cxx:189
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:80
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:62