LibreOffice Module sd (master) 1
SlideSorterView.cxx
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
21
22#include <SlideSorter.hxx>
23#include <ViewShell.hxx>
25#include "SlsLayeredDevice.hxx"
26#include <view/SlsLayouter.hxx>
30#include <view/SlsToolTip.hxx>
38#include <titledockwin.hxx>
39
40#include <sdpage.hxx>
41#include <Window.hxx>
42
43#include <comphelper/lok.hxx>
44#include <osl/diagnose.h>
45#include <vcl/svapp.hxx>
46#include <vcl/settings.hxx>
47#include <vcl/graphicfilter.hxx>
48
49#include <algorithm>
50
51//#define DEBUG_TIMING
52#ifdef DEBUG_TIMING
53#include <memory>
54#include <vector>
55#endif
56
57using namespace ::sd::slidesorter::model;
58using namespace ::drawinglayer::primitive2d;
59
60namespace sd::slidesorter::view {
61
62namespace {
68 class Painter : public ILayerPainter
69 {
70 public:
71 explicit Painter (SlideSorterView& rView) : mrView(rView) {}
72
73 virtual void Paint (OutputDevice& rDevice, const ::tools::Rectangle& rRepaintArea) override
74 {
75 mrView.Paint(rDevice,rRepaintArea);
76 }
77
78 virtual void SetLayerInvalidator (const SharedILayerInvalidator&) override {}
79
80 private:
81 SlideSorterView& mrView;
82 };
83}
84
85namespace {
86
87class BackgroundPainter
88 : public ILayerPainter
89{
90public:
91 explicit BackgroundPainter (const Color& rBackgroundColor) : maBackgroundColor(rBackgroundColor) {}
92 BackgroundPainter(const BackgroundPainter&) = delete;
93 BackgroundPainter& operator=(const BackgroundPainter&) = delete;
94
95 virtual void Paint (OutputDevice& rDevice, const ::tools::Rectangle& rRepaintArea) override
96 {
98 rDevice.SetLineColor();
99 rDevice.DrawRect(rRepaintArea);
100 }
101
102 virtual void SetLayerInvalidator (const SharedILayerInvalidator&) override {}
103
104 void SetColor (const Color& rColor) { maBackgroundColor = rColor; }
105
106private:
108};
109
110}
111
113 : ::sd::View (
114 *rSlideSorter.GetModel().GetDocument(),
115 rSlideSorter.GetContentWindow()->GetOutDev(),
116 rSlideSorter.GetViewShell()),
117 mrSlideSorter(rSlideSorter),
118 mrModel(rSlideSorter.GetModel()),
119 mbIsDisposed(false),
120 mpLayouter (new Layouter(rSlideSorter.GetContentWindow(), rSlideSorter.GetTheme())),
121 mbPageObjectVisibilitiesValid (false),
122 mpLayeredDevice(std::make_shared<LayeredDevice>(rSlideSorter.GetContentWindow())),
123 maVisiblePageRange(-1,-1),
124 maPreviewSize(0,0),
125 mbPreciousFlagUpdatePending(true),
126 meOrientation(Layouter::GRID),
127 mpBackgroundPainter(
128 std::make_shared<BackgroundPainter>(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background))),
129 mpToolTip(new ToolTip(mrSlideSorter)),
130 mbIsRearrangePending(true)
131{
132 // Hide the page that contains the page objects.
133 SetPageVisible (false);
134
135 // Register the background painter on level 1 to avoid the creation of a
136 // background buffer.
137 mpLayeredDevice->RegisterPainter(mpBackgroundPainter, 1);
138
139 // Wrap a shared_ptr-held-wrapper around this view and register it as
140 // painter at the layered device. There is no explicit destruction: in
141 // the SlideSorterView destructor the layered device is destroyed and
142 // with it the only reference to the wrapper which therefore is also
143 // destroyed.
144 SharedILayerPainter pPainter = std::make_shared<Painter>(*this);
145
146 // The painter is placed on level 1 to avoid buffering. This should be
147 // a little faster during animations because the previews are painted
148 // directly into the window, not via the buffer.
149 mpLayeredDevice->RegisterPainter(pPainter, 1);
150}
151
153{
154 if ( ! mbIsDisposed)
155 {
156 OSL_ASSERT(mbIsDisposed);
157 Dispose();
158 }
159}
160
162{
164}
165
167{
168 mpLayeredDevice->Dispose();
169 mpPreviewCache.reset();
170
172
173 // Hide the page to avoid problems in the view when deleting
174 // visualized objects
175 HideSdrPage();
176
177 // Deletion of the objects and the page will be done in SdrModel
178 // destructor (as long as objects and pages are added)
179
180 OSL_ASSERT(mpLayeredDevice.use_count() == 1);
181 mpLayeredDevice.reset();
182
183 mbIsDisposed = true;
184}
185
186sal_Int32 SlideSorterView::GetPageIndexAtPoint (const Point& rWindowPosition) const
187{
188 sal_Int32 nIndex (-1);
189
191 if (pWindow)
192 {
193 nIndex = mpLayouter->GetIndexAtPoint(pWindow->PixelToLogic(rWindowPosition), false, false);
194
195 // Clip the page index against the page count.
196 if (nIndex >= mrModel.GetPageCount())
197 nIndex = -1;
198 }
199
200 return nIndex;
201}
202
204
206{
207 // Ignore this call. Rely on hints sent by the model to get informed of
208 // model changes.
209}
210
212{
213 // Reset the slide under the mouse. It will be re-set in PostModelChange().
215}
216
218{
219 // In PreModelChange() the page objects have been released. Here we
220 // create new ones.
221 ::osl::MutexGuard aGuard (mrModel.GetMutex());
222
224
225 // The new page objects have to be scaled and positioned.
228}
229
236{
239}
240
242{
243 // Replace the preview cache with a new and empty one. The
244 // PreviewRenderer that is used by the cache is replaced by this as
245 // well.
246 mpPreviewCache.reset();
247 GetPreviewCache()->InvalidateCache();
248
250}
251
253{
255
256 // Update the color used by the background painter.
257 std::shared_ptr<BackgroundPainter> pPainter (
258 std::dynamic_pointer_cast<BackgroundPainter>(mpBackgroundPainter));
259 if (pPainter)
260 pPainter->SetColor(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background));
261
263}
264
266{
268
269 mpLayeredDevice->Resize();
271}
272
274{
276 Rearrange();
277}
278
280{
282 return;
283 if (mrModel.GetPageCount() <= 0)
284 return;
285
287 if ( ! pWindow)
288 return;
289 const Size aWindowSize (pWindow->GetSizePixel());
290 if (aWindowSize.IsEmpty())
291 return;
292
293 const bool bRearrangeSuccess (
294 mpLayouter->Rearrange (
296 aWindowSize,
297 mrModel.GetPageDescriptor(0)->GetPage()->GetSize(),
299 if (bRearrangeSuccess)
300 {
301 mbIsRearrangePending = false;
302 Layout();
304 // RequestRepaint();
305 }
306}
307
309{
310 // The layout of slides depends on whether the slide sorter is
311 // displayed in the center or the side pane.
314 else
315 {
316 // Get access to the docking window.
318 TitledDockingWindow* pDockingWindow = nullptr;
319 while (pWindow!=nullptr && pDockingWindow==nullptr)
320 {
321 pDockingWindow = dynamic_cast<TitledDockingWindow*>(pWindow);
322 pWindow = pWindow->GetParent();
323 }
324
325 if (pDockingWindow != nullptr)
326 {
327 const ::tools::Long nScrollBarSize (
328 Application::GetSettings().GetStyleSettings().GetScrollBarSize());
329 switch (pDockingWindow->GetOrientation())
330 {
333 {
334 const Range aRange (mpLayouter->GetValidVerticalSizeRange());
335 pDockingWindow->SetValidSizeRange(Range(
336 aRange.Min() + nScrollBarSize,
337 aRange.Max() + nScrollBarSize));
338 }
339 break;
340
343 {
344 const Range aRange (mpLayouter->GetValidHorizontalSizeRange());
345 pDockingWindow->SetValidSizeRange(Range(
346 aRange.Min() + nScrollBarSize,
347 aRange.Max() + nScrollBarSize));
348 }
349 break;
350
353 {
354 const sal_Int32 nAdditionalSize (10);
355 pDockingWindow->SetMinOutputSizePixel(Size(
356 mpLayouter->GetValidHorizontalSizeRange().Min()
357 + nScrollBarSize
358 + nAdditionalSize,
359 mpLayouter->GetValidVerticalSizeRange().Min()
360 + nScrollBarSize
361 + nAdditionalSize));
362 }
363 return;
364 }
365 }
366 else
367 {
368 // We are not placed in a docking window. One possible reason
369 // is that the slide sorter is temporarily into a cache and was
370 // reparented to a non-docking window.
372 }
373 }
374}
375
377{
379 if (pWindow)
380 {
381 // Set the model area, i.e. the smallest rectangle that includes all
382 // page objects.
383 const ::tools::Rectangle aViewBox (mpLayouter->GetTotalBoundingBox());
384 pWindow->SetViewOrigin (aViewBox.TopLeft());
385 pWindow->SetViewSize (aViewBox.GetSize());
386
387 std::shared_ptr<PageObjectLayouter> pPageObjectLayouter(
388 mpLayouter->GetPageObjectLayouter());
389 if (pPageObjectLayouter)
390 {
391 const Size aNewPreviewSize (mpLayouter->GetPageObjectLayouter()->GetPreviewSize());
392 if (maPreviewSize != aNewPreviewSize && GetPreviewCache())
393 {
394 mpPreviewCache->ChangeSize(aNewPreviewSize, Bitmap::HasFastScale());
395 maPreviewSize = aNewPreviewSize;
396 }
397 }
398
399 // Iterate over all page objects and place them relative to the
400 // containing page.
401 model::PageEnumeration aPageEnumeration (
403 while (aPageEnumeration.HasMoreElements())
404 {
405 model::SharedPageDescriptor pDescriptor (aPageEnumeration.GetNextElement());
406 pDescriptor->SetBoundingBox(mpLayouter->GetPageObjectBox(pDescriptor->GetPageIndex(), false));
407 }
408 }
409
411}
412
414{
416}
417
419{
421 if (!pWindow)
422 return;
423
424 // Set this flag to true here so that an invalidate during the
425 // visibility calculation can correctly invalidate it again.
427
428 ::tools::Rectangle aViewArea (pWindow->PixelToLogic(::tools::Rectangle(Point(0,0),pWindow->GetSizePixel())));
429 const Range aRange (mpLayouter->GetRangeOfVisiblePageObjects(aViewArea));
430 const Range aUnion(
431 ::std::min(maVisiblePageRange.Min(), aRange.Min()),
432 ::std::max(maVisiblePageRange.Max(), aRange.Max()));
433
434 // For page objects that just dropped off the visible area we
435 // decrease the priority of pending requests for preview bitmaps.
436 if (maVisiblePageRange != aRange)
438
439 model::SharedPageDescriptor pDescriptor;
440 for (::tools::Long nIndex=aUnion.Min(); nIndex<=aUnion.Max(); nIndex++)
441 {
442 pDescriptor = mrModel.GetPageDescriptor(nIndex);
443 if (pDescriptor)
444 SetState(
445 pDescriptor,
446 PageDescriptor::ST_Visible,
447 aRange.Contains(nIndex));
448 }
449
450 // Broadcast a change of the set of visible page objects.
451 if (maVisiblePageRange != aRange)
452 {
453 maVisiblePageRange = aRange;
454
455 // Tell the listeners that the visibility of some objects has
456 // changed.
457 ::std::vector<Link<LinkParamNone*,void>>& aChangeListeners (maVisibilityChangeListeners);
458 for (const auto& rLink : aChangeListeners)
459 {
460 rLink.Call(nullptr);
461 }
462 }
463
464 // Restore the mouse over state.
466}
467
469{
471 return;
472
474
475 model::SharedPageDescriptor pDescriptor;
476 std::shared_ptr<cache::PageCache> pCache = GetPreviewCache();
477 sal_Int32 nPageCount (mrModel.GetPageCount());
478
479 for (int nIndex=0; nIndex<=nPageCount; ++nIndex)
480 {
481 pDescriptor = mrModel.GetPageDescriptor(nIndex);
482 if (pDescriptor)
483 {
484 pCache->SetPreciousFlag(
485 pDescriptor->GetPage(),
487 }
488 else
489 {
490 // At least one cache entry can not be updated. Remember to
491 // repeat the whole updating later and leave the loop now.
493 break;
494 }
495 }
496}
497
499{
500 if (meOrientation != eOrientation)
501 {
502 meOrientation = eOrientation;
503 return true;
504 }
505 else
506 return false;
507}
508
510{
512 if (pWindow)
513 {
514 mpLayeredDevice->InvalidateAllLayers(
516 pWindow->PixelToLogic(Point(0,0)),
517 pWindow->PixelToLogic(pWindow->GetSizePixel())));
518 pWindow->Invalidate();
519 }
520}
521
523{
524 if (rpDescriptor)
525 RequestRepaint(rpDescriptor->GetBoundingBox());
526}
527
528void SlideSorterView::RequestRepaint (const ::tools::Rectangle& rRepaintBox)
529{
531 if (pWindow)
532 {
533 mpLayeredDevice->InvalidateAllLayers(rRepaintBox);
534 pWindow->Invalidate(rRepaintBox);
535 }
536}
537
539{
541 if (pWindow)
542 {
543 mpLayeredDevice->InvalidateAllLayers(rRepaintRegion);
544 pWindow->Invalidate(rRepaintRegion);
545 }
546}
547
549{
550 return mpLayouter->GetTotalBoundingBox();
551}
552
553#ifdef DEBUG_TIMING
554static ::canvas::tools::ElapsedTime gaTimer;
555static const size_t gFrameTimeCount (10);
556static size_t gFrameTimeIndex (0);
557static ::std::vector<double> gFrameTimes (gFrameTimeCount, 0);
558static double gFrameTimeSum (0);
559static const ::tools::Rectangle gFrameTimeBox (10,10,150,20);
560static double gnLastFrameStart = 0;
561#endif
562
564 OutputDevice* pDevice,
565 const vcl::Region& rPaintArea,
567{
568 (void)pRedirector;
569
571 return;
572
573 if (pDevice == nullptr || pDevice!=mrSlideSorter.GetContentWindow()->GetOutDev())
574 return;
575
576#ifdef DEBUG_TIMING
577 const double nStartTime (gaTimer.getElapsedTime());
578 SAL_INFO("sd.timing", "SlideSorterView::CompleteRedraw start" << (mnLockRedrawSmph ? " locked" : ""));
579#endif
580
581 // The parent implementation of CompleteRedraw is called only when
582 // painting is locked. We do all the painting ourself. When painting
583 // is locked the parent implementation keeps track of the repaint
584 // requests and later, when painting is unlocked, calls CompleteRedraw
585 // for all missed repaints.
586
587 if (mnLockRedrawSmph == 0)
588 {
589 if (mpLayeredDevice->HandleMapModeChange())
591 mpLayeredDevice->Repaint(rPaintArea);
592 }
593 else
594 {
595 maRedrawRegion.Union(rPaintArea);
596 }
597
598#ifdef DEBUG_TIMING
599 const double nEndTime (gaTimer.getElapsedTime());
600 SAL_INFO("sd.timing", "SlideSorterView::CompleteRedraw end after " << (nEndTime-nStartTime)*1000 << " ms");
601 gFrameTimeSum -= gFrameTimes[gFrameTimeIndex];
602 gFrameTimes[gFrameTimeIndex] = nStartTime - gnLastFrameStart;
603 gnLastFrameStart = nStartTime;
604 gFrameTimeSum += gFrameTimes[gFrameTimeIndex];
605 gFrameTimeIndex = (gFrameTimeIndex+1) % gFrameTimeCount;
606
607 mrSlideSorter.GetContentWindow()->SetFillColor(COL_BLUE);
608 mrSlideSorter.GetContentWindow()->DrawRect(gFrameTimeBox);
611 gFrameTimeBox,
612 OUString::number(1 / (gFrameTimeSum / gFrameTimeCount)),
613 DrawTextFlags::Right | DrawTextFlags::VCenter);
614 // mrSlideSorter.GetContentWindow()->Invalidate(gFrameTimeBox);
615#endif
616}
617
619 OutputDevice& rDevice,
620 const ::tools::Rectangle& rRepaintArea)
621{
622 if (rRepaintArea.IsEmpty())
623 return;
624
625 if ( ! mpPageObjectPainter)
626 if ( ! GetPageObjectPainter())
627 return;
628
629 // Update the page visibilities when they have been invalidated.
632
635
637 Rearrange();
638
639 // Paint all page objects that are fully or partially inside the
640 // repaint region.
641 const Range aRange (mpLayouter->GetRangeOfVisiblePageObjects(rRepaintArea));
642 // Try to prefetch all graphics from the pages to paint. This will be done
643 // in threads to be more efficient than loading them on-demand one by one.
644 std::vector<Graphic*> graphics;
645 for (::tools::Long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex)
646 {
648 if (!pDescriptor || ! pDescriptor->HasState(PageDescriptor::ST_Visible))
649 continue;
650 pDescriptor->GetPage()->getGraphicsForPrefetch(graphics);
651 }
652 // Handle also one page before and after to have those in advance on scrolling.
653 for (::tools::Long nIndex : { aRange.Min() - 1, aRange.Max() + 1 })
654 {
656 if (!pDescriptor)
657 continue;
658 pDescriptor->GetPage()->getGraphicsForPrefetch(graphics);
659 }
660 if(graphics.size() > 1) // threading does not help with loading just one
662
663 for (::tools::Long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex)
664 {
666 if (!pDescriptor || ! pDescriptor->HasState(PageDescriptor::ST_Visible))
667 continue;
668
669 mpPageObjectPainter->PaintPageObject(rDevice, pDescriptor);
670 }
671}
672
674 utl::ConfigurationBroadcaster* pBroadcaster,
675 ConfigurationHints nHint)
676{
677 // Some changes of the configuration (some of the colors for example)
678 // may affect the previews. Throw away the old ones and create new ones.
679 cache::PageCacheManager::Instance()->InvalidateAllCaches();
680
681 ::sd::View::ConfigurationChanged(pBroadcaster, nHint);
683
684}
685
686std::shared_ptr<cache::PageCache> const & SlideSorterView::GetPreviewCache()
687{
689 if (pWindow && mpPreviewCache == nullptr)
690 {
692 std::make_shared<cache::PageCache>(
693 mpLayouter->GetPageObjectSize(),
695 std::make_shared<ViewCacheContext>(mrSlideSorter));
696 }
697
698 return mpPreviewCache;
699}
700
702{
705 return maVisiblePageRange;
706}
707
709{
710 if (::std::find (
713 rListener) == maVisibilityChangeListeners.end())
714 {
715 maVisibilityChangeListeners.push_back(rListener);
716 }
717}
718
720{
722 ::std::find (
725 rListener));
726}
727
729{
730 OSL_ASSERT(mpToolTip);
731 return *mpToolTip;
732}
733
735{
737
738 View::DragFinished(nDropAction);
739}
740
742{
743 // Tracking TODO check
746 if ((pVScrollBar && pVScrollBar->IsVisible() && pVScrollBar->HasGrab())
747 || (pHScrollBar && pHScrollBar->IsVisible() && pHScrollBar->HasGrab()))
748 {
749 // One of the scroll bars is tracking mouse movement. Do not
750 // highlight the slide under the mouse in this case.
752 return;
753 }
754
756 if (pWindow && pWindow->IsVisible() && ! pWindow->IsMouseCaptured())
757 {
758 const Window::PointerState aPointerState (pWindow->GetPointerState());
759 const ::tools::Rectangle aWindowBox (pWindow->GetPosPixel(), pWindow->GetSizePixel());
760 if (aWindowBox.Contains(aPointerState.maPos))
761 {
762 UpdatePageUnderMouse(aPointerState.maPos);
763 return;
764 }
765 }
766
768}
769
771 const Point& rMousePosition)
772{
774}
775
777 const model::SharedPageDescriptor& rpDescriptor)
778{
779 if (mpPageUnderMouse == rpDescriptor)
780 return;
781
783 SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, false);
784
785 mpPageUnderMouse = rpDescriptor;
786
788 SetState(mpPageUnderMouse, PageDescriptor::ST_MouseOver, true);
789
790 // Change the quick help text to display the name of the page under
791 // the mouse.
792 mpToolTip->SetPage(rpDescriptor);
793}
794
796 const model::SharedPageDescriptor& rpDescriptor,
797 const PageDescriptor::State eState,
798 const bool bStateValue)
799{
800 if ( ! rpDescriptor)
801 return false;
802
803 const bool bModified (rpDescriptor->SetState(eState, bStateValue));
804 if ( ! bModified)
805 return false;
806
807 // When the page object is not visible (i.e. not on the screen then
808 // nothing has to be painted.
809 if (rpDescriptor->HasState(PageDescriptor::ST_Visible))
810 {
811 // For most states a change of that state leads to visible
812 // difference and we have to request a repaint.
813 if (eState != PageDescriptor::ST_WasSelected)
814 RequestRepaint(rpDescriptor);
815 }
816
817 return bModified;
818}
819
820std::shared_ptr<PageObjectPainter> const & SlideSorterView::GetPageObjectPainter()
821{
822 if ( ! mpPageObjectPainter)
823 mpPageObjectPainter = std::make_shared<PageObjectPainter>(mrSlideSorter);
824 return mpPageObjectPainter;
825}
826
827//===== SlideSorterView::DrawLock =============================================
828
830 : mrView(rSlideSorter.GetView()),
831 mpWindow(rSlideSorter.GetContentWindow())
832{
833 if (mrView.mnLockRedrawSmph == 0)
836}
837
839{
840 OSL_ASSERT(mrView.mnLockRedrawSmph>0);
841 --mrView.mnLockRedrawSmph;
842 if (mrView.mnLockRedrawSmph == 0)
843 if (mpWindow)
844 {
845 mpWindow->Invalidate(mrView.maRedrawRegion);
846 }
847}
848
850{
851 mpWindow.reset();
852}
853
854} // end of namespace ::sd::slidesorter::view
855
856/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ChartModel & mrModel
Color maBackgroundColor
SlideSorterView & mrView
const std::shared_ptr< LayeredDevice > mpLayeredDevice
SlideSorter & mrSlideSorter
static const AllSettings & GetSettings()
static bool HasFastScale()
virtual void HideSdrPage() override
void MakeGraphicsAvailableThreaded(std::vector< Graphic * > &rGraphics)
static GraphicFilter & GetGraphicFilter()
void DrawRect(const tools::Rectangle &rRect)
void SetLineColor()
void SetFillColor()
tools::Long Max() const
tools::Long Min() const
bool Contains(tools::Long nIs) const
void SetPageVisible(bool bOn=true)
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
void SetMinOutputSizePixel(const Size &rSize)
bool IsEmpty() const
void reset(reference_type *pBody)
reference_type * get() const
void SetValidSizeRange(const Range &rValidSizeRange)
When docked the given range is passed to the parent SplitWindow.
Orientation GetOrientation() const
When the TitledDockingWindow is docked and managed by a split window it can derive its orientation fr...
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
Definition: viewshel.cxx:1493
virtual void DragFinished(sal_Int8 nDropAction)
Definition: sdview2.cxx:365
sal_uInt16 mnLockRedrawSmph
Definition: View.hxx:274
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
void SetViewSize(const Size &rSize)
Set size of the whole working area which can be seen with the window.
Definition: sdwindow.cxx:320
void SetViewOrigin(const Point &rPnt)
Set origin of the representation in respect to the whole working area.
Definition: sdwindow.cxx:312
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
const VclPtr< ScrollAdaptor > & GetHorizontalScrollBar() const
Return the control of the horizontal scroll bar.
Definition: SlideSorter.hxx:94
std::shared_ptr< view::Theme > const & GetTheme() const
Return the active theme which gives access to colors and fonts.
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
const VclPtr< ScrollAdaptor > & GetVerticalScrollBar() const
Return the control of the vertical scroll bar.
Definition: SlideSorter.hxx:90
const VclPtr< sd::Window > & GetContentWindow() const
Return the content window.
Definition: SlideSorter.hxx:99
static std::shared_ptr< PageCacheManager > Instance()
Return the one instance of the PageCacheManager class.
void DragFinished(sal_Int8 nDropAction)
model::SharedPageDescriptor GetPageAt(const Point &rPixelPosition)
Return the descriptor of the page that is rendered under the given position.
SD_DLLPUBLIC controller::Clipboard & GetClipboard()
static PageEnumeration CreateAllPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over all slides of the given model.
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.
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
::osl::Mutex & GetMutex()
Return the mutex so that the caller can lock it and then safely access the model.
A simple wrapper around an OutputDevice that provides support for independent layers and buffering.
Calculate the size and position of page objects displayed by a slide sorter.
Definition: SlsLayouter.hxx:60
void Dispose()
When the DrawLock is disposed then it will not request a repaint on destruction.
void RemoveVisibilityChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a listener that is called when the set of visible slides changes.
Range const & GetVisiblePageRange()
Return the range of currently visible page objects including the first and last one in that range.
void InvalidatePageObjectVisibilities()
This tells the view that it has to re-determine the visibility of the page objects before painting th...
std::shared_ptr< LayeredDevice > mpLayeredDevice
SlideSorterView(SlideSorter &rSlideSorter)
Create a new view for the slide sorter.
std::unique_ptr< ToolTip, o3tl::default_delete< ToolTip > > mpToolTip
std::shared_ptr< PageObjectPainter > mpPageObjectPainter
virtual void CompleteRedraw(OutputDevice *pDevice, const vcl::Region &rPaintArea, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr) override
The event will be forwarded to the View.
sal_Int32 GetPageIndexAtPoint(const Point &rPosition) const
Return the index of the page that is rendered at the given position.
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *pBroadcaster, ConfigurationHints nHint) override
void HandleModelChange()
This method is a convenience function that simply calls PreModelChange() and then PostModelChange().
void SetPageUnderMouse(const model::SharedPageDescriptor &rpDescriptor)
bool SetState(const model::SharedPageDescriptor &rpDescriptor, const model::PageDescriptor::State eState, const bool bStateValue)
::std::vector< Link< LinkParamNone *, void > > maVisibilityChangeListeners
std::shared_ptr< cache::PageCache > mpPreviewCache
void DeterminePageObjectVisibilities()
Determine the visibility of all page objects.
std::shared_ptr< PageObjectPainter > const & GetPageObjectPainter()
std::shared_ptr< cache::PageCache > const & GetPreviewCache()
void AddVisibilityChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a shape to the page.
::std::unique_ptr< Layouter > mpLayouter
void Paint(OutputDevice &rDevice, const ::tools::Rectangle &rRepaintArea)
::tools::Rectangle GetModelArea() const
void PostModelChange()
This method is typically called after a model change took place.
bool SetOrientation(const Layouter::Orientation eOrientation)
Set the general way of layouting the page objects.
void PreModelChange()
This method is typically called before a model change takes place.
virtual void DragFinished(sal_Int8 nDropAction) override
void UpdatePageUnderMouse()
The page under the mouse is not highlighted in some contexts.
model::SharedPageDescriptor mpPageUnderMouse
Collection of colors and styles that are used to paint the slide sorter view.
Definition: SlsTheme.hxx:39
Manage the display of tool tips.
Definition: SlsToolTip.hxx:40
void Union(const tools::Rectangle &rRegion)
void SetEmpty()
vcl::Window * GetParent() const
bool IsMouseCaptured() const
PointerState GetPointerState()
virtual Point GetPosPixel() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
bool IsVisible() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
sal_Int32 nIndex
#define SAL_INFO(area, stream)
std::shared_ptr< T > make_shared(Args &&... args)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
std::shared_ptr< ILayerPainter > SharedILayerPainter
std::shared_ptr< ILayerInvalidator > SharedILayerInvalidator
long Long
ConfigurationHints
signed char sal_Int8
VclPtr< vcl::Window > mpWindow