nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / num.hxx
blob9d536066915c613991feb4ec9057863b0c7e69ae
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_NUM_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_NUM_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include "numprevw.hxx"
24 #include <numrule.hxx>
26 class SwWrtShell;
27 class SvxBrushItem;
28 class SwOutlineTabDialog;
30 class SwNumPositionTabPage : public SfxTabPage
32 std::unique_ptr<SwNumRule> pActNum;
33 SwNumRule* pSaveNum;
34 SwWrtShell* pWrtSh;
36 SwOutlineTabDialog* pOutlineDlg;
37 sal_uInt16 nActNumLvl;
39 bool bModified : 1;
40 bool bPreset : 1;
41 bool bInInintControl : 1; // work around modify-error; should be resolved from 391 on
42 bool bLabelAlignmentPosAndSpaceModeActive;
44 NumberingPreview m_aPreviewWIN;
46 std::unique_ptr<weld::TreeView> m_xLevelLB;
47 std::unique_ptr<weld::Widget> m_xPositionFrame;
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;
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;
77 void InitControls();
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);
85 void InitPosAndSpaceMode();
86 void ShowControlsDependingOnPosAndSpaceMode();
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);
93 public:
95 SwNumPositionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
96 virtual ~SwNumPositionTabPage() override;
98 virtual void ActivatePage(const SfxItemSet& rSet) override;
99 virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
100 virtual bool FillItemSet( SfxItemSet* rSet ) override;
101 virtual void Reset( const SfxItemSet* rSet ) override;
103 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
104 const SfxItemSet* rAttrSet);
106 void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
107 void SetWrtShell(SwWrtShell* pSh);
108 #ifdef DBG_UTIL
109 void SetModified();
110 #else
111 void SetModified()
113 bModified = true;
114 m_aPreviewWIN.SetLevel(nActNumLvl);
115 m_aPreviewWIN.Invalidate();
117 #endif
120 class SwSvxNumBulletTabDialog final : public SfxTabDialogController
122 SwWrtShell& rWrtSh;
124 virtual short Ok() override;
125 virtual void PageCreated(const OString& rPageId, SfxTabPage& rPage) override;
126 DECL_LINK(RemoveNumberingHdl, weld::Button&, void);
128 std::unique_ptr<weld::ComboBox> m_xDummyCombo;
130 public:
131 SwSvxNumBulletTabDialog(weld::Window* pParent,
132 const SfxItemSet* pSwItemSet,
133 SwWrtShell &);
134 virtual ~SwSvxNumBulletTabDialog() override;
136 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_NUM_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */