LibreOffice Module sd (master) 1
LayoutMenu.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
24
25#include <svtools/valueset.hxx>
26#include <sfx2/request.hxx>
27#include <xmloff/autolayout.hxx>
28
30{
31class XStatusListener;
32}
33namespace com::sun::star::ui
34{
35class XSidebar;
36}
37
38namespace sd
39{
40class DrawDocShell;
41class ViewShellBase;
42}
43
44namespace sd::tools
45{
46class EventMultiplexerEvent;
47}
48
49namespace sd::sidebar
50{
51class LayoutValueSet;
52
53class LayoutMenu : public PanelLayout, public sfx2::sidebar::ILayoutableWindow
54{
55public:
64 LayoutMenu(weld::Widget* pParent, ViewShellBase& rViewShellBase,
65 css::uno::Reference<css::ui::XSidebar> xSidebar);
66 virtual ~LayoutMenu() override;
67
68 void Dispose();
69
74
75 // From ILayoutableWindow
76 virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 nWidth) override;
77
82 void InvalidateContent();
83
86 void ShowContextMenu(const Point* pPos);
87
91 virtual void DataChanged(const DataChangedEvent& rEvent) override;
92
93private:
95
96 std::unique_ptr<LayoutValueSet> mxLayoutValueSet;
97 std::unique_ptr<weld::CustomWeld> mxLayoutValueSetWin;
98
102 css::uno::Reference<css::frame::XStatusListener> mxListener;
104 css::uno::Reference<css::ui::XSidebar> mxSidebar;
106
110 void Fill();
111
114 void Clear();
115
121
128 void InsertPageWithLayout(AutoLayout aLayout);
129
138 SfxRequest CreateRequest(sal_uInt16 nSlotId, AutoLayout aLayout);
139
142 void UpdateSelection();
143
144 // internal ctor
145 void implConstruct(DrawDocShell& rDocumentShell);
146
149 DECL_LINK(ClickHandler, ValueSet*, void);
150 DECL_LINK(StateChangeHandler, const OUString&, void);
151 DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, void);
152 void OnMenuItemSelected(std::u16string_view ident);
153};
154
155} // end of namespace ::sd::toolpanel
156
157/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AutoLayout
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
void InvalidateContent()
Call this method when the set of displayed layouts is not up-to-date anymore.
Definition: LayoutMenu.cxx:342
virtual void DataChanged(const DataChangedEvent &rEvent) override
Call Fill() when switching to or from high contrast mode so that the correct set of icons is displaye...
Definition: LayoutMenu.cxx:717
void OnMenuItemSelected(std::u16string_view ident)
Definition: LayoutMenu.cxx:612
AutoLayout GetSelectedAutoLayout() const
Return a numerical value representing the currently selected layout.
Definition: LayoutMenu.cxx:234
DECL_LINK(StateChangeHandler, const OUString &, void)
void ShowContextMenu(const Point *pPos)
The context menu is requested over this ShowContextMenu() method.
Definition: LayoutMenu.cxx:566
void UpdateSelection()
Select the layout that is used by the current page.
Definition: LayoutMenu.cxx:634
virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 nWidth) override
Definition: LayoutMenu.cxx:248
void Fill()
Fill the value set with the layouts that are applicable to the current main view shell.
Definition: LayoutMenu.cxx:496
LayoutMenu(weld::Widget *pParent, ViewShellBase &rViewShellBase, css::uno::Reference< css::ui::XSidebar > xSidebar)
Create a new layout menu.
Definition: LayoutMenu.cxx:158
std::unique_ptr< weld::CustomWeld > mxLayoutValueSetWin
Definition: LayoutMenu.hxx:97
DECL_LINK(ClickHandler, ValueSet *, void)
When clicked then set the current page of the view in the center pane.
ViewShellBase & mrBase
Definition: LayoutMenu.hxx:94
std::unique_ptr< LayoutValueSet > mxLayoutValueSet
Definition: LayoutMenu.hxx:96
css::uno::Reference< css::frame::XStatusListener > mxListener
If we are asked for the preferred window size, then use this many columns for the calculation.
Definition: LayoutMenu.hxx:102
void AssignLayoutToSelectedSlides(AutoLayout aLayout)
Assign the given layout to all selected slides of a slide sorter.
Definition: LayoutMenu.cxx:377
virtual ~LayoutMenu() override
Definition: LayoutMenu.cxx:208
css::uno::Reference< css::ui::XSidebar > mxSidebar
Definition: LayoutMenu.hxx:104
void Clear()
Remove all items from the value set.
Definition: LayoutMenu.cxx:559
DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent &, void)
void implConstruct(DrawDocShell &rDocumentShell)
Definition: LayoutMenu.cxx:178
void InsertPageWithLayout(AutoLayout aLayout)
Insert a new page with the given layout.
Definition: LayoutMenu.cxx:318
SfxRequest CreateRequest(sal_uInt16 nSlotId, AutoLayout aLayout)
Create a request structure that can be used with the SID_INSERTPAGE and SID_MODIFYPAGE slots.
Definition: LayoutMenu.cxx:461