47#include <drawview.hxx>
55#include <svx/svxids.hrc>
62#define ShellClass_SlideSorterViewShell
69using ::sd::framework::FrameworkHelper;
70using ::vcl::EnumContext;
77bool inChartOrMathContext(
const sd::View* pView)
83 SidebarController* pSidebar = SidebarController::GetSidebarControllerForView(pViewShell);
97 GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
98 GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
108 std::shared_ptr<SlideSorterViewShell> pViewShell;
113 pViewShell->Initialize();
114 if (pViewShell->mpSlideSorter ==
nullptr)
129 :
ViewShell (pParentWindow, rViewShellBase),
130 mbIsArrangeGUIElementsPending(true)
135 if (pFrameViewArgument !=
nullptr)
141 SetName (
"SlideSorterViewShell");
153 if (pWindow!=
nullptr)
155 css::uno::Reference<css::lang::XComponent> xComponent (
157 css::uno::UNO_QUERY);
159 xComponent->dispose();
162 catch( css::uno::Exception& )
203 pActiveWindow->
Show();
215 OUString aPaneURLs[] = {
216 FrameworkHelper::msCenterPaneURL,
218 FrameworkHelper::msLeftImpressPaneURL,
219 FrameworkHelper::msLeftDrawPaneURL,
224 std::shared_ptr<FrameworkHelper> pFrameworkHelper (FrameworkHelper::Instance(rBase));
225 if (pFrameworkHelper->IsValid())
226 for (
int i=0; pViewShell==
nullptr && !aPaneURLs[
i].isEmpty(); ++
i)
229 pFrameworkHelper->GetViewShell(aPaneURLs[
i]).get());
232 catch (RuntimeException&)
240 Reference<drawing::XDrawSubController> xSubController;
248 return xSubController;
256css::uno::Reference<css::accessibility::XAccessible>
267 new ::accessibility::AccessibleSlideSorterView(
271 pAccessibleView->Init();
273 return pAccessibleView;
309 if (pObjectBar !=
nullptr)
334 SdPage* pCurrentPage =
nullptr;
341 if (pMainViewShell !=
nullptr)
342 pCurrentPage = pMainViewShell->GetActualPage();
345 if (pCurrentPage ==
nullptr)
348 mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide());
350 pCurrentPage = pDescriptor->GetPage();
399 if (pCurrentPage !=
nullptr)
400 mpImpl->ProcessModifyPageSlot (
438 const ::tools::Rectangle& rBBox,
461 if(inChartOrMathContext(
GetView()))
477 EnumContext::Context eContext = EnumContext::Context::Unknown;
478 std::shared_ptr<ViewShell> pMainViewShell (
GetViewShellBase().GetMainViewShell());
481 ? pMainViewShell->GetShellType()
483 switch (eMainViewShellType)
489 eContext = EnumContext::Context::DrawPage;
490 if(
nullptr !=
dynamic_cast< const DrawViewShell *
>( pMainViewShell.get() ))
493 if (pDrawViewShell !=
nullptr)
517 if ( !
mpSlideSorter->GetController().Command (rEvent, pWindow))
524 if (pFrameView !=
nullptr)
529 if (nSlidesPerRow > 0
536 mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange(
551 if (pMainViewShell !=
nullptr)
552 mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange(
553 pMainViewShell->getCurrentPage());
571 if (pActualPage !=
nullptr)
609 if (aRect.
Left() < 0)
638 mpSlideSorter->GetController().GetScrollBarManager().UpdateScrollBars(
true);
642 const Point& rDragPt,
653 DropTargetHelper& rTargetHelper,
659 return mpSlideSorter->GetController().GetClipboard().AcceptDrop (
669 DropTargetHelper& rTargetHelper,
675 return mpSlideSorter->GetController().GetClipboard().ExecuteDrop (
683std::shared_ptr<SlideSorterViewShell::PageSelection>
687 return mpSlideSorter->GetController().GetPageSelector().GetPageSelection();
691 const std::shared_ptr<PageSelection>& rSelection)
694 mpSlideSorter->GetController().GetPageSelector().SetPageSelection(rSelection,
true);
701 mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback);
708 mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback);
726 sal_uInt16 lastSelectedPageNo = 0;
729 for (
auto& rpPage : *rpSelection)
732 sal_uInt16 pageNo = rpPage->GetPageNum();
733 if (pageNo > lastSelectedPageNo)
734 lastSelectedPageNo = pageNo;
735 if (pageNo < firstSelectedPageNo)
736 firstSelectedPageNo = pageNo;
740 return std::make_pair(firstSelectedPageNo, lastSelectedPageNo);
747 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
773 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
779 firstSelectedPageNo = (firstSelectedPageNo - 1) / 2;
781 if (firstSelectedPageNo == 0)
792 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
803 firstSelectedPageNo = (firstSelectedPageNo - 1) / 2;
805 if (firstSelectedPageNo == 0)
824 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
834 lastSelectedPageNo = (lastSelectedPageNo - 1) / 2;
835 if (lastSelectedPageNo == nNoOfPages - 1)
853 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
879 std::shared_ptr<SlideSorterViewShell::PageSelection> xSelection(
GetPageSelection());
889 lastSelectedPageNo = (lastSelectedPageNo - 1) / 2;
890 if (lastSelectedPageNo == nNoOfPages - 1)
900 for (sal_uInt16 nPage = 0; nPage < nNoOfPages; nPage++)
906 mpSlideSorter->GetController().GetPageSelector().DeselectAllPages();
907 for (
const auto& rpPage : *rpSelection)
909 mpSlideSorter->GetController().GetPageSelector().SelectPage(rpPage);
static void NotifyContextChange(const css::uno::Reference< css::frame::XController > &rxController, const vcl::EnumContext::Context eContext)
void SetDrawMode(DrawModeFlags nDrawMode)
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage)
SAL_DLLPRIVATE void UnselectAllPages()
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
sal_uInt16 GetPageNum() const
void Invalidate(sal_uInt16 nId)
void DisableItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void Done(bool bRemove=false)
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
SfxItemPool & GetPool() const
bool SetContextBroadcasterEnabled(const bool bIsEnabled)
virtual SfxUndoManager * GetUndoManager()
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
SfxBindings & GetBindings()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
This class makes the SlideSorterViewShell accessible.
void SwitchViewActivated()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
OUString const & GetSidebarContextName() const
DrawView * GetDrawView() const
PageKind GetPageKind() const
sal_uInt16 GetSelectedPage() const
void SetDrawMode(DrawModeFlags nNewDrawMode)
sal_uInt16 GetSlidesPerRow() const
void SetSlidesPerRow(sal_uInt16 nSlides)
void SetSelectedPage(sal_uInt16 nPage)
DrawModeFlags GetDrawMode() const
This class implements the SlideSorter specific part of the controller.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
VclPtr< ScrollAdaptor > mpVerticalScrollBar
Vertical scroll bar for whole document is always visible.
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
SdDrawDocument * GetDoc() const
std::unique_ptr< Implementation, o3tl::default_delete< Implementation > > mpImpl
void GetMenuState(SfxItemSet &rSet)
set state (enabled/disabled) of Menu SfxSlots
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin)
void DisposeFunctions()
must be called in the beginning of each subclass d'tor.
ShellType meShellType
The type of the shell. Returned by GetShellType().
void SetActiveWindow(::sd::Window *pWindow)
Set the active window.
FrameView * GetFrameView()
virtual void Init(bool bIsMainViewShell)
The Init method has to be called from the outside directly after a new object of this class has been ...
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
void Cancel()
this method deactivates the current function.
virtual void Activate(bool IsMDIActivate) override
set focus to working window
VclPtr< sd::Window > mpContentWindow
Window inside the rulers and scroll bars that shows a view of the document.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
void doShow()
This must be called after the ctor, but before anything else.
VclPtr< ScrollAdaptor > mpHorizontalScrollBar
Horizontal scroll bar for the current slide is displayed when needed.
sd::Window * GetContentWindow() const
SfxViewShell * GetSfxViewShell() const override
An SdWindow contains the actual working area of ViewShell.
void FuSupport(SfxRequest &rRequest)
virtual bool RelocateToParentWindow(vcl::Window *pParentWindow) override
Try to relocate all toplevel window elements to the given parent window.
virtual void WriteFrameViewData() override
void GetCtrlState(SfxItemSet &rSet)
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Set zoom rectangle for active window.
std::pair< sal_uInt16, sal_uInt16 > SyncPageSelectionToDocument(const std::shared_ptr< SlideSorterViewShell::PageSelection > &rpSelection)
Select the same pages in the document as are selected in the SlideSorterViewShell.
virtual void Command(const CommandEvent &rEvent, ::sd::Window *pWindow) override
void AddSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a listener that is called when the selection of the slide sorter changes.
void GetStatusBarState(SfxItemSet &rSet)
virtual void SwitchViewFireFocus(const css::uno::Reference< css::accessibility::XAccessible > &xAcc) override
virtual void Paint(const ::tools::Rectangle &rRect, ::sd::Window *pWin) override
This is a callback method used by the active window to delegate its Paint() call to.
void ExecCtrl(SfxRequest &rRequest)
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
void FuPermanent(SfxRequest &rRequest)
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
void GetClipboardState(SfxItemSet &rSet)
void GetAttrState(SfxItemSet &rSet)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleDocumentView(::sd::Window *pWindow) override
Create an accessible object representing the specified window.
void MainViewEndEditAndUnmarkAll()
virtual void UpdateScrollBars() override
This method overwrites the one from our base class: We do our own scroll bar and the base class call ...
static void ExecStatusBar(SfxRequest &rRequest)
void FuTemporary(SfxRequest &rRequest)
We have to handle those slot calls here that need to have access to private or protected members and ...
void PostMoveSlidesActions(const std::shared_ptr< SlideSorterViewShell::PageSelection > &rpSelection)
virtual void SetZoom(::tools::Long nZoom) override
Set the zoom factor.
virtual void ArrangeGUIElements() override
Place and size the controls and windows.
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
void StartDrag(const Point &rDragPt, vcl::Window *pWindow)
SlideSorterViewShell(SfxViewFrame *pFrame, ViewShellBase &rViewShellBase, vcl::Window *pParentWindow, FrameView *pFrameView)
virtual void Init(bool bIsMainViewShell) override
Late initialization that has to be called after a new instance has completed its construction.
static std::shared_ptr< SlideSorterViewShell > Create(SfxViewFrame *pFrame, ViewShellBase &rViewShellBase, vcl::Window *pParentWindow, FrameView *pFrameView)
void GetStateMovePageLast(SfxItemSet &rSet)
void GetStateMovePageFirst(SfxItemSet &rSet)
virtual void ReadFrameViewData(FrameView *pView) override
bool mbIsArrangeGUIElementsPending
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) override
virtual css::uno::Reference< css::drawing::XDrawSubController > CreateSubController() override
Return a sub controller that implements the view shell specific part of the DrawController.
void ExecMovePageUp(SfxRequest &rReq)
Move slides up and down.
void GetStateMovePageUp(SfxItemSet &rSet)
virtual void Activate(bool IsMDIActivate) override
set focus to working window
virtual ~SlideSorterViewShell() override
std::shared_ptr< SlideSorter > mpSlideSorter
void GetStateMovePageDown(SfxItemSet &rSet)
virtual void Deactivate(bool IsMDIActivate) override
void SetPageSelection(const std::shared_ptr< PageSelection > &rSelection)
virtual SdPage * GetActualPage() override
void RemoveSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a listener that was called when the selection of the slide sorter changes.
void GetMenuState(SfxItemSet &rSet)
std::shared_ptr< PageSelection > GetPageSelection() const
Return the set of selected pages.
void ExecMovePageFirst(SfxRequest &rReq)
void ExecMovePageDown(SfxRequest &rReq)
void ExecMovePageLast(SfxRequest &rReq)
virtual SfxUndoManager * ImpGetUndoManager() const override
Override this method to handle a missing tool bar correctly.
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
static std::shared_ptr< SlideSorter > CreateSlideSorter(ViewShell &rViewShell, sd::Window *pContentWindow, ScrollAdaptor *pHorizontalScrollBar, ScrollAdaptor *pVerticalScrollBar)
Create a new slide sorter that is strongly coupled to the given view shell.
void SetColumnCount(sal_Int32 nMinimalColumnCount, sal_Int32 nMaximalColumnCount)
Set the interval of valid column counts.
sal_Int32 GetColumnCount() const
Return the number of columns.
view::Layouter & GetLayouter()
Layouter::Orientation GetOrientation() const
void SetStyle(WinBits nStyle)
void set_id(const OUString &rID)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
::OutputDevice const * GetOutDev() const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
#define TOOLS_WARN_EXCEPTION(area, stream)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
const OUString msFullScreenPaneURL
#define SFX_IMPL_INTERFACE(Class, SuperClass)
WinBits const WB_DIALOGCONTROL