1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
24 #include <vcl/ctrl.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/button.hxx>
28 #include <vcl/field.hxx>
29 #include <svx/sidebar/PanelLayout.hxx>
30 #include <svx/pagectrl.hxx>
31 #include <ViewShellBase.hxx>
32 #include <svx/itemwin.hxx>
33 #include <sfx2/sidebar/ControlFactory.hxx>
34 #include <sfx2/sidebar/ControllerItem.hxx>
35 #include <com/sun/star/drawing/XDrawView.hpp>
37 #include <editeng/sizeitem.hxx>
38 #include <svx/papersizelistbox.hxx>
39 #include <svx/rulritem.hxx>
40 #include <svx/xflclit.hxx>
41 #include <svx/xgrad.hxx>
42 #include <svx/xflgrit.hxx>
43 #include <svx/xbitmap.hxx>
44 #include <svx/xflbckit.hxx>
45 #include <svx/xbtmpit.hxx>
46 #include <svx/xflhtit.hxx>
47 #include <EventMultiplexer.hxx>
48 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
50 class SvxColorListBox
;
52 static const long MINBODY
= 284;
54 namespace sd
{ namespace sidebar
{
56 class SlideBackground
:
58 public ::sfx2::sidebar::IContextChangeReceiver
,
59 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
65 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
66 SfxBindings
* pBindings
);
67 virtual ~SlideBackground() override
;
68 virtual void dispose() override
;
69 SfxBindings
* GetBindings() { return mpBindings
; }
71 virtual void DataChanged (const DataChangedEvent
& rEvent
) override
;
72 virtual void NotifyItemUpdate(
73 const sal_uInt16 nSID
,
74 const SfxItemState eState
,
75 const SfxPoolItem
* pState
,
76 const bool bIsEnabled
) override
;
77 virtual void HandleContextChange(
78 const vcl::EnumContext
& rContext
) override
;
82 ViewShellBase
& mrBase
;
84 VclPtr
<PaperSizeListBox
> mpPaperSizeBox
;
85 VclPtr
<ListBox
> mpPaperOrientation
;
86 VclPtr
<ListBox
> mpMasterSlide
;
87 VclPtr
<FixedText
> mpBackgroundLabel
;
88 VclPtr
<SvxFillTypeBox
> mpFillStyle
;
89 VclPtr
<SvxColorListBox
> mpFillLB
;
90 VclPtr
<SvxFillAttrBox
> mpFillAttr
;
91 VclPtr
<SvxColorListBox
> mpFillGrad
;
92 VclPtr
<Button
> mpInsertImage
;
93 VclPtr
<CheckBox
> mpDspMasterBackground
;
94 VclPtr
<CheckBox
> mpDspMasterObjects
;
95 VclPtr
<Button
> mpCloseMaster
;
96 VclPtr
<Button
> mpEditMaster
;
97 VclPtr
<FixedText
> mpMasterLabel
;
98 VclPtr
<ListBox
> mpMarginSelectBox
;
99 VclPtr
<VclVBox
> m_pContainer
;
101 ::sfx2::sidebar::ControllerItem maPaperSizeController
;
102 ::sfx2::sidebar::ControllerItem maPaperOrientationController
;
103 ::sfx2::sidebar::ControllerItem maPaperMarginLRController
;
104 ::sfx2::sidebar::ControllerItem maPaperMarginULController
;
105 ::sfx2::sidebar::ControllerItem maBckColorController
;
106 ::sfx2::sidebar::ControllerItem maBckGradientController
;
107 ::sfx2::sidebar::ControllerItem maBckHatchController
;
108 ::sfx2::sidebar::ControllerItem maBckBitmapController
;
109 ::sfx2::sidebar::ControllerItem maBckFillStyleController
;
110 ::sfx2::sidebar::ControllerItem maBckImageController
;
111 ::sfx2::sidebar::ControllerItem maDspBckController
;
112 ::sfx2::sidebar::ControllerItem maDspObjController
;
113 ::sfx2::sidebar::ControllerItem maMetricController
;
114 ::sfx2::sidebar::ControllerItem maCloseMasterController
;
116 std::unique_ptr
< SvxPageItem
> mpPageItem
;
117 std::unique_ptr
< XFillColorItem
> mpColorItem
;
118 std::unique_ptr
< XFillGradientItem
> mpGradientItem
;
119 std::unique_ptr
< XFillHatchItem
> mpHatchItem
;
120 std::unique_ptr
< XFillBitmapItem
> mpBitmapItem
;
122 bool mbEditModeChangePending
;
124 css::uno::Reference
<css::frame::XFrame
> mxFrame
;
125 vcl::EnumContext maContext
;
126 vcl::EnumContext maDrawOtherContext
;
127 vcl::EnumContext maDrawMasterContext
;
128 vcl::EnumContext maImpressOtherContext
;
129 vcl::EnumContext maImpressMasterContext
;
130 vcl::EnumContext maImpressHandoutContext
;
131 vcl::EnumContext maImpressNotesContext
;
133 std::unique_ptr
<SvxLongLRSpaceItem
> mpPageLRMarginItem
;
134 std::unique_ptr
<SvxLongULSpaceItem
> mpPageULMarginItem
;
135 long m_nPageLeftMargin
;
136 long m_nPageRightMargin
;
137 long m_nPageTopMargin
;
138 long m_nPageBottomMargin
;
139 OUString maCustomEntry
;
141 SfxBindings
* mpBindings
;
145 DECL_LINK(FillBackgroundHdl
, ListBox
&, void);
146 DECL_LINK(FillStyleModifyHdl
, ListBox
&, void);
147 DECL_LINK(PaperSizeModifyHdl
, ListBox
&, void);
148 DECL_LINK(FillColorHdl
, SvxColorListBox
&, void);
149 DECL_LINK(AssignMasterPage
, ListBox
&, void);
150 DECL_LINK(DspBackground
, Button
*, void);
151 DECL_LINK(DspObjects
, Button
*, void);
152 DECL_LINK(CloseMasterHdl
, Button
*, void);
153 DECL_LINK(EventMultiplexerListener
, tools::EventMultiplexerEvent
&, void );
154 DECL_LINK( ModifyMarginHdl
, ListBox
&, void );
158 void UpdateMarginBox();
159 void SetPanelTitle(const OUString
& rTitle
);
161 Color
const & GetColorSetOrDefault();
162 XGradient
const & GetGradientSetOrDefault();
163 OUString
const & GetHatchingSetOrDefault();
164 OUString
const & GetBitmapSetOrDefault();
165 OUString
const & GetPatternSetOrDefault();
169 void removeListener();
170 void ExecuteMarginLRChange(const long mnPageLeftMargin
, const long mnPageRightMargin
);
171 void ExecuteMarginULChange(const long mnPageTopMargin
, const long mnPageBottomMargin
);
172 void populateMasterSlideDropdown();
173 void updateMasterSlideSelection();
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */