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
20#pragma once
21
22#include <memory>
23#include <sfx2/tabdlg.hxx>
24#include <swtypes.hxx>
25#include "numprevw.hxx"
27#include <rtl/ustring.hxx>
28
29class SwWrtShell;
30class SwNumRule;
32
34{
35 static sal_uInt16 s_nNumLevel;
36 static_assert(sizeof(s_nNumLevel) * CHAR_BIT >= MAXLEVEL);
37
39
41 std::unique_ptr<SwNumRule> m_xNumRule;
43
44 bool m_bModified : 1;
45
46 std::unique_ptr<weld::MenuButton> m_xMenuButton;
47
48 DECL_LINK(CancelHdl, weld::Button&, void);
49 DECL_LINK(FormHdl, weld::Toggleable&, void);
50 DECL_LINK(MenuSelectHdl, const OUString&, void);
51
52 virtual void PageCreated(const OUString& rPageId, SfxTabPage& rPage) override;
53 virtual short Ok() override;
54
55public:
56 SwOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell &);
57 virtual ~SwOutlineTabDialog() override;
58
59 SwNumRule* GetNumRule() { return m_xNumRule.get(); }
60 sal_uInt16 GetLevel(std::u16string_view rFormatName) const;
61 OUString* GetCollNames() {return m_aCollNames;}
62
63 static sal_uInt16 GetActNumLevel() {return s_nNumLevel;}
64 static void SetActNumLevel(sal_uInt16 nSet) {s_nNumLevel = nSet;}
65};
66
68{
73 OUString* m_pCollNames;
74 sal_uInt16 m_nActLevel;
76
77 std::unique_ptr<weld::TreeView> m_xLevelLB;
78 std::unique_ptr<weld::ComboBox> m_xCollBox;
79 std::unique_ptr<SwNumberingTypeListBox> m_xNumberBox;
80 std::unique_ptr<weld::ComboBox> m_xCharFormatLB;
81 std::unique_ptr<weld::Label> m_xAllLevelFT;
82 std::unique_ptr<weld::SpinButton> m_xAllLevelNF;
83 std::unique_ptr<weld::Entry> m_xPrefixED;
84 std::unique_ptr<weld::Entry> m_xSuffixED;
85 std::unique_ptr<weld::SpinButton> m_xStartEdit;
86 std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
87
88 DECL_LINK( LevelHdl, weld::TreeView&, void );
89 DECL_LINK( ToggleComplete, weld::SpinButton&, void );
90 DECL_LINK( CollSelect, weld::ComboBox&, void );
91 void CollSave();
92 DECL_LINK( NumberSelect, weld::ComboBox&, void );
93 DECL_LINK( DelimModify, weld::Entry&, void );
94 DECL_LINK( StartModified, weld::SpinButton&, void );
95 DECL_LINK( CharFormatHdl, weld::ComboBox&, void );
96
97 void Update();
98
100 void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
101
102public:
104 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
105 const SfxItemSet* rAttrSet);
106 virtual ~SwOutlineSettingsTabPage() override;
107
108 void SetWrtShell(SwWrtShell* pShell);
109
110 virtual void ActivatePage(const SfxItemSet& rSet) override;
111 virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
112
113 virtual bool FillItemSet( SfxItemSet* rSet ) override;
114 virtual void Reset( const SfxItemSet* rSet ) override;
116 {
117 m_pNumRule = pRule;
119 }
120};
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetNumRule(const SwNumRule *pNum)
Definition: numprevw.hxx:50
SwWrtShell * m_pSh
Definition: outline.hxx:71
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:766
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:776
DECL_LINK(LevelHdl, weld::TreeView &, void)
DECL_LINK(CollSelect, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > m_xCollBox
Definition: outline.hxx:78
std::unique_ptr< SwNumberingTypeListBox > m_xNumberBox
Definition: outline.hxx:79
NumberingPreview m_aPreviewWIN
Definition: outline.hxx:75
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: outline.cxx:782
DECL_LINK(DelimModify, weld::Entry &, void)
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:711
DECL_LINK(NumberSelect, weld::ComboBox &, void)
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: outline.hxx:77
DECL_LINK(ToggleComplete, weld::SpinButton &, void)
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:81
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:715
sal_uInt16 m_nActLevel
Definition: outline.hxx:74
void SetNumRule(SwNumRule *pRule)
Definition: outline.hxx:115
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:82
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:787
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: outline.cxx:792
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: outline.hxx:84
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: outline.hxx:83
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:390
DECL_LINK(StartModified, weld::SpinButton &, void)
OUString m_aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:70
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
Definition: outline.hxx:86
OUString * m_pCollNames
Definition: outline.hxx:73
SwNumRule * m_pNumRule
Definition: outline.hxx:72
DECL_LINK(CharFormatHdl, weld::ComboBox &, void)
std::unique_ptr< weld::SpinButton > m_xStartEdit
Definition: outline.hxx:85
std::unique_ptr< weld::ComboBox > m_xCharFormatLB
Definition: outline.hxx:80
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:798
virtual short Ok() override
Definition: outline.cxx:308
DECL_LINK(FormHdl, weld::Toggleable &, void)
OUString m_aCollNames[MAXLEVEL]
Definition: outline.hxx:36
std::unique_ptr< weld::MenuButton > m_xMenuButton
Definition: outline.hxx:46
std::unique_ptr< SwNumRule > m_xNumRule
Definition: outline.hxx:41
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:143
SwNumRule * GetNumRule()
Definition: outline.hxx:59
static sal_uInt16 s_nNumLevel
Definition: outline.hxx:35
DECL_LINK(MenuSelectHdl, const OUString &, void)
DECL_LINK(CancelHdl, weld::Button &, void)
SwChapterNumRules * m_pChapterNumRules
Definition: outline.hxx:42
virtual void PageCreated(const OUString &rPageId, SfxTabPage &rPage) override
Definition: outline.cxx:199
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:64
virtual ~SwOutlineTabDialog() override
Definition: outline.cxx:195
SwWrtShell & m_rWrtSh
Definition: outline.hxx:40
sal_uInt16 GetLevel(std::u16string_view rFormatName) const
Definition: outline.cxx:298
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:63
OUString * GetCollNames()
Definition: outline.hxx:61
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
DeactivateRC