bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / sidebar / SlideBackground.hxx
blob8e6e65eef7271420dee805d8e0654c689a640400
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_SIDEBAR_SLIDEBACKGROUND_HXX
21 #define INCLUDED_SD_SOURCE_UI_SIDEBAR_SLIDEBACKGROUND_HXX
23 #include <memory>
24 #include <vcl/lstbox.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/button.hxx>
27 #include <vcl/layout.hxx>
28 #include <svx/sidebar/PanelLayout.hxx>
29 #include <svx/itemwin.hxx>
30 #include <sfx2/sidebar/ControllerItem.hxx>
31 #include <svx/papersizelistbox.hxx>
32 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
34 namespace sd { class ViewShellBase; }
35 namespace sd { namespace tools { class EventMultiplexerEvent; } }
37 class SvxColorListBox;
38 class SvxPageItem;
39 class SvxLongLRSpaceItem;
40 class SvxLongULSpaceItem;
41 class XFillColorItem;
42 class XGradient;
43 class XFillGradientItem;
44 class XFillBitmapItem;
45 class XFillHatchItem;
47 static const long MINBODY = 284;
49 namespace sd { namespace sidebar {
51 class SlideBackground :
52 public PanelLayout,
53 public ::sfx2::sidebar::IContextChangeReceiver,
54 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
56 public:
57 SlideBackground(
58 Window * pParent,
59 ViewShellBase& rBase,
60 const css::uno::Reference<css::frame::XFrame>& rxFrame,
61 SfxBindings* pBindings );
62 virtual ~SlideBackground() override;
63 virtual void dispose() override;
64 SfxBindings* GetBindings() { return mpBindings; }
65 // Window
66 virtual void DataChanged (const DataChangedEvent& rEvent) override;
67 virtual void NotifyItemUpdate(
68 const sal_uInt16 nSID,
69 const SfxItemState eState,
70 const SfxPoolItem* pState,
71 const bool bIsEnabled) override;
72 virtual void HandleContextChange(
73 const vcl::EnumContext& rContext) override;
75 private:
77 ViewShellBase& mrBase;
79 VclPtr<PaperSizeListBox> mpPaperSizeBox;
80 VclPtr<ListBox> mpPaperOrientation;
81 VclPtr<ListBox> mpMasterSlide;
82 VclPtr<FixedText> mpBackgroundLabel;
83 VclPtr<SvxFillTypeBox> mpFillStyle;
84 VclPtr<SvxColorListBox> mpFillLB;
85 VclPtr<SvxFillAttrBox> mpFillAttr;
86 VclPtr<SvxColorListBox> mpFillGrad;
87 VclPtr<Button> mpInsertImage;
88 VclPtr<CheckBox> mpDspMasterBackground;
89 VclPtr<CheckBox> mpDspMasterObjects;
90 VclPtr<Button> mpCloseMaster;
91 VclPtr<Button> mpEditMaster;
92 VclPtr<FixedText> mpMasterLabel;
93 VclPtr<ListBox> mpMarginSelectBox;
94 VclPtr<VclVBox> m_pContainer;
96 ::sfx2::sidebar::ControllerItem maPaperSizeController;
97 ::sfx2::sidebar::ControllerItem maPaperOrientationController;
98 ::sfx2::sidebar::ControllerItem maPaperMarginLRController;
99 ::sfx2::sidebar::ControllerItem maPaperMarginULController;
100 ::sfx2::sidebar::ControllerItem maBckColorController;
101 ::sfx2::sidebar::ControllerItem maBckGradientController;
102 ::sfx2::sidebar::ControllerItem maBckHatchController;
103 ::sfx2::sidebar::ControllerItem maBckBitmapController;
104 ::sfx2::sidebar::ControllerItem maBckFillStyleController;
105 ::sfx2::sidebar::ControllerItem maBckImageController;
106 ::sfx2::sidebar::ControllerItem maDspBckController;
107 ::sfx2::sidebar::ControllerItem maDspObjController;
108 ::sfx2::sidebar::ControllerItem maMetricController;
109 ::sfx2::sidebar::ControllerItem maCloseMasterController;
111 std::unique_ptr< SvxPageItem > mpPageItem;
112 std::unique_ptr< XFillColorItem > mpColorItem;
113 std::unique_ptr< XFillGradientItem > mpGradientItem;
114 std::unique_ptr< XFillHatchItem > mpHatchItem;
115 std::unique_ptr< XFillBitmapItem > mpBitmapItem;
117 bool mbSwitchModeToNormal;
118 bool mbSwitchModeToMaster;
120 css::uno::Reference<css::frame::XFrame> mxFrame;
121 vcl::EnumContext maContext;
122 vcl::EnumContext const maDrawOtherContext;
123 vcl::EnumContext const maDrawMasterContext;
124 vcl::EnumContext const maImpressOtherContext;
125 vcl::EnumContext const maImpressMasterContext;
126 vcl::EnumContext const maImpressHandoutContext;
127 vcl::EnumContext const maImpressNotesContext;
128 bool mbTitle;
129 std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
130 std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
131 long m_nPageLeftMargin;
132 long m_nPageRightMargin;
133 long m_nPageTopMargin;
134 long m_nPageBottomMargin;
135 OUString maCustomEntry;
137 SfxBindings* const mpBindings;
139 MapUnit meUnit;
141 DECL_LINK(FillBackgroundHdl, ListBox&, void);
142 DECL_LINK(FillStyleModifyHdl, ListBox&, void);
143 DECL_LINK(PaperSizeModifyHdl, ListBox&, void);
144 DECL_LINK(FillColorHdl, SvxColorListBox&, void);
145 DECL_LINK(AssignMasterPage, ListBox&, void);
146 DECL_LINK(DspBackground, Button*, void);
147 DECL_LINK(DspObjects, Button*, void);
148 DECL_LINK(CloseMasterHdl, Button*, void);
149 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
150 DECL_LINK( ModifyMarginHdl, ListBox&, void );
152 void Initialize();
153 void Update();
154 void UpdateMarginBox();
155 void SetPanelTitle(const OUString& rTitle);
157 Color const & GetColorSetOrDefault();
158 XGradient const & GetGradientSetOrDefault();
159 OUString const & GetHatchingSetOrDefault();
160 OUString const & GetBitmapSetOrDefault();
161 OUString const & GetPatternSetOrDefault();
162 bool IsDraw();
163 bool IsImpress();
164 void addListener();
165 void removeListener();
166 void ExecuteMarginLRChange(const long mnPageLeftMargin, const long mnPageRightMargin);
167 void ExecuteMarginULChange(const long mnPageTopMargin, const long mnPageBottomMargin);
168 void populateMasterSlideDropdown();
169 void updateMasterSlideSelection();
174 #endif
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */