bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / inc / BulletAndPositionDlg.hxx
blob54fe2abcd057db4d454b43a1252808f53cede969
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 #ifndef INCLUDED_SD_SOURCE_UI_INC_BULLETANDPOSITIONDIALOG_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_BULLETANDPOSITIONDIALOG_HXX
23 #include <vector>
24 #include <memory>
26 #include <sfx2/tabdlg.hxx>
27 #include <svx/Palette.hxx>
28 #include <editeng/numdef.hxx>
29 #include <editeng/svxenum.hxx>
30 #include <svtools/ctrlbox.hxx>
31 #include <vcl/weld.hxx>
32 #include "View.hxx"
33 #include <cui/numberingpreview.hxx>
35 #define MN_GALLERY_ENTRY 100
37 class ColorListBox;
38 class NumValueSet;
39 class SvxNumRule;
40 class SvxBmpNumValueSet;
41 class SvxBrushItem;
42 class ValueSet;
43 class SdDrawDocument;
45 namespace sd
47 class View;
50 /// Main class for handling the bullets, numbering format and their position.
51 class SvxBulletAndPositionDlg : public weld::GenericDialogController
53 OUString m_sNumCharFmtName;
54 OUString m_sBulletCharFormatName;
56 Timer aInvalidateTimer;
58 std::unique_ptr<SvxNumRule> pActNum;
59 std::unique_ptr<SvxNumRule> pSaveNum;
61 Size aInitSize[SVX_MAX_NUM];
63 bool bLastWidthModified : 1;
64 bool bModified : 1;
65 bool bPreset : 1;
66 bool bAutomaticCharStyles : 1;
67 bool bHTMLMode : 1;
68 bool bInInitControl : 1; // workaround for Modify-error, is said to be corrected from 391 on
69 bool bLabelAlignmentPosAndSpaceModeActive;
70 bool bApplyToMaster;
71 bool bIsSlideScope;
73 std::vector<OUString> aGrfNames;
74 vcl::Font aActBulletFont;
76 sal_uInt8 nBullet;
77 sal_uInt16 nActNumLvl;
78 weld::Window* p_Window;
79 sal_uInt16 nNumItemId;
80 MapUnit eCoreUnit;
81 ::sd::View* p_View;
83 SvxNumberingPreview m_aPreviewWIN;
84 std::unique_ptr<weld::Widget> m_xGrid;
85 std::unique_ptr<weld::TreeView> m_xLevelLB;
86 std::unique_ptr<weld::ComboBox> m_xFmtLB;
87 std::unique_ptr<weld::Label> m_xPrefixFT;
88 std::unique_ptr<weld::Entry> m_xPrefixED;
89 std::unique_ptr<weld::Label> m_xSuffixFT;
90 std::unique_ptr<weld::Entry> m_xSuffixED;
91 std::unique_ptr<weld::Expander> m_xBeforeAfter;
92 std::unique_ptr<weld::Label> m_xBulColorFT;
93 std::unique_ptr<ColorListBox> m_xBulColLB;
94 std::unique_ptr<weld::Label> m_xBulRelSizeFT;
95 std::unique_ptr<weld::MetricSpinButton> m_xBulRelSizeMF;
96 std::unique_ptr<weld::Label> m_xStartFT;
97 std::unique_ptr<weld::SpinButton> m_xStartED;
98 std::unique_ptr<weld::Label> m_xBulletFT;
99 std::unique_ptr<weld::Button> m_xBulletPB;
100 std::unique_ptr<weld::MenuButton> m_xBitmapMB;
101 std::unique_ptr<weld::Label> m_xWidthFT;
102 std::unique_ptr<weld::MetricSpinButton> m_xWidthMF;
103 std::unique_ptr<weld::Label> m_xHeightFT;
104 std::unique_ptr<weld::MetricSpinButton> m_xHeightMF;
105 std::unique_ptr<weld::CheckButton> m_xRatioCB;
106 std::unique_ptr<weld::Menu> m_xGalleryMenu;
107 std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
108 std::unique_ptr<weld::Label> m_xDistBorderFT;
109 std::unique_ptr<weld::MetricSpinButton> m_xDistBorderMF;
110 std::unique_ptr<weld::CheckButton> m_xRelativeCB;
111 std::unique_ptr<weld::Label> m_xIndentFT;
112 std::unique_ptr<weld::MetricSpinButton> m_xIndentMF;
113 std::unique_ptr<weld::ToggleButton> m_xLeftTB;
114 std::unique_ptr<weld::ToggleButton> m_xCenterTB;
115 std::unique_ptr<weld::ToggleButton> m_xRightTB;
116 std::unique_ptr<weld::RadioButton> m_xSlideRB;
117 std::unique_ptr<weld::RadioButton> m_xSelectionRB;
118 std::unique_ptr<weld::ToggleButton> m_xApplyToMaster;
120 void InitControls();
121 /** To switch between the numbering type
122 0 - Number;
123 1 - Bullet;
124 2 - Bitmap; */
125 void SwitchNumberType(sal_uInt8 nType);
126 void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
128 DECL_LINK(NumberTypeSelectHdl_Impl, weld::ComboBox&, void);
129 DECL_LINK(LevelHdl_Impl, weld::TreeView&, void);
130 DECL_LINK(PopupActivateHdl_Impl, weld::ToggleButton&, void);
131 DECL_LINK(GraphicHdl_Impl, const OString&, void);
132 DECL_LINK(BulletHdl_Impl, weld::Button&, void);
133 DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void);
134 DECL_LINK(RatioHdl_Impl, weld::ToggleButton&, void);
135 DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void);
136 DECL_LINK(SameLevelHdl_Impl, weld::ToggleButton&, void);
137 DECL_LINK(BulColorHdl_Impl, ColorListBox&, void);
138 DECL_LINK(BulRelSizeHdl_Impl, weld::MetricSpinButton&, void);
139 DECL_LINK(PreviewInvalidateHdl_Impl, Timer*, void);
140 DECL_LINK(DistanceHdl_Impl, weld::MetricSpinButton&, void);
141 DECL_LINK(RelativeHdl_Impl, weld::ToggleButton&, void);
142 DECL_LINK(SelectLeftAlignmentHdl_Impl, weld::ToggleButton&, void);
143 DECL_LINK(SelectCenterAlignmentHdl_Impl, weld::ToggleButton&, void);
144 DECL_LINK(SelectRightAlignmentHdl_Impl, weld::ToggleButton&, void);
145 DECL_LINK(ApplyToMasterHdl_Impl, weld::ToggleButton&, void);
146 void EditModifyHdl_Impl(const weld::Entry*);
147 void InitPosAndSpaceMode();
148 void SetAlignmentHdl_Impl(SvxAdjust);
150 public:
151 SvxBulletAndPositionDlg(weld::Window* pWindow, const SfxItemSet& rSet, ::sd::View* pView);
152 virtual ~SvxBulletAndPositionDlg() override;
153 virtual void dispose();
155 SfxItemSet* GetOutputItemSet(SfxItemSet* rSet);
156 bool IsApplyToMaster();
157 bool IsSlideScope();
158 void Reset(const SfxItemSet* rSet);
160 void SetCharFmts(const OUString& rNumName, const OUString& rBulletName)
162 m_sNumCharFmtName = rNumName;
163 m_sBulletCharFormatName = rBulletName;
165 void SetMetric(FieldUnit eSet);
167 void SetModified(bool bRepaint = true);
170 #endif
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */