61#include <svx/svxids.hrc>
70#include <com/sun/star/lang/XComponent.hpp>
71#include <com/sun/star/accessibility/AccessibleEventId.hpp>
91 mnModelChangeLockCount(0),
92 mbIsForcedRearrangePending(false),
93 mbContextMenuOpen(false),
94 mbPostModelChangePending(false),
95 mnCurrentPageBeforeSwitch(0),
96 mpEditModeChangeMasterPage(nullptr),
97 mnPaintEntranceCount(0)
106 OSL_ASSERT(pParentWindow!=
nullptr);
144 uno::Reference<lang::XComponent> xComponent =
mpListener;
146 xComponent->dispose();
148 catch( uno::Exception& )
166 const Point& aWindowPosition)
170 if (nHitPageIndex >= 0)
176 if (pDescriptorAtPoint
177 && ! pDescriptorAtPoint->HasState(PageDescriptor::ST_Selected))
185 pDescriptorAtPoint.reset();
190 return pDescriptorAtPoint;
235std::shared_ptr<InsertionIndicatorHandler>
const &
243 const ::tools::Rectangle& rBBox,
282 bool bEventHasBeenHandled =
false;
284 if (pWindow ==
nullptr)
288 if (pViewShell ==
nullptr)
293 case CommandEventId::ContextMenu:
299 PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrModel));
305 if (pPage !=
nullptr)
306 aPopupId =
"pagepane";
308 aPopupId =
"pagepanenosel";
310 else if (pPage !=
nullptr)
311 aPopupId =
"pagepanemaster";
313 aPopupId =
"pagepanenoselmaster";
315 std::unique_ptr<InsertionIndicatorHandler::ForceShowContext, o3tl::default_delete<InsertionIndicatorHandler::ForceShowContext>> xContext;
316 if (pPage ==
nullptr)
332 Point aMenuLocation (0,0);
344 PageObjectLayouter::Part::PageObject,
345 PageObjectLayouter::ModelCoordinateSystem));
346 aMenuLocation = aBBox.
Center();
354 pDispatcher->ExecutePopup(aPopupId, pWindow, &aMenuLocation);
356 pDispatcher->ExecutePopup(aPopupId, pWindow);
361 pFunction->ResetMouseAnchor();
363 if (pPage ==
nullptr)
372 bEventHasBeenHandled =
true;
376 case CommandEventId::Wheel:
379 if (
pData ==
nullptr)
394 -
pData->GetNotchDelta());
400 -
pData->GetNotchDelta());
404 bEventHasBeenHandled =
true;
411 return bEventHasBeenHandled;
478 if (bIsDocumentValid)
488 if (windowEvent !=
nullptr) {
489 WindowEventHandler(*windowEvent);
496 switch (rEvent.GetId())
498 case VclEventId::WindowActivate:
499 case VclEventId::WindowShow:
500 if (pActiveWindow && pWindow == pActiveWindow->
GetParent())
504 case VclEventId::WindowHide:
505 if (pActiveWindow && pWindow == pActiveWindow->
GetParent())
509 case VclEventId::WindowGetFocus:
511 if (pWindow == pActiveWindow)
512 GetFocusManager().ShowFocus(
false);
515 case VclEventId::WindowLoseFocus:
516 if (pActiveWindow && pWindow == pActiveWindow)
518 GetFocusManager().HideFocus();
519 mrView.GetToolTip().Hide();
523 if (!mbContextMenuOpen)
527 GetPageSelector().SelectPage(GetCurrentSlideManager()->GetCurrentSlide());
532 case VclEventId::ApplicationDataChanged:
542 mrSlideSorter.GetViewShell()->GetFrameView()->SetDrawMode(nDrawMode);
543 if (pActiveWindow !=
nullptr)
545 mrView.HandleDrawModeChange();
553 mrView.HandleDataChangeEvent();
569 "SlideSorterController::GetCtrlState: ViewFrame not found");
589 sal_uInt16 nQuality = 0;
608 if (
rSet.
GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) == SfxItemState::DEFAULT)
670 bool bSizeHasChanged (
false);
676 bSizeHasChanged = (aNewContentArea != aCurrentContentArea);
678 if (bForce || bSizeHasChanged)
704 return ::rtl::Reference<SelectionFunction>(
dynamic_cast<SelectionFunction*
>(pFunction.get()));
720 PageEnumeration aSelectedPages (
721 PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrModel));
722 while (aSelectedPages.HasMoreElements())
725 SdPage* pPage = pDescriptor->GetPage();
761 PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(
mrModel));
762 while (aAllPages.HasMoreElements())
804 css::uno::Reference< css::accessibility::XAccessible >
806 if ( ! xAccessible.is())
821 if (pAccessibleView ==
nullptr)
826 if (pChild ==
nullptr || pChild->
GetPage() ==
nullptr)
831 css::accessibility::AccessibleEventId::NAME_CHANGED,
857 PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(
mrModel));
858 while (aAllPages.HasMoreElements())
861 if (pDescriptor->UpdateMasterPage())
864 pDescriptor->GetPage());
873 PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(
mrModel));
874 while (aAllPages.HasMoreElements())
877 if (pDescriptor->UpdateTransitionFlag())
880 pDescriptor->GetPage());
SlideSorter & mrSlideSorter
static const AllSettings & GetSettings()
CommandEventId GetCommand() const
const CommandWheelData * GetWheelData() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
void SetDrawMode(DrawModeFlags nDrawMode)
const OUString & GetName() const
const SfxItemPool & GetItemPool() const
sal_uInt16 GetPageCount() const
SdrPage & TRG_GetMasterPage() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
SfxDispatcher * GetDispatcher() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
reference_type * get() const
This class makes page objects of the slide sorter accessible.
SdPage * GetPage() const
Return the page that is made accessible by the called object.
void FireAccessibleEvent(short nEventId, const css::uno::Any &rOldValue, const css::uno::Any &rNewValue)
This class makes the SlideSorterViewShell accessible.
AccessibleSlideSorterObject * GetAccessibleChildImplementation(sal_Int32 nIndex)
Return the implementation object of the specified child.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
@ HINT_COMPLEX_MODEL_CHANGE_END
@ HINT_COMPLEX_MODEL_CHANGE_START
Base class of the stacked shell hierarchy.
const rtl::Reference< FuPoor > & GetCurrentFunction() const
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
An SdWindow contains the actual working area of ViewShell.
void SetViewSize(const Size &rSize)
Set size of the whole working area which can be seen with the window.
void SetCenterAllowed(bool bIsAllowed)
void SetViewOrigin(const Point &rPnt)
Set origin of the representation in respect to the whole working area.
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
void SetCurrentFunction(const rtl::Reference< FuPoor > &rpFunction)
Set the current function at the view shell or, when it is not present, set it at the content window.
const VclPtr< sd::Window > & GetContentWindow() const
Return the content window.
view::SlideSorterView & GetView() const
static std::shared_ptr< PageCacheManager > Instance()
Return the one instance of the PageCacheManager class.
Experimental class for simple eye candy animations.
This class manages the focus of the slide sorter.
This context make sure that the insertion indicator is shown (provided that the clipboard is not empt...
Manage the visibility and location of the insertion indicator.
Listen for events of various types and sources and react to them.
A sub-controller that handles page selection of the slide browser.
static rtl::Reference< FuPoor > Create(SlideSorter &rSlideSorter, SfxRequest &rRequest)
Create an object of this inner class to prevent updates due to model changes.
ModelChangeLock(SlideSorterController &rController)
~ModelChangeLock() COVERITY_NOEXCEPT_FALSE
SlideSorterController * mpController
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.
std::unique_ptr< PageSelector > mpPageSelector
::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,...
void FuTemporary(SfxRequest &rRequest)
void PreModelChange()
Prepare for a model change.
bool mbPostModelChangePending
std::shared_ptr< SlotManager > const & GetSlotManager() const
SlideSorter & mrSlideSorter
void PrepareEditModeChange()
Prepare for a change of the edit mode.
FocusManager & GetFocusManager()
void FuPermanent(SfxRequest &rRequest)
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::SlideSorterModel & mrModel
void ExecCtrl(SfxRequest &rRequest)
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
void CheckForSlideTransitionAssignment()
std::shared_ptr< SelectionManager > const & GetSelectionManager() const
::tools::Rectangle maTotalWindowArea
This rectangle in the parent window encloses scroll bars and slide sorter window.
SD_DLLPUBLIC PageSelector & GetPageSelector()
SlideSorterController(SlideSorter &rSlideSorter)
Create a new controller for the slide sorter.
std::shared_ptr< SelectionManager > mpSelectionManager
void PostModelChange()
Complete a model change.
view::SlideSorterView & mrView
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.
void CheckForMasterPageAssignment()
std::shared_ptr< Animator > mpAnimator
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
void GetCtrlState(SfxItemSet &rSet)
std::unique_ptr< ScrollBarManager > mpScrollBarManager
VisibleAreaManager & GetVisibleAreaManager() const
std::shared_ptr< SlotManager > mpSlotManager
void GetStatusBarState(SfxItemSet &rSet)
::std::vector< SdPage * > maSelectionBeforeSwitch
This array stores the indices of the selected page descriptors at the time when the edit mode is swit...
void FuSupport(SfxRequest &rRequest)
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.
std::unique_ptr< FocusManager > mpFocusManager
bool Command(const CommandEvent &rEvent, ::sd::Window *pWindow)
bool mbIsForcedRearrangePending
SD_DLLPUBLIC controller::Clipboard & GetClipboard()
void GetAttrState(SfxItemSet &rSet)
int mnModelChangeLockCount
std::shared_ptr< InsertionIndicatorHandler > mpInsertionIndicatorHandler
void Init()
Late initialization.
Manage requests for scrolling page objects into view.
void RequestCurrentSlideVisible()
Request the current slide to be moved into the visible area.
Public class of page enumerations that delegates its calls to an implementation object that can filte...
virtual SharedPageDescriptor GetNextElement() override
Return the next element of the enumeration.
virtual bool HasMoreElements() const override
Return <TRUE> when the enumeration has more elements, i.e.
bool SetEditMode(EditMode eEditMode)
Set a new edit mode and return whether the edit mode really has been changed.
SdDrawDocument * GetDocument()
This method is present to let the view create a ShowView for displaying slides.
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
EditMode GetEditMode() const
css::uno::Reference< css::container::XIndexAccess > GetDocumentSlides() const
Return the set of pages that is currently displayed by the slide sorter.
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
void SetDocumentSlides(const css::uno::Reference< css::container::XIndexAccess > &rxSlides)
Set the XIndexAccess from which the called SlideSorterModel takes its pages.
void Resync()
Call this method after the document has changed its structure.
std::shared_ptr< PageObjectLayouter > const & GetPageObjectLayouter() const
view::Layouter & GetLayouter()
virtual void CompleteRedraw(OutputDevice *pDevice, const vcl::Region &rPaintArea, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr) override
The event will be forwarded to the View.
Layouter::Orientation GetOrientation() const
sal_Int32 GetPageIndexAtPoint(const Point &rPosition) const
Return the index of the page that is rendered at the given position.
std::shared_ptr< cache::PageCache > const & GetPreviewCache()
::tools::Rectangle GetModelArea() const
void PostModelChange()
This method is typically called after a model change took place.
void PreModelChange()
This method is typically called before a model change takes place.
void UpdatePageUnderMouse()
The page under the mouse is not highlighted in some contexts.
vcl::Window * GetParent() const
virtual Point GetPosPixel() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
Size GetOutputSizePixel() const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
std::unique_ptr< sal_Int32[]> pData
std::shared_ptr< T > make_shared(Args &&... args)
IMPL_LINK(SlideSorterController, ApplicationEventHandler, VclSimpleEvent &, rEvent, void)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
const DrawModeFlags OUTPUT_DRAWMODE_GRAYSCALE
const DrawModeFlags OUTPUT_DRAWMODE_BLACKWHITE
const DrawModeFlags OUTPUT_DRAWMODE_COLOR
SvxTableController * mpController