LibreOffice Module sd (master) 1
SlideSorterController.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
23#include <pres.hxx>
24
25#include <tools/link.hxx>
26#include <tools/gen.hxx>
27#include <rtl/ref.hxx>
28#include <rtl/ustring.hxx>
29
30#include <sddllapi.h>
31
32#include <memory>
33#include <vector>
34
36{
37class XIndexAccess;
38}
39namespace com::sun::star::uno
40{
41template <typename> class Reference;
42}
43namespace sd
44{
45class FuPoor;
46}
47namespace sd
48{
49class Window;
50}
51namespace vcl
52{
53class Window;
54}
55
56namespace sd::slidesorter
57{
58class SlideSorter;
59}
61{
62class SlideSorterView;
63}
65{
66class SlideSorterModel;
67}
68
69class CommandEvent;
70class SdPage;
71class SfxItemSet;
72class SfxRequest;
73class VclSimpleEvent;
74class VclWindowEvent;
75
77{
78class Animator;
79class Clipboard;
80class CurrentSlideManager;
81class FocusManager;
82class InsertionIndicatorHandler;
83class Listener;
84class PageSelector;
85class ScrollBarManager;
86class SelectionFunction;
87class SelectionManager;
88class SlotManager;
89class VisibleAreaManager;
90
92{
93public:
100
104 void Init();
105
107
108 void Dispose();
109
113 void Resize(const ::tools::Rectangle& rAvailableSpace);
114
124 void Rearrange(bool bForce);
125
134 model::SharedPageDescriptor GetPageAt(const Point& rPixelPosition);
135
136 // Exported for unit test
139 // Exported for unit test
141
145
146 std::shared_ptr<CurrentSlideManager> const& GetCurrentSlideManager() const;
147 std::shared_ptr<SlotManager> const& GetSlotManager() const;
148 std::shared_ptr<SelectionManager> const& GetSelectionManager() const;
149 std::shared_ptr<InsertionIndicatorHandler> const& GetInsertionIndicatorHandler() const;
150
154 void Paint(const ::tools::Rectangle& rRect, vcl::Window* pWin);
155
156 void FuTemporary(SfxRequest& rRequest);
157 void FuPermanent(SfxRequest& rRequest);
158 void FuSupport(SfxRequest& rRequest);
159 bool Command(const CommandEvent& rEvent, ::sd::Window* pWindow);
160
163
164 void ExecCtrl(SfxRequest& rRequest);
166
171 {
172 public:
174 ~ModelChangeLock() COVERITY_NOEXCEPT_FALSE;
175 void Release();
176
177 private:
179 };
180 friend class ModelChangeLock;
181
188 void HandleModelChange();
189
190 DECL_LINK(WindowEventHandler, VclWindowEvent&, void);
191 DECL_LINK(ApplicationEventHandler, VclSimpleEvent&, void);
192
196 void UpdateAllPages();
197
201
207
213
219 void ChangeEditMode(EditMode eEditMode);
220
225
234 void PageNameHasChanged(int nPageIndex, const OUString& rsOldName);
235
239 void SetDocumentSlides(const css::uno::Reference<css::container::XIndexAccess>& rxSlides);
240
243 const std::shared_ptr<Animator>& GetAnimator() const { return mpAnimator; }
244
246
249
250private:
254 std::unique_ptr<PageSelector> mpPageSelector;
255 std::unique_ptr<FocusManager> mpFocusManager;
256 std::shared_ptr<SlotManager> mpSlotManager;
257 std::unique_ptr<ScrollBarManager> mpScrollBarManager;
258 mutable std::shared_ptr<CurrentSlideManager> mpCurrentSlideManager;
259 std::shared_ptr<SelectionManager> mpSelectionManager;
260 std::unique_ptr<controller::Clipboard> mpClipboard;
261 std::shared_ptr<InsertionIndicatorHandler> mpInsertionIndicatorHandler;
262 std::shared_ptr<Animator> mpAnimator;
263 std::unique_ptr<VisibleAreaManager> mpVisibleAreaManager;
264
265 // The listener listens to UNO events and thus is a UNO object.
267
271
273
278 ::std::vector<SdPage*> maSelectionBeforeSwitch;
281
287
292
297
303 void LockModelChange();
304
310 void UnlockModelChange();
311
316 void PreModelChange();
317
322 void PostModelChange();
323};
324
325} // end of namespace ::sd::slidesorter::controller
326
327/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
This class manages the focus of the slide sorter.
A sub-controller that handles page selection of the slide browser.
Manage the horizontal and vertical scroll bars.
Create an object of this inner class to prevent updates due to model changes.
void HandleModelChange()
Handle a change of the model, that is, handle the removal and insertion of whole pages or a change of...
void PageNameHasChanged(int nPageIndex, const OUString &rsOldName)
Call this method when the name of one of the pages has changed.
const std::shared_ptr< Animator > & GetAnimator() const
Return an Animator object.
::rtl::Reference< SelectionFunction > GetCurrentSelectionFunction() const
When the current function of the view shell is the slide sorter selection function then return a refe...
void Resize(const ::tools::Rectangle &rAvailableSpace)
Place and size the scroll bars and the browser window so that the given rectangle is filled.
void LockModelChange()
Prepare for several model changes, i.e.
void UnlockModelChange()
Further calls to HandleModelChange() will result in a full featured update of model,...
DECL_LINK(ApplicationEventHandler, VclSimpleEvent &, void)
std::shared_ptr< SlotManager > const & GetSlotManager() const
DECL_LINK(WindowEventHandler, VclWindowEvent &, void)
void PrepareEditModeChange()
Prepare for a change of the edit mode.
std::unique_ptr< VisibleAreaManager > mpVisibleAreaManager
::rtl::Reference< controller::Listener > mpListener
sal_Int32 mnPaintEntranceCount
This counter is used to avoid processing of reentrant calls to Paint().
void ChangeEditMode(EditMode eEditMode)
Set a new edit mode and return whether the edit mode really has been changed.
std::shared_ptr< CurrentSlideManager > mpCurrentSlideManager
model::SharedPageDescriptor GetPageAt(const Point &rPixelPosition)
Return the descriptor of the page that is rendered under the given position.
std::shared_ptr< CurrentSlideManager > const & GetCurrentSlideManager() const
std::shared_ptr< SelectionManager > const & GetSelectionManager() const
::tools::Rectangle maTotalWindowArea
This rectangle in the parent window encloses scroll bars and slide sorter window.
SlideSorterController(SlideSorter &rSlideSorter)
Create a new controller for the slide sorter.
std::shared_ptr< SelectionManager > mpSelectionManager
void Paint(const ::tools::Rectangle &rRect, vcl::Window *pWin)
This method forwards the call to the SlideSorterView and executes pending operations like moving sele...
void Rearrange(bool bForce)
Determine which of the UI elements–the scroll bars, the scroll bar filler, the actual slide sorter vi...
ScrollBarManager & GetScrollBarManager()
Return the object that manages the scroll bars.
SdPage * mpEditModeChangeMasterPage
The master page to select after the edit mode is changed.
void SetDocumentSlides(const css::uno::Reference< css::container::XIndexAccess > &rxSlides)
Provide the set of pages to be displayed in the slide sorter.
void UpdateAllPages()
Update the display of all pages.
std::shared_ptr< InsertionIndicatorHandler > const & GetInsertionIndicatorHandler() const
std::unique_ptr< ScrollBarManager > mpScrollBarManager
::std::vector< SdPage * > maSelectionBeforeSwitch
This array stores the indices of the selected page descriptors at the time when the edit mode is swit...
std::unique_ptr< controller::Clipboard > mpClipboard
int mnCurrentPageBeforeSwitch
The current page before the edit mode is switched to EditMode::MasterPage.
void FinishEditModeChange()
Finish the change of the edit mode.
rtl::Reference< FuPoor > CreateSelectionFunction(SfxRequest &rRequest)
This factory method creates a selection function.
bool Command(const CommandEvent &rEvent, ::sd::Window *pWindow)
SD_DLLPUBLIC controller::Clipboard & GetClipboard()
std::shared_ptr< InsertionIndicatorHandler > mpInsertionIndicatorHandler
Manage requests for scrolling page objects into view.
The model of the slide sorter gives access to the slides that are to be displayed in the slide sorter...
Reference
std::shared_ptr< PageDescriptor > SharedPageDescriptor
EditMode
Definition: pres.hxx:53
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
static SfxItemSet & rSet