Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / outline.hxx
blobacb81b00f2bf24323b132d85d6af52846f222f0c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
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>
29 class SwWrtShell;
30 class SwNumRule;
31 class SwChapterNumRules;
33 class SwOutlineTabDialog final : public SfxTabDialogController
35 static sal_uInt16 s_nNumLevel;
36 static_assert(sizeof(s_nNumLevel) * CHAR_BIT >= MAXLEVEL);
38 OUString m_aCollNames[MAXLEVEL];
40 SwWrtShell& m_rWrtSh;
41 std::unique_ptr<SwNumRule> m_xNumRule;
42 SwChapterNumRules* m_pChapterNumRules;
44 bool m_bModified : 1;
46 std::unique_ptr<weld::MenuButton> m_xMenuButton;
48 DECL_LINK(CancelHdl, weld::Button&, void);
49 DECL_LINK(FormHdl, weld::Toggleable&, void);
50 DECL_LINK(MenuSelectHdl, const OUString&, void);
52 virtual void PageCreated(const OUString& rPageId, SfxTabPage& rPage) override;
53 virtual short Ok() override;
55 public:
56 SwOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell &);
57 virtual ~SwOutlineTabDialog() override;
59 SwNumRule* GetNumRule() { return m_xNumRule.get(); }
60 sal_uInt16 GetLevel(std::u16string_view rFormatName) const;
61 OUString* GetCollNames() {return m_aCollNames;}
63 static sal_uInt16 GetActNumLevel() {return s_nNumLevel;}
64 static void SetActNumLevel(sal_uInt16 nSet) {s_nNumLevel = nSet;}
67 class SwOutlineSettingsTabPage final : public SfxTabPage
69 OUString m_aNoFormatName;
70 OUString m_aSaveCollNames[MAXLEVEL];
71 SwWrtShell* m_pSh;
72 SwNumRule* m_pNumRule;
73 OUString* m_pCollNames;
74 sal_uInt16 m_nActLevel;
75 NumberingPreview m_aPreviewWIN;
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;
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 );
97 void Update();
99 void SetModified() { m_aPreviewWIN.Invalidate(); }
100 void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
102 public:
103 SwOutlineSettingsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
104 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
105 const SfxItemSet* rAttrSet);
106 virtual ~SwOutlineSettingsTabPage() override;
108 void SetWrtShell(SwWrtShell* pShell);
110 virtual void ActivatePage(const SfxItemSet& rSet) override;
111 virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
113 virtual bool FillItemSet( SfxItemSet* rSet ) override;
114 virtual void Reset( const SfxItemSet* rSet ) override;
115 void SetNumRule(SwNumRule *pRule)
117 m_pNumRule = pRule;
118 m_aPreviewWIN.SetNumRule(m_pNumRule);
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */