LibreOffice Module sd (master) 1
SlideSorterViewShell.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 "ViewShell.hxx"
23#include <glob.hxx>
24#include <sfx2/shell.hxx>
25#include <sddllapi.h>
26#include <memory>
27#include <vector>
28
29namespace sd::slidesorter::controller { class SlotManager; }
30
31namespace sd::slidesorter {
32
33class SlideSorter;
34
35class SAL_DLLPUBLIC_RTTI SlideSorterViewShell final
36 : public ViewShell
37{
39
40public:
42
43private:
45 static void InitInterface_Impl();
46
47public:
48 static std::shared_ptr<SlideSorterViewShell> Create(
49 SfxViewFrame* pFrame,
50 ViewShellBase& rViewShellBase,
51 vcl::Window* pParentWindow,
52 FrameView* pFrameView);
53
54 virtual ~SlideSorterViewShell() override;
55
59 virtual void Init (bool bIsMainViewShell) override;
60
68 // Exported for unit test
69 SD_DLLPUBLIC static SlideSorterViewShell* GetSlideSorter(ViewShellBase& rBase);
70
71 virtual SdPage* GetActualPage() override;
72
74 virtual SdPage* getCurrentPage() const override;
75
76 void ExecCtrl (SfxRequest& rRequest);
77 void GetCtrlState (SfxItemSet &rSet);
78 void FuSupport (SfxRequest& rRequest);
79 void FuTemporary (SfxRequest& rRequest);
80 void GetStatusBarState (SfxItemSet& rSet);
81 void FuPermanent (SfxRequest& rRequest);
82 void GetAttrState (SfxItemSet& rSet);
83 static void ExecStatusBar (SfxRequest& rRequest);
84 virtual void Command (const CommandEvent& rEvent, ::sd::Window* pWindow) override;
85 void GetMenuState (SfxItemSet &rSet);
86 void GetClipboardState (SfxItemSet &rSet);
87
88 virtual void ReadFrameViewData (FrameView* pView) override;
89 virtual void WriteFrameViewData() override;
90
97 virtual void SetZoom (::tools::Long nZoom) override;
98 virtual void SetZoomRect (const ::tools::Rectangle& rZoomRect) override;
99
103 virtual void Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin) override;
104
109 virtual void ArrangeGUIElements() override;
110
111 virtual void Activate (bool IsMDIActivate) override;
112 virtual void Deactivate (bool IsMDIActivate) override;
113
115 void ExecMovePageUp (SfxRequest& rReq);
116 void GetStateMovePageUp (SfxItemSet& rSet);
117
118 void ExecMovePageDown (SfxRequest& rReq);
119 void GetStateMovePageDown (SfxItemSet& rSet);
120
121 void ExecMovePageFirst (SfxRequest& rReq);
122 void GetStateMovePageFirst (SfxItemSet& rSet);
123
124 void ExecMovePageLast (SfxRequest& rReq);
125 void GetStateMovePageLast (SfxItemSet& rSet);
126
127
128 //===== Drag and Drop =====================================================
129
130 void StartDrag (
131 const Point& rDragPt,
132 vcl::Window* pWindow );
133 virtual sal_Int8 AcceptDrop (
134 const AcceptDropEvent& rEvt,
135 DropTargetHelper& rTargetHelper,
136 ::sd::Window* pTargetWindow,
137 sal_uInt16 nPage,
138 SdrLayerID nLayer ) override;
139 virtual sal_Int8 ExecuteDrop (
140 const ExecuteDropEvent& rEvt,
141 DropTargetHelper& rTargetHelper,
142 ::sd::Window* pTargetWindow,
143 sal_uInt16 nPage,
144 SdrLayerID nLayer) override;
145
146 typedef ::std::vector<SdPage*> PageSelection;
147
150 std::shared_ptr<PageSelection> GetPageSelection() const;
151
152 void SetPageSelection (const std::shared_ptr<PageSelection>& rSelection);
153
161 void AddSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
162
169 void RemoveSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
170
171 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() override;
172
180 virtual css::uno::Reference<css::accessibility::XAccessible>
181 CreateAccessibleDocumentView (::sd::Window* pWindow) override;
182 // handle SlideSorterView specially because AccessibleSlideSorterView doesn't inherit from AccessibleDocumentViewBase
183 virtual void SwitchViewFireFocus( const css::uno::Reference< css::accessibility::XAccessible >& xAcc ) override;
184
185 // Exported for unit test
186 SD_DLLPUBLIC SlideSorter& GetSlideSorter() const;
187
191 virtual bool RelocateToParentWindow (vcl::Window* pParentWindow) override;
192
193private:
194
198 virtual SfxUndoManager* ImpGetUndoManager() const override;
199
200 std::shared_ptr<SlideSorter> mpSlideSorter;
202
204 SfxViewFrame* pFrame,
205 ViewShellBase& rViewShellBase,
206 vcl::Window* pParentWindow,
207 FrameView* pFrameView);
208 void Initialize();
209
214 virtual void UpdateScrollBars() override;
215
216 void PostMoveSlidesActions(const std::shared_ptr<SlideSorterViewShell::PageSelection> &rpSelection);
217
218 void MainViewEndEditAndUnmarkAll();
219
225 std::pair<sal_uInt16, sal_uInt16> SyncPageSelectionToDocument(const std::shared_ptr<SlideSorterViewShell::PageSelection> &rpSelection);
226};
227
228typedef std::shared_ptr<SlideSorterViewShell::PageSelection> SharedPageSelection;
229
230} // end of namespace ::sd::slidesorter
231
232/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
View for MDIFrame.
Definition: FrameView.hxx:36
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
std::shared_ptr< SlideSorter > mpSlideSorter
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 manager takes over the work of handling slot calls from the controller of the slide sorter.
void Init()
#define SD_IF_SDSLIDESORTERVIEWSHELL
Definition: glob.hxx:35
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
std::shared_ptr< SlideSorterViewShell::PageSelection > SharedPageSelection
long Long
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
#define SFX_DECL_INTERFACE(nId)
signed char sal_Int8