LibreOffice Module sd (master) 1
SlideBackground.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>
27#include <vcl/EnumContext.hxx>
28
29#include <com/sun/star/frame/XFrame.hpp>
30
31namespace sd { class ViewShellBase; }
32namespace sd::tools { class EventMultiplexerEvent; }
33
34class ColorListBox;
35class SvxPageItem;
38class XFillColorItem;
40class XFillBitmapItem;
41class XFillHatchItem;
42
43namespace sd::sidebar {
44
46 public PanelLayout,
47 public ::sfx2::sidebar::IContextChangeReceiver,
49{
50public:
52 weld::Widget* pParent,
53 ViewShellBase& rBase,
54 css::uno::Reference<css::frame::XFrame> xFrame,
55 SfxBindings* pBindings );
56 virtual ~SlideBackground() override;
58 // Window
59 virtual void NotifyItemUpdate(
60 const sal_uInt16 nSID,
61 const SfxItemState eState,
62 const SfxPoolItem* pState) override;
63
64 virtual void GetControlState(
65 const sal_uInt16 /*nSId*/,
66 boost::property_tree::ptree& /*rState*/) override {};
67
68 virtual void HandleContextChange(
69 const vcl::EnumContext& rContext) override;
70 virtual void DumpAsPropertyTree(::tools::JsonWriter&) override;
71
72private:
73
75
76 std::unique_ptr<SvxPaperSizeListBox> mxPaperSizeBox;
77 std::unique_ptr<weld::ComboBox> mxPaperOrientation;
78 std::unique_ptr<weld::ComboBox> mxMasterSlide;
79 std::unique_ptr<weld::Label> mxBackgroundLabel;
80 std::unique_ptr<weld::ComboBox> mxFillStyle;
81 std::unique_ptr<ColorListBox> mxFillLB;
82 std::unique_ptr<weld::ComboBox> mxFillAttr;
83 std::unique_ptr<ColorListBox> mxFillGrad1;
84 std::unique_ptr<ColorListBox> mxFillGrad2;
85 std::unique_ptr<weld::Button> mxInsertImage;
86 std::unique_ptr<weld::CheckButton> mxDspMasterBackground;
87 std::unique_ptr<weld::CheckButton> mxDspMasterObjects;
88 std::unique_ptr<weld::Button> mxCloseMaster;
89 std::unique_ptr<weld::Button> mxEditMaster;
90 std::unique_ptr<weld::Label> mxMasterLabel;
91 std::unique_ptr<weld::ComboBox> mxMarginSelectBox;
92 std::unique_ptr<weld::Label> mxCustomEntry;
93 std::unique_ptr<weld::Label> mxMarginLabel;
94
109
110 std::unique_ptr< SvxPageItem > mpPageItem;
111 std::unique_ptr< XFillColorItem > mpColorItem;
112 std::unique_ptr< XFillGradientItem > mpGradientItem;
113 std::unique_ptr< XFillHatchItem > mpHatchItem;
114 std::unique_ptr< XFillBitmapItem > mpBitmapItem;
115
118
119 css::uno::Reference<css::frame::XFrame> mxFrame;
128 std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
129 std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
136
138
140
141 // MCGR: Preserve ColorStops until we have a UI to edit these
143
144 DECL_LINK(FillBackgroundHdl, weld::ComboBox&, void);
145 DECL_LINK(FillStyleModifyHdl, weld::ComboBox&, void);
146 DECL_LINK(PaperSizeModifyHdl, weld::ComboBox&, void);
147 DECL_LINK(FillColorHdl, ColorListBox&, void);
148 DECL_LINK(AssignMasterPage, weld::ComboBox&, void);
149 DECL_LINK(DspBackground, weld::Toggleable&, void);
150 DECL_LINK(DspObjects, weld::Toggleable&, void);
151 DECL_LINK(CloseMasterHdl, weld::Button&, void);
152 DECL_LINK(EditMasterHdl, weld::Button&, void);
153 DECL_LINK(SelectBgHdl, weld::Button&, void);
154 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
155 DECL_LINK( ModifyMarginHdl, weld::ComboBox&, void );
156
157 void Initialize();
158 void Update();
159 void UpdateMarginBox();
160 void SetPanelTitle(const OUString& rTitle);
161 void SetMarginsFieldUnit();
162
163 Color const & GetColorSetOrDefault();
165 OUString const & GetHatchingSetOrDefault();
166 OUString const & GetBitmapSetOrDefault();
167 OUString const & GetPatternSetOrDefault();
168 bool IsDraw();
169 bool IsImpress();
170 void addListener();
171 void removeListener();
172 void ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin);
173 void ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin);
176
177 static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState);
178
179 // MCGR: Preserve ColorStops until we have a UI to edit these
181};
182
183}
184
185/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DECL_LINK(DspBackground, weld::Toggleable &, void)
std::unique_ptr< SvxLongULSpaceItem > mpPageULMarginItem
::sfx2::sidebar::ControllerItem maDspObjController
::sfx2::sidebar::ControllerItem maCloseMasterController
::sfx2::sidebar::ControllerItem maPaperMarginLRController
OUString const & GetHatchingSetOrDefault()
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent &, void)
DECL_LINK(FillBackgroundHdl, weld::ComboBox &, void)
DECL_LINK(CloseMasterHdl, weld::Button &, void)
vcl::EnumContext maImpressHandoutContext
virtual void NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState eState, const SfxPoolItem *pState) override
::sfx2::sidebar::ControllerItem maPaperOrientationController
std::unique_ptr< weld::ComboBox > mxFillStyle
std::unique_ptr< weld::Button > mxInsertImage
virtual ~SlideBackground() override
DECL_LINK(FillColorHdl, ColorListBox &, void)
std::unique_ptr< weld::Button > mxEditMaster
std::unique_ptr< weld::ComboBox > mxMarginSelectBox
std::unique_ptr< SvxLongLRSpaceItem > mpPageLRMarginItem
vcl::EnumContext maImpressMasterContext
std::unique_ptr< SvxPaperSizeListBox > mxPaperSizeBox
virtual void DumpAsPropertyTree(::tools::JsonWriter &) override
std::unique_ptr< weld::CheckButton > mxDspMasterBackground
std::unique_ptr< weld::Label > mxBackgroundLabel
::sfx2::sidebar::ControllerItem maBckColorController
OUString const & GetPatternSetOrDefault()
vcl::EnumContext maImpressOtherContext
::sfx2::sidebar::ControllerItem maBckImageController
::sfx2::sidebar::ControllerItem maBckGradientController
DECL_LINK(ModifyMarginHdl, weld::ComboBox &, void)
void ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin)
std::unique_ptr< weld::ComboBox > mxMasterSlide
std::unique_ptr< weld::Label > mxMarginLabel
basegfx::BGradient const & GetGradientSetOrDefault()
DECL_LINK(AssignMasterPage, weld::ComboBox &, void)
basegfx::BColorStops maColorStops
std::unique_ptr< XFillHatchItem > mpHatchItem
DECL_LINK(SelectBgHdl, weld::Button &, void)
SlideBackground(weld::Widget *pParent, ViewShellBase &rBase, css::uno::Reference< css::frame::XFrame > xFrame, SfxBindings *pBindings)
::sfx2::sidebar::ControllerItem maPaperSizeController
basegfx::BColorStops createColorStops()
DECL_LINK(PaperSizeModifyHdl, weld::ComboBox &, void)
vcl::EnumContext maDrawMasterContext
::sfx2::sidebar::ControllerItem maPaperMarginULController
std::unique_ptr< weld::Button > mxCloseMaster
DECL_LINK(EditMasterHdl, weld::Button &, void)
void ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin)
void SetPanelTitle(const OUString &rTitle)
std::unique_ptr< SvxPageItem > mpPageItem
std::unique_ptr< weld::Label > mxMasterLabel
::sfx2::sidebar::ControllerItem maBckFillStyleController
DECL_LINK(DspObjects, weld::Toggleable &, void)
vcl::EnumContext maImpressNotesContext
std::unique_ptr< XFillBitmapItem > mpBitmapItem
std::unique_ptr< ColorListBox > mxFillGrad1
std::unique_ptr< weld::Label > mxCustomEntry
virtual void HandleContextChange(const vcl::EnumContext &rContext) override
std::unique_ptr< XFillGradientItem > mpGradientItem
css::uno::Reference< css::frame::XFrame > mxFrame
std::unique_ptr< ColorListBox > mxFillGrad2
std::unique_ptr< weld::CheckButton > mxDspMasterObjects
std::unique_ptr< ColorListBox > mxFillLB
std::unique_ptr< weld::ComboBox > mxPaperOrientation
::sfx2::sidebar::ControllerItem maDspBckController
OUString const & GetBitmapSetOrDefault()
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem *pState)
::sfx2::sidebar::ControllerItem maBckHatchController
::sfx2::sidebar::ControllerItem maMetricController
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
std::unique_ptr< weld::ComboBox > mxFillAttr
::sfx2::sidebar::ControllerItem maBckBitmapController
DECL_LINK(FillStyleModifyHdl, weld::ComboBox &, void)
std::unique_ptr< XFillColorItem > mpColorItem
FieldUnit
MapUnit
long Long
SfxItemState
Reference< XFrame > xFrame