summaryrefslogtreecommitdiff
path: root/sd/source/ui/slidesorter/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/slidesorter/inc')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx4
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx61
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx13
-rwxr-xr-xsd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx46
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx180
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx61
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx19
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsCurrentSlideManager.hxx29
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx18
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx153
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx122
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx16
-rwxr-xr-xsd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx70
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx137
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx88
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx85
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx23
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx87
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx100
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx70
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx124
-rw-r--r--sd/source/ui/slidesorter/inc/model/SlsVisualState.hxx101
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx214
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx362
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsILayerPainter.hxx60
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsInsertAnimator.hxx71
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx131
-rw-r--r--[-rwxr-xr-x]sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx330
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx145
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx138
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsResource.hrc111
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsTheme.hxx236
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx97
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx273
34 files changed, 2837 insertions, 938 deletions
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx b/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
index c828e95d1d02..ba3e9346f28f 100644..100755
--- a/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
@@ -33,8 +33,8 @@
#include <boost/shared_ptr.hpp>
#include <vector>
-class BitmapEx;
class SdrPage;
+class Bitmap;
namespace sd { namespace slidesorter { namespace cache {
@@ -55,7 +55,7 @@ public:
*/
virtual void NotifyPreviewCreation (
CacheKey aKey,
- const ::boost::shared_ptr<BitmapEx>& rPreview) = 0;
+ const Bitmap& rPreview) = 0;
/** Called to determine whether the system is idle and a preview can be
created without annoying the user.
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
index 4a5c2b51ac28..bd2b542c5d87 100755..100644
--- a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
@@ -30,10 +30,10 @@
#include "cache/SlsCacheContext.hxx"
#include <sal/types.h>
-#include <vcl/bitmapex.hxx>
-#include <boost/function.hpp>
+#include <tools/gen.hxx>
#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
+#include <vcl/bitmap.hxx>
+
namespace sd { namespace slidesorter { namespace view {
class PageObjectViewObjectContact;
@@ -87,37 +87,68 @@ public:
*/
PageCache (
const Size& rPreviewSize,
+ const bool bDoSuperSampling,
const SharedCacheContext& rpCacheContext);
~PageCache (void);
- void ChangeSize(const Size& rPreviewSize);
+ void ChangeSize(
+ const Size& rPreviewSize,
+ const bool bDoSuperSampling);
/** Request a preview bitmap for the specified page object in the
specified size. The returned bitmap may be a preview of the
preview, i.e. either a scaled (up or down) version of a previous
preview (of the wrong size) or an empty bitmap. In this case a
request for the generation of a new preview is created and inserted
- into the request queue. When the preview is available the page
- shape will be told to paint itself again. When it then calls this
- method again if receives the correctly sized preview bitmap.
+ into the request queue. When the preview is available in the right
+ size the page shape will be told to paint itself again. When it
+ then calls this method again if receives the correctly sized preview
+ bitmap.
@param rRequestData
This data is used to determine the preview.
- @param rSize
- The size of the requested preview bitmap.
+ @param bResize
+ When <TRUE/> then when the available bitmap has not the
+ requested size, it is scaled before it is returned. When
+ <FALSE/> then the bitmap is returned in the wrong size and it is
+ the task of the caller to scale it.
@return
Returns a bitmap that is either empty, contains a scaled (up or
down) version or is the requested bitmap.
*/
- BitmapEx GetPreviewBitmap (
- CacheKey aKey,
- const Size& rSize);
+ Bitmap GetPreviewBitmap (
+ const CacheKey aKey,
+ const bool bResize);
+
+ Bitmap GetMarkedPreviewBitmap (
+ const CacheKey aKey,
+ const bool bResize);
+ void SetMarkedPreviewBitmap (
+ const CacheKey aKey,
+ const Bitmap& rBitmap);
+
+ /** When the requested preview bitmap does not yet exist or is not
+ up-to-date then the rendering of one is scheduled. Otherwise this
+ method does nothing.
+ */
+ void RequestPreviewBitmap (const CacheKey aKey);
+
+ /** Tell the cache that the bitmap associated with the given request
+ data is not up-to-date anymore. This will invalidate all previews
+ in other caches that represent the same page as well.
+ @param bRequestPreview
+ When <TRUE/> then a new preview is requested and will lead
+ eventually to a repaint of the associated page object.
+ */
+ void InvalidatePreviewBitmap (
+ const CacheKey aKey,
+ const bool bRequestPreview);
/** Call this method when a view-object-contact object is being deleted
and does not need (a) its current bitmap in the cache and (b) a
requested new bitmap.
*/
- void ReleasePreviewBitmap (CacheKey aKey);
+ void ReleasePreviewBitmap (const CacheKey aKey);
/** Call this method when all preview bitmaps have to be generated anew.
This is the case when the size of the page objects on the screen has
@@ -127,14 +158,14 @@ public:
are created. When it is <FALSE/> the existing previews are only
marked as not being up-to-date anymore.
*/
- void InvalidateCache (bool bUpdateCache = true);
+ void InvalidateCache (const bool bUpdateCache = true);
/** With the precious flag you can control whether a bitmap can be
removed or reduced in size to make room for other bitmaps or is so
precious that it will not touched. A typical use is to set the
precious flag for exactly the visible pages.
*/
- void SetPreciousFlag (CacheKey aKey, bool bIsPrecious);
+ void SetPreciousFlag (const CacheKey aKey, const bool bIsPrecious);
void Pause (void);
void Resume (void);
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
index 50202a7eed3d..71d7778f549f 100644..100755
--- a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
@@ -103,16 +103,27 @@ public:
marked as out-of-date and will be re-created when they are requested
the next time.
*/
- void InvalidatePreviewBitmap (
+ bool InvalidatePreviewBitmap (
DocumentKey pDocument,
const SdrPage* pPage);
+ /** Invalidate the preview bitmaps for all slides that belong to the
+ specified document. This is necessary after model changes that
+ affect e.g. page number fiels.
+ */
+ void InvalidateAllPreviewBitmaps (DocumentKey pDocument);
+
/** Invalidate all the caches that are currently in use and destroy
those that are not. This is used for example when the high contrast
mode is turned on or off.
*/
void InvalidateAllCaches (void);
+ /** Call this method when a page has been deleted and its preview
+ is not needed anymore.
+ */
+ void ReleasePreviewBitmap (const SdrPage* pPage);
+
private:
/** Singleton instance of the cache manager. Note that this is a weak
pointer. The (implementation class of) ViewShellBase holds a
diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
index 667aa768ee8f..b6309f80d0b4 100755
--- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
@@ -37,7 +37,6 @@
#include <sfx2/viewfac.hxx>
#include <tools/link.hxx>
#include <tools/gen.hxx>
-#include <memory>
#include <comphelper/implementationreference.hxx>
namespace sd { namespace slidesorter {
@@ -61,12 +60,15 @@ class Animator;
class Clipboard;
class CurrentSlideManager;
class FocusManager;
+class InsertionIndicatorHandler;
class Listener;
class PageSelector;
-class Properties;
class ScrollBarManager;
+class SelectionFunction;
class SelectionManager;
+class SelectionObserver;
class SlotManager;
+class VisibleAreaManager;
class SlideSorterController
{
@@ -85,6 +87,8 @@ public:
virtual ~SlideSorterController (void);
+ void Dispose (void);
+
/** Place and size the scroll bars and the browser window so that the
given rectangle is filled.
@return
@@ -106,7 +110,8 @@ public:
Rectangle Rearrange (bool bForce = false);
/** Return the descriptor of the page that is rendered under the
- given position.
+ given position. This takes the IsOnlyPreviewTriggersMouseOver
+ property into account.
@return
Returns a pointer to a page descriptor instead of a
reference because when no page is found at the position
@@ -125,9 +130,7 @@ public:
::boost::shared_ptr<CurrentSlideManager> GetCurrentSlideManager (void) const;
::boost::shared_ptr<SlotManager> GetSlotManager (void) const;
::boost::shared_ptr<SelectionManager> GetSelectionManager (void) const;
-
- // forward VCLs PrePaint window event to DrawingLayer
- void PrePaint();
+ ::boost::shared_ptr<InsertionIndicatorHandler> GetInsertionIndicatorHandler (void) const;
/** This method forwards the call to the SlideSorterView and executes
pending operations like moving selected pages into the visible area.
@@ -183,6 +186,12 @@ public:
*/
virtual FunctionReference CreateSelectionFunction (SfxRequest& rRequest);
+ /** When the current function of the view shell is the slide sorter
+ selection function then return a reference to it. Otherwise return
+ an empty reference.
+ */
+ ::rtl::Reference<SelectionFunction> GetCurrentSelectionFunction (void);
+
/** Prepare for a change of the edit mode. Depending on the current
edit mode we may save the selection so that it can be restored when
later changing back to the current edit mode.
@@ -219,11 +228,6 @@ public:
*/
bool IsContextMenuOpen (void) const;
- /** Return a collection of properties that are used througout the slide
- sorter.
- */
- ::boost::shared_ptr<Properties> GetProperties (void) const;
-
/** Provide the set of pages to be displayed in the slide sorter. The
GetDocumentSlides() method can be found only in the SlideSorterModel.
*/
@@ -233,18 +237,24 @@ public:
*/
::boost::shared_ptr<Animator> GetAnimator (void) const;
+ VisibleAreaManager& GetVisibleAreaManager (void) const;
+
+ void CheckForMasterPageAssignment (void);
+
private:
SlideSorter& mrSlideSorter;
model::SlideSorterModel& mrModel;
view::SlideSorterView& mrView;
- ::std::auto_ptr<PageSelector> mpPageSelector;
- ::std::auto_ptr<FocusManager> mpFocusManager;
+ ::boost::scoped_ptr<PageSelector> mpPageSelector;
+ ::boost::scoped_ptr<FocusManager> mpFocusManager;
::boost::shared_ptr<SlotManager> mpSlotManager;
- ::std::auto_ptr<controller::Clipboard> mpClipboard;
- ::std::auto_ptr<ScrollBarManager> mpScrollBarManager;
+ ::boost::scoped_ptr<controller::Clipboard> mpClipboard;
+ ::boost::scoped_ptr<ScrollBarManager> mpScrollBarManager;
mutable ::boost::shared_ptr<CurrentSlideManager> mpCurrentSlideManager;
::boost::shared_ptr<SelectionManager> mpSelectionManager;
+ ::boost::shared_ptr<InsertionIndicatorHandler> mpInsertionIndicatorHandler;
::boost::shared_ptr<Animator> mpAnimator;
+ ::boost::scoped_ptr<VisibleAreaManager> mpVisibleAreaManager;
// The listener listens to UNO events and thus is a UNO object.
// For proper life time management and at the same time free access to
@@ -252,6 +262,7 @@ private:
::rtl::Reference<controller::Listener> mpListener;
int mnModelChangeLockCount;
+ bool mbIsForcedRearrangePending;
bool mbPreModelChangeDone;
bool mbPostModelChangePending;
@@ -286,11 +297,6 @@ private:
*/
bool mbIsContextMenuOpen;
- /** Some slide sorter wide properties that are used in different
- classes.
- */
- ::boost::shared_ptr<Properties> mpProperties;
-
/** Delete the given list of normal pages. This method is a helper
function for DeleteSelectedPages().
@param rSelectedNormalPages
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx
new file mode 100644
index 000000000000..38d0b2b22749
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_CONTROLLER_ANIMATION_FUNCTION_HXX
+#define SD_SLIDESORTER_CONTROLLER_ANIMATION_FUNCTION_HXX
+
+#include "model/SlsSharedPageDescriptor.hxx"
+#include <basegfx/point/b2dpoint.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/function.hpp>
+#include <tools/gen.hxx>
+#include <vector>
+
+namespace sd { namespace slidesorter { namespace view {
+class SlideSorterView;
+} } }
+
+
+
+namespace sd { namespace slidesorter { namespace controller {
+
+/** A collection of functions that are usefull when creating animations.
+ They are collected here until a better place is found.
+*/
+class AnimationFunction
+ : private ::boost::noncopyable
+{
+public:
+ /** Acceleration function that maps [0,1] to [0,1] linearly, ie it
+ returns the given time value unaltered.
+ */
+ static double Linear (const double nTime);
+
+ /** Acceleration function that maps [0,1] to [0,1]. Speed starts fast
+ and ends slow following the sine function.
+ */
+ static double FastInSlowOut_Sine (const double nTime);
+
+ /** Acceleration function that maps [0,1] to [0,1]. Speed starts fast
+ and ends slow following the square root function.
+ */
+ static double FastInSlowOut_Root (const double nTime);
+
+ /** Acceleration function that maps [0,1] to [0,0]. Speed starts slow,
+ rises, drops and ends slow following the sine function.
+ */
+ static double SlowInSlowOut_0to0_Sine (const double nTime);
+
+ /** Acceleration function that maps [0,1] to [0,0]. Speed starts slow,
+ rises and drops several times and ends slow following multiple
+ cycles of the the sine function.
+ */
+ static double Vibrate_Sine (const double nTime);
+
+ /** Scale point linearly.
+ */
+ static Point ScalePoint (const Point& rPoint, const double nTime);
+
+ /** Blend two points together according to the given weight.
+ */
+ static double Blend (const double nStartValue, const double nEndValue, const double nWeight);
+
+ /** Apply a gradual visual state change. The kind of change, i.e. the
+ previous and the new states are expected to be already set. This
+ method only adjusts the blending of the visual representation from
+ one state to the other.
+ */
+ static void ApplyVisualStateChange (
+ const model::SharedPageDescriptor& rpDescriptor,
+ view::SlideSorterView& rView,
+ const double nTime);
+
+ /** Apply a gradual change of a previously set offset to the location of
+ a page object.
+ */
+ static void ApplyLocationOffsetChange (
+ const model::SharedPageDescriptor& rpDescriptor,
+ view::SlideSorterView& rView,
+ const Point aLocationOffset);
+
+ /** Apply a gradual change the alpha value from the old value to a
+ new value (set prior to this call.)
+ */
+ static void ApplyButtonAlphaChange(
+ const model::SharedPageDescriptor& rpDescriptor,
+ view::SlideSorterView& rView,
+ const double nButtonAlpha,
+ const double nButtonBarAlpha);
+};
+
+
+
+
+class AnimationBezierFunction
+{
+public:
+ /** Create a cubic bezier curve whose start and end points are given
+ implicitly as P0=(0,0) and P3=(1,1).
+ */
+ AnimationBezierFunction (
+ const double nX1,
+ const double nY1,
+ const double nX2,
+ const double nY2);
+
+ /** Create a cubic bezier curve whose start and end points are given
+ implicitly as P0=(0,0) and P3=(1,1). The second control point is
+ implicitly given as P2=(1-nY1,1-nX1).
+ */
+ AnimationBezierFunction (
+ const double nX1,
+ const double nY1);
+
+ ::basegfx::B2DPoint operator() (const double nT);
+
+private:
+ const double mnX1;
+ const double mnY1;
+ const double mnX2;
+ const double mnY2;
+
+ double EvaluateComponent (
+ const double nT,
+ const double nV1,
+ const double nV2);
+};
+
+
+
+
+/** Turn a parametric function into one whose y-Values depend on its
+ x-Values. Note a lot of interpolation takes place. The resulting
+ accuracy should be good enough for the purpose of acceleration
+ function for animations.
+*/
+class AnimationParametricFunction
+{
+public:
+ typedef ::boost::function<basegfx::B2DPoint(double)> ParametricFunction;
+ AnimationParametricFunction (const ParametricFunction& rFunction);
+
+ double operator() (const double nX);
+
+private:
+ /** y-Values of the parametric function given to the constructor
+ evaluated (and interpolated) for evenly spaced x-Values.
+ */
+ ::std::vector<double> maY;
+};
+
+
+
+
+} } } // end of namespace ::sd::slidesorter::controller
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
index 50c23e3dff4e..2d8418e49631 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
@@ -29,6 +29,8 @@
#define SD_SLIDESORTER_CONTROLLER_ANIMATOR_HXX
#include "SlideSorter.hxx"
+#include "view/SlideSorterView.hxx"
+#include <canvas/elapsedtime.hxx>
#include <vcl/timer.hxx>
#include <sal/types.h>
#include <vector>
@@ -46,51 +48,94 @@ class Animator
: private ::boost::noncopyable
{
public:
+ /** In some circumstances we have to avoid animation and jump to the
+ final animation state immediately. Use this enum instead of a bool
+ to be more expressive.
+ */
+ enum AnimationMode { AM_Animated, AM_Immediate };
+
Animator (SlideSorter& rSlideSorter);
~Animator (void);
+ /** When disposed the animator will stop its work immediately and not
+ process any timer events anymore.
+ */
+ void Dispose (void);
+
/** An animation object is called with values between 0 and 1 as single
argument to its operator() method.
*/
- typedef ::boost::function1<void, double> AnimationFunction;
+ typedef ::boost::function1<void, double> AnimationFunctor;
+ typedef ::boost::function0<void> FinishFunctor;
+
+ typedef sal_Int32 AnimationId;
+ static const AnimationId NotAnAnimationId = -1;
/** Schedule a new animation for execution. The () operator of that
animation will be called with increasing values between 0 and 1 for
the specified duration.
@param rAnimation
The animation operation.
+ @param nStartOffset
+ Time in milli seconds before the animation is started.
@param nDuration
The duration in milli seconds.
*/
- void AddAnimation (
- const AnimationFunction& rAnimation,
- const sal_Int32 nDuration);
+ AnimationId AddAnimation (
+ const AnimationFunctor& rAnimation,
+ const sal_Int32 nStartOffset,
+ const sal_Int32 nDuration,
+ const FinishFunctor& rFinishFunctor = FinishFunctor());
+
+ AnimationId AddInfiniteAnimation (
+ const AnimationFunctor& rAnimation,
+ const double nDelta);
+
+ /** Abort and remove an animation. In order to reduce the bookkeeping
+ on the caller side, it is OK to call this method with an animation
+ function that is not currently being animated. Such a call is
+ silently ignored.
+ */
+ void RemoveAnimation (const AnimationId nAnimationId);
+
+ /** A typical use case for this method is the temporary shutdown of the
+ slidesorter when the slide sorter bar is put into a cache due to a
+ change of the edit mode.
+ */
+ void RemoveAllAnimations (void);
private:
SlideSorter& mrSlideSorter;
Timer maTimer;
-
+ bool mbIsDisposed;
class Animation;
typedef ::std::vector<boost::shared_ptr<Animation> > AnimationList;
AnimationList maAnimations;
+ ::canvas::tools::ElapsedTime maElapsedTime;
- class DrawLock;
- ::boost::scoped_ptr<DrawLock> mpDrawLock;
+ ::boost::scoped_ptr<view::SlideSorterView::DrawLock> mpDrawLock;
+
+ AnimationId mnNextAnimationId;
DECL_LINK(TimeoutHandler, Timer*);
/** Execute one step of every active animation.
+ @param nTime
+ Time measured in milli seconds with some arbitrary reference point.
@return
When one or more animation has finished then <TRUE/> is
returned. Call CleanUpAnimationList() in this case.
*/
- bool ServeAnimations (void);
+ bool ProcessAnimations (const double nTime);
/** Remove animations that have expired.
*/
void CleanUpAnimationList (void);
+
+ void RequestNextFrame (const double nFrameStart = 0);
};
+
} } } // end of namespace ::sd::slidesorter::controller
#endif
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
index 0bdbd7cb569f..9b7b1f5ec2d3 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
@@ -24,11 +24,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#ifndef SD_SLIDESORTER_CLIPBOARD
#define SD_SLIDESORTER_CLIPBOARD
#include "ViewClipboard.hxx"
-
+#include "controller/SlsSelectionObserver.hxx"
#include <sal/types.h>
#include <tools/solar.h>
#include <svx/svdpage.hxx>
@@ -96,6 +97,8 @@ public:
USHORT nPage = SDRPAGE_NOTFOUND,
USHORT nLayer = SDRPAGE_NOTFOUND);
+ void Abort (void);
+
protected:
virtual USHORT DetermineInsertPosition (
const SdTransferable& rTransferable);
@@ -127,6 +130,15 @@ private:
*/
bool mbUpdateSelectionPending;
+ /** Used when a drop is executed to combine all undo actions into one.
+ Typically created in ExecuteDrop() and released in DragFinish().
+ */
+ class UndoContext;
+ ::boost::scoped_ptr<UndoContext> mpUndoContext;
+
+ ::boost::scoped_ptr<SelectionObserver::Context> mpSelectionObserverContext;
+ ULONG mnDragFinishedUserEventId;
+
void CreateSlideTransferable (
::Window* pWindow,
bool bDrag);
@@ -208,6 +220,11 @@ private:
::sd::Window* pTargetWindow,
USHORT nPage,
USHORT nLayer);
+
+ /** Asynchronous part of DragFinished. The argument is the sal_Int8
+ nDropAction, disguised as void*.
+ */
+ DECL_LINK(ProcessDragFinished, void*);
};
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsCurrentSlideManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsCurrentSlideManager.hxx
index b0f3a75b540c..f49207a0bd48 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsCurrentSlideManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsCurrentSlideManager.hxx
@@ -29,6 +29,8 @@
#define SD_SLIDESORTER_CURRENT_SLIDE_MANAGER_HXX
#include "model/SlsSharedPageDescriptor.hxx"
+#include <vcl/timer.hxx>
+#include <tools/link.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
class SdPage;
@@ -43,6 +45,10 @@ namespace sd { namespace slidesorter { namespace controller {
/** Manage the current slide. This includes setting the according flags at
the PageDescriptor objects and setting the current slide at the main
view shell.
+
+ Switching pages is triggered only after a little delay. This allows
+ fast travelling through a larger set of slides without having to wait
+ for the edit view to update its content after every slide change.
*/
class CurrentSlideManager
{
@@ -57,14 +63,24 @@ public:
/** Call this when the current page of the main view shell has been
switched. Use SwitchCurrentSlide() to initiate such a switch.
*/
- void CurrentSlideHasChanged (const sal_Int32 nSlideIndex);
+ void NotifyCurrentSlideChange (const sal_Int32 nSlideIndex);
+ void NotifyCurrentSlideChange (const SdPage* pPage);
/** Call this method to switch the current page of the main view shell
to the given slide. Use CurrentSlideHasChanged() when the current
slide change has been initiated by someone else.
+ @param nSlideIndex
+ Zero based index in the range [0,number-of-slides).
+ @param bUpdateSelection
+ When <TRUE/> then the page selection is cleared and only the new
+ current slide is selected.
*/
- void SwitchCurrentSlide (const sal_Int32 nSlideIndex);
- void SwitchCurrentSlide (const model::SharedPageDescriptor& rpSlide);
+ void SwitchCurrentSlide (
+ const sal_Int32 nSlideIndex,
+ const bool bUpdateSelection = false);
+ void SwitchCurrentSlide (
+ const model::SharedPageDescriptor& rpSlide,
+ const bool bUpdateSelection = false);
/** Return the page descriptor for the current slide. Note, that when
there is no current slide then the returned pointer is empty.
@@ -83,9 +99,14 @@ private:
SlideSorter& mrSlideSorter;
sal_Int32 mnCurrentSlideIndex;
model::SharedPageDescriptor mpCurrentSlide;
+ /** Timer to control the delay after which to ask
+ XController/ViewShellBase to switch to another slide.
+ */
+ Timer maSwitchPageDelayTimer;
bool IsCurrentSlideIsValid (void);
void SetCurrentSlideAtViewShellBase (const model::SharedPageDescriptor& rpSlide);
+ void SetCurrentSlideAtTabControl (const model::SharedPageDescriptor& rpSlide);
void SetCurrentSlideAtXController (const model::SharedPageDescriptor& rpSlide);
/** When switching from one slide to a new current slide then this
@@ -97,6 +118,8 @@ private:
method connects to the new current slide.
*/
void AcquireCurrentSlide (const sal_Int32 nSlideIndex);
+
+ DECL_LINK(SwitchPageCallback,void*);
};
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
index ecc02e8590c1..1d5aaee7a130 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
@@ -120,16 +120,6 @@ public:
*/
sal_Int32 GetFocusedPageIndex (void) const;
- /** DEPRECATED. (Use equivalent SetFocusedPage(sal_Int32) instead.
-
- Set the focus to the page with the given index. This does not make
- the focus visible.
- @param nPageIndex
- Index of a page as it is accepted by the slide sorter model.
- The index is not checked for validity.
- */
- void FocusPage (sal_Int32 nPageIndex);
-
/** Set the focused page to the one described by the given page
descriptor. The visibility of the focus indicator is not modified.
@param rDescriptor
@@ -145,6 +135,8 @@ public:
*/
void SetFocusedPage (sal_Int32 nPageIndex);
+ void SetFocusedPageToCurrentPage (void);
+
/** Return <TRUE/> when the focus inidcator is currently shown. A
prerequisite is that the window managed by this focus manager has
the input focus as indicated by a <TRUE/> return value of
@@ -203,6 +195,12 @@ private:
::std::vector<Link> maFocusChangeListeners;
+ /** When vertical wrap is active then pressing UP in the top row moves
+ the focus to the bottom row, DOWN in the bottom row moves the focus
+ to the top row.
+ */
+ bool mbIsVerticalWrapActive;
+
/** Reset the focus state of the given descriptor and request a repaint
so that the focus indicator is hidden.
@param pDescriptor
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx
new file mode 100644
index 000000000000..e257c5729b10
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_INSERTION_INDICATOR_HANDLER_HXX
+#define SD_SLIDESORTER_INSERTION_INDICATOR_HANDLER_HXX
+
+#include "view/SlsInsertAnimator.hxx"
+
+#include "view/SlsLayouter.hxx"
+
+namespace sd { namespace slidesorter { class SlideSorter; } }
+namespace sd { namespace slidesorter { namespace model {
+class PageEnumeration;
+} } }
+namespace sd { namespace slidesorter { namespace view {
+class InsertAnimator;
+class InsertionIndicatorOverlay;
+} } }
+
+
+namespace sd { namespace slidesorter { namespace controller {
+
+class Transferable;
+
+
+/** Manage the visibility and location of the insertion indicator. Its
+ actual display is controlled by the InsertionIndicatorOverlay.
+*/
+class InsertionIndicatorHandler
+{
+public:
+ InsertionIndicatorHandler (SlideSorter& rSlideSorter);
+ ~InsertionIndicatorHandler (void);
+
+ enum Mode { CopyMode, MoveMode, UnknownMode };
+ static Mode GetModeFromDndAction (const sal_Int8 nDndAction);
+
+ /** Activate the insertion marker at the given coordinates.
+ */
+ void Start (const bool bIsOverSourceView);
+
+ /** Deactivate the insertion marker.
+ */
+ void End (const controller::Animator::AnimationMode eMode);
+
+ /** This context make sure that the insertion indicator is shown
+ (provided that the clipboard is not empty) while the context is
+ alive. Typically used while a context menu is displayed.
+ */
+ class ForceShowContext
+ {
+ public:
+ ForceShowContext (const ::boost::shared_ptr<InsertionIndicatorHandler>& rpHandler);
+ ~ForceShowContext (void);
+ private:
+ const ::boost::shared_ptr<InsertionIndicatorHandler> mpHandler;
+ };
+
+ /** Update the indicator icon from the current transferable (from the
+ clipboard or an active drag and drop operation.)
+ */
+ void UpdateIndicatorIcon (const Transferable* pTransferable);
+
+ /** Set the position of the insertion marker to the given coordinates.
+ */
+ void UpdatePosition (
+ const Point& rMouseModelPosition,
+ const Mode eMode);
+ void UpdatePosition (
+ const Point& rMouseModelPosition,
+ const sal_Int8 nDndAction);
+
+ /** Return whether the insertion marker is active.
+ */
+ bool IsActive (void) const;
+
+ /** Return the insertion index that corresponds with the current
+ graphical location of the insertion indicator.
+ */
+ sal_Int32 GetInsertionPageIndex (void) const;
+
+ /** Determine whether moving the current selection to the current
+ position of the insertion marker would alter the document. This
+ would be the case when the selection is not consecutive or would be
+ moved to a position outside and not adjacent to the selection.
+ */
+ bool IsInsertionTrivial (
+ const sal_Int32 nInsertionIndex,
+ const Mode eMode) const;
+ /** This method is like the other variant. It operates implicitly
+ on the current insertion index as would be returned by
+ GetInsertionPageIndex().
+ */
+ bool IsInsertionTrivial (const sal_Int8 nDndAction);
+
+private:
+ SlideSorter& mrSlideSorter;
+ ::boost::shared_ptr<view::InsertAnimator> mpInsertAnimator;
+ ::boost::shared_ptr<view::InsertionIndicatorOverlay> mpInsertionIndicatorOverlay;
+ view::InsertPosition maInsertPosition;
+ Mode meMode;
+ bool mbIsInsertionTrivial;
+ bool mbIsActive;
+ bool mbIsReadOnly;
+ bool mbIsOverSourceView;
+ Size maIconSize;
+ bool mbIsForcedShow;
+
+ void SetPosition (
+ const Point& rPoint,
+ const Mode eMode);
+ ::boost::shared_ptr<view::InsertAnimator> GetInsertAnimator (void);
+
+ /** Make the insertion indicator visible (that is the show part) and
+ keep it visible, even when the mouse leaves the window (that is the
+ force part). We need this when a context menu is displayed (mouse
+ over the popup menu triggers a mouse leave event) while the
+ insertion indicator remains visible in the background.
+
+ In effect all calls to End() are ignored until ForceEnd() is called.
+ */
+ void ForceShow (void);
+ void ForceEnd (void);
+};
+
+
+} } } // end of namespace ::sd::slidesorter::controller
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
index 57aaf9293301..b0a9cfa148cb 100755..100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
@@ -69,16 +69,29 @@ public:
void SelectAllPages (void);
void DeselectAllPages (void);
+
/** Update the selection state of all page descriptors to be the same as
- that of the pages of the SdDrawDocument they describe and issue
+ that of the corresponding pages of the SdPage objects and issue
redraw requests where necessary.
*/
- void UpdateAllPages (void);
+ void GetCoreSelection (void);
+
+ /** Update the selection state of the SdPage objects to be the same as
+ that of the correspinding page descriptors.
+ */
+ void SetCoreSelection (void);
+ /** Select the specified descriptor. The selection state of the other
+ descriptors is not affected.
+ */
void SelectPage (int nPageIndex);
- /** Select the descriptor that is associated with the given page.
+ /** Select the descriptor that is associated with the given page. The
+ selection state of the other descriptors is not affected.
*/
void SelectPage (const SdPage* pPage);
+ /** Select the specified descriptor. The selection state of the other
+ descriptors is not affected.
+ */
void SelectPage (const model::SharedPageDescriptor& rpDescriptor);
/** Return whether the specified page is selected. This convenience
@@ -89,9 +102,19 @@ public:
bool IsPageSelected (int nPageIndex);
/** Deselect the descriptor that is associated with the given page.
+ @param bUpdateCurrentPage
+ When <TRUE/> then the current page is updated to the first slide
+ of the remaining selection.
*/
- void DeselectPage (int nPageIndex);
- void DeselectPage (const model::SharedPageDescriptor& rpDescriptor);
+ void DeselectPage (
+ int nPageIndex,
+ const bool bUpdateCurrentPage = true);
+ void DeselectPage (
+ const SdPage* pPage,
+ const bool bUpdateCurrentPage = true);
+ void DeselectPage (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bUpdateCurrentPage = true);
/** This convenience method returns the same number of pages that
SlideSorterModel.GetPageCount() returns. It is included here so
@@ -101,35 +124,6 @@ public:
int GetPageCount (void) const;
int GetSelectedPageCount (void) const;
- void PrepareModelChange (void);
- void HandleModelChange (void);
-
- /** Enable the broadcasting of selection change events. This calls the
- SlideSorterController::SelectionHasChanged() method to do the actual
- work. When EnableBroadcasting has been called as many times as
- DisableBroadcasting() was called before and the selection has been
- changed in the mean time, this change will be broadcasted.
- */
- void EnableBroadcasting (bool bMakeSelectionVisible = true);
-
- /** Disable the broadcasting o selectio change events. Subsequent
- changes of the selection will set a flag that triggers the sending
- of events when EnableBroadcasting() is called.
- */
- void DisableBroadcasting (void);
-
- /** Return the descriptor of the most recently selected page. This
- works only when the page has not been de-selected in the mean time.
- This method helps the view when it scrolls the selection into the
- visible area.
- @return
- When the selection is empty or when the most recently selected
- page has been deselected already (but other pages are still
- selected) then NULL is returned, even when a selection did exist
- but has been cleared.
- */
- model::SharedPageDescriptor GetMostRecentlySelectedPage (void) const;
-
/** Return the anchor for a range selection. This usually is the first
selected page after all pages have been deselected.
@return
@@ -156,10 +150,46 @@ public:
the last call to GetPageSelection() it is still valid to call
this method with the selection. When pages have been inserted
or removed the result may be unexpected.
+ @param bUpdateCurrentPage
+ When <TRUE/> (the default value) then after setting the
+ selection update the current page to the first page of the
+ selection.
+ When called from withing UpdateCurrentPage() then this flag is
+ used to prevent a recursion loop.
*/
- void SetPageSelection (const ::boost::shared_ptr<PageSelection>& rSelection);
+ void SetPageSelection (
+ const ::boost::shared_ptr<PageSelection>& rSelection,
+ const bool bUpdateCurrentPage = true);
- void UpdateCurrentPage (const model::SharedPageDescriptor& rCurrentPageDescriptor);
+ /** Call this method after the the model has changed to set the number
+ of selected pages.
+ */
+ void CountSelectedPages (void);
+
+ /** Use the UpdateLock whenever you do a complex selection, i.e. call
+ more than one method in a row. An active lock prevents intermediate
+ changes of the current slide.
+ */
+ class UpdateLock
+ {
+ public:
+ UpdateLock (SlideSorter& rSlideSorter);
+ UpdateLock (PageSelector& rPageSelector);
+ ~UpdateLock (void);
+ void Release (void);
+ private:
+ PageSelector* mpSelector;
+ };
+
+ class BroadcastLock
+ {
+ public:
+ BroadcastLock (SlideSorter& rSlideSorter);
+ BroadcastLock (PageSelector& rPageSelector);
+ ~BroadcastLock (void);
+ private:
+ PageSelector& mrSelector;
+ };
private:
model::SlideSorterModel& mrModel;
@@ -172,8 +202,26 @@ private:
/// Anchor for a range selection.
model::SharedPageDescriptor mpSelectionAnchor;
model::SharedPageDescriptor mpCurrentPage;
+ sal_Int32 mnUpdateLockCount;
+ bool mbIsUpdateCurrentPagePending;
- void CountSelectedPages (void);
+ /** Enable the broadcasting of selection change events. This calls the
+ SlideSorterController::SelectionHasChanged() method to do the actual
+ work. When EnableBroadcasting has been called as many times as
+ DisableBroadcasting() was called before and the selection has been
+ changed in the mean time, this change will be broadcasted.
+ */
+ void EnableBroadcasting (void);
+
+ /** Disable the broadcasting of selection change events. Subsequent
+ changes of the selection will set a flag that triggers the sending
+ of events when EnableBroadcasting() is called.
+ */
+ void DisableBroadcasting (void);
+
+ void UpdateCurrentPage (const bool bUpdateOnlyWhenPending = false);
+
+ void CheckConsistency (void) const;
};
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx b/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
index 51e353d696b9..06d239c81da3 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
@@ -40,6 +40,11 @@ public:
Properties (void);
~Properties (void);
+ /** Call this method after receiving a VCLEVENT_APPLICATION_DATACHANGED
+ event.
+ */
+ void HandleDataChangeEvent (void);
+
/** When this method returns <TRUE/> then the current slide is
highlighted in the view. The default value is <FALSE/>.
*/
@@ -108,6 +113,15 @@ public:
bool IsUIReadOnly (void) const;
void SetUIReadOnly (const bool bIsUIReadOnly);
+ /** The mouse over effect (and whether a mouse motion starts a multi
+ selection or a drag-and-drop) can be triggered by just the preview
+ area or the whole page object area.
+ */
+ bool IsOnlyPreviewTriggersMouseOver (void) const;
+ void SetOnlyPreviewTriggersMouseOver (const bool bFlag);
+
+ bool IsHighContrastModeActive (void) const;
+
private:
bool mbIsHighlightCurrentSlide;
bool mbIsShowSelection;
@@ -120,6 +134,8 @@ private:
Color maSelectionColor;
Color maHighlightColor;
bool mbIsUIReadOnly;
+ bool mbIsOnlyPreviewTriggersMouseOver;
+ bool mbIsHighContrastModeActive;
};
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
index c93ed7708650..fa2aae6111fb 100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
@@ -28,10 +28,13 @@
#ifndef SD_SLIDESORTER_SLIDE_SORTER_SCROLL_BAR_MANAGER_HXX
#define SD_SLIDESORTER_SLIDE_SORTER_SCROLL_BAR_MANAGER_HXX
+#include "SlideSorter.hxx"
+
#include <tools/link.hxx>
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
#include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
class Point;
class Rectangle;
@@ -110,30 +113,34 @@ public:
bool bScrollToCurrentPosition = true);
/** Place the scroll bars inside the given area. When the available
- area is not large enough for the content to display the resulting
- behaviour depends on the mbUseVerticalScrollBar flag. When it is
- set to true then a vertical scroll bar is shown. Otherwise the
- height of the returned area is enlarged so that the content fits
- into it.
+ area is not large enough for the content to display the horizontal
+ and/or vertical scroll bar is enabled.
@param rAvailableArea
The scroll bars will be placed inside this rectangle. It is
expected to be given in pixel relative to its parent.
+ @param bIsHorizontalScrollBarAllowed
+ Only when this flag is <TRUE/> the horizontal scroll may be
+ displayed.
+ @param bIsVerticalScrollBarAllowed
+ Only when this flag is <TRUE/> the horizontal scroll may be
+ displayed.
@return
Returns the space that remains after the scroll bars are
- placed. When the mbUseVerticalScrollBar flag is false then the
- returned rectangle may be larger than the given one.
+ placed.
*/
- Rectangle PlaceScrollBars (const Rectangle& rAvailableArea);
+ Rectangle PlaceScrollBars (
+ const Rectangle& rAvailableArea,
+ const bool bIsHorizontalScrollBarAllowed,
+ const bool bIsVerticalScrollBarAllowed);
- /** Update the vertical scroll bar so that the visible area has the
- given top value.
+ /** Update the vertical and horizontal scroll bars so that the visible
+ area has the given top and left values.
*/
- void SetTop (const sal_Int32 nTop);
+ void SetTopLeft (const Point aNewTopLeft);
- /** Update the horizontal scroll bar so that the visible area has the
- given left value.
- */
- void SetLeft (const sal_Int32 nLeft);
+ sal_Int32 GetTop (void) const;
+
+ sal_Int32 GetLeft (void) const;
/** Return the width of the vertical scroll bar, which--when
shown--should be fixed in contrast to its height.
@@ -154,14 +161,35 @@ public:
/** Call this method to scroll a window while the mouse is in dragging a
selection. If the mouse is near the window border or is outside the
window then scroll the window accordingly.
+ @param rMouseWindowPosition
+ The mouse position for which the scroll amount is calculated.
+ @param rAutoScrollFunctor
+ Every time when the window is scrolled then this functor is executed.
@return
When the window is scrolled then this method returns <TRUE/>.
When the window is not changed then <FALSE/> is returned.
*/
- bool AutoScroll (const Point& rMouseWindowPosition);
+ bool AutoScroll (
+ const Point& rMouseWindowPosition,
+ const ::boost::function<void(void)>& rAutoScrollFunctor);
void StopAutoScroll (void);
+ enum Orientation { Orientation_Horizontal, Orientation_Vertical };
+ enum Unit { Unit_Pixel, Unit_Slide };
+ /** Scroll the slide sorter by setting the thumbs of the scroll bars and
+ by moving the content of the content window.
+ @param eOrientation
+ Defines whether to scroll horizontally or vertically.
+ @param eUnit
+ Defines whether the distance is a pixel value or the number of
+ slides to scroll.
+ */
+ void Scroll(
+ const Orientation eOrientation,
+ const Unit eUnit,
+ const sal_Int32 nDistance);
+
private:
SlideSorter& mrSlideSorter;
@@ -197,11 +225,14 @@ private:
*/
Timer maAutoScrollTimer;
Size maAutoScrollOffset;
+ bool mbIsAutoScrollActive;
/** The content window is the one whose view port is controlled by the
scroll bars.
*/
- ::boost::shared_ptr<sd::Window> mpContentWindow;
+ SharedSdWindow mpContentWindow;
+
+ ::boost::function<void(void)> maAutoScrollFunctor;
void SetWindowOrigin (
double nHorizontalPosition,
@@ -217,7 +248,10 @@ private:
The area that is enclosed by the scroll bars is returned. It
will be filled with the SlideSorterView.
*/
- Rectangle DetermineScrollBarVisibilities (const Rectangle& rAvailableArea);
+ Rectangle DetermineScrollBarVisibilities(
+ const Rectangle& rAvailableArea,
+ const bool bIsHorizontalScrollBarAllowed,
+ const bool bIsVerticalScrollBarAllowed);
/** Typically called by DetermineScrollBarVisibilities() this method
tests a specific configuration of the two scroll bars being visible
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
index 79b8a1ff5d44..9dcd0abb646c 100755..100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
@@ -28,10 +28,13 @@
#ifndef SD_SLIDESORTER_SELECTION_FUNCTION_HXX
#define SD_SLIDESORTER_SELECTION_FUNCTION_HXX
-#include "controller/SlsSlideFunction.hxx"
#include "model/SlsSharedPageDescriptor.hxx"
-#include <tools/list.hxx>
-#include <memory>
+#include "controller/SlsFocusManager.hxx"
+#include "controller/SlsInsertionIndicatorHandler.hxx"
+#include "fupoor.hxx"
+#include <svtools/transfer.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
class SdSlideViewShell;
class SdWindow;
@@ -46,9 +49,12 @@ class SlideSorter;
namespace sd { namespace slidesorter { namespace controller {
class SlideSorterController;
+class DragAndDropContext;
+
class SelectionFunction
- : public SlideFunction
+ : public FuPoor,
+ private ::boost::noncopyable
{
public:
TYPEINFO();
@@ -60,10 +66,9 @@ public:
virtual BOOL MouseMove(const MouseEvent& rMEvt);
virtual BOOL MouseButtonUp(const MouseEvent& rMEvt);
virtual BOOL MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Paint(const Rectangle&, ::sd::Window* );
- virtual void Activate(); // Function aktivieren
- virtual void Deactivate(); // Function deaktivieren
+ virtual void Activate();
+ virtual void Deactivate();
virtual void ScrollStart();
virtual void ScrollEnd();
@@ -86,6 +91,42 @@ public:
*/
virtual bool cancel();
+ void MouseDragged (
+ const AcceptDropEvent& rEvent,
+ const sal_Int8 nDragAction);
+
+ /** Turn of substitution display and insertion indicator.
+ */
+ void NotifyDragFinished (void);
+
+ /** Call when drag-and-drop or multi selection is started or stopped in
+ order to update permission of mouse over indication.
+ */
+ void UpdateMouseOverIndicationPermission (void);
+
+ class EventDescriptor;
+ class ModeHandler;
+ friend class ModeHandler;
+ enum Mode
+ {
+ NormalMode,
+ MultiSelectionMode,
+ DragAndDropMode,
+ ButtonMode
+ };
+ void SwitchToNormalMode (void);
+ void SwitchToDragAndDropMode(const Point aMousePosition);
+ void SwitchToMultiSelectionMode (const Point aMousePosition, const sal_uInt32 nEventCode);
+ bool SwitchToButtonMode (void);
+
+ void ResetShiftKeySelectionAnchor (void);
+ /** Special case handling for when the context menu is hidden. This
+ method will reinitialize the current mouse position to prevent the
+ mouse motion during the time the context menu is displayed from
+ being interpreted as drag-and-drop start.
+ */
+ void ResetMouseAnchor (void);
+
protected:
SlideSorter& mrSlideSorter;
SlideSorterController& mrController;
@@ -97,11 +138,6 @@ protected:
virtual ~SelectionFunction();
private:
- class SubstitutionHandler;
- class EventDescriptor;
-
- /// Set in MouseButtonDown this flag indicates that a page has been hit.
- bool mbPageHit;
/// The rectangle of the mouse drag selection.
Rectangle maDragSelectionRectangle;
@@ -118,20 +154,17 @@ private:
*/
bool mbProcessingMouseButtonDown;
- ::std::auto_ptr<SubstitutionHandler> mpSubstitutionHandler;
+ bool mbIsDeselectionPending;
- DECL_LINK( DragSlideHdl, Timer* );
- void StartDrag (void);
-
- /** Set the selection to exactly the specified page and also set it as
- the current page.
+ /** Remember the slide where the shift key was pressed and started a
+ multiselection via keyboard.
*/
- void SetCurrentPage (const model::SharedPageDescriptor& rpDescriptor);
+ sal_Int32 mnShiftKeySelectionAnchor;
- /** When the view on which this selection function is working is the
- main view then the view is switched to the regular editing view.
+ /** The selection function can be in one of several mutually
+ exclusive modes.
*/
- void SwitchView (const model::SharedPageDescriptor& rpDescriptor);
+ ::boost::shared_ptr<ModeHandler> mpModeHandler;
/** Make the slide nOffset slides away of the current one the new
current slide. When the new index is outside the range of valid
@@ -142,63 +175,31 @@ private:
*/
void GotoNextPage (int nOffset);
+ /** Make the slide with the given index the new current slide.
+ @param nIndex
+ Index of the new current slide. When the new index is outside
+ the range of valid page numbers it is clipped to that range.
+ */
+ void GotoPage (int nIndex);
+
void ProcessMouseEvent (sal_uInt32 nEventType, const MouseEvent& rEvent);
void ProcessKeyEvent (const KeyEvent& rEvent);
// What follows are a couple of helper methods that are used by
// ProcessMouseEvent().
- /// Select the specified page and set the selection anchor.
- void SelectHitPage (const model::SharedPageDescriptor& rpDescriptor);
- /// Deselect the specified page.
- void DeselectHitPage (const model::SharedPageDescriptor& rpDescriptor);
- /// Deselect all pages.
- void DeselectAllPages (void);
+ void ProcessEvent (EventDescriptor& rEvent);
- /** for a possibly following mouse motion by starting the drag timer
- that after a short time of pressed but un-moved mouse starts a drag
- operation.
- */
- void PrepareMouseMotion (const Point& aMouseModelPosition);
-
- /** Select all pages between and including the selection anchor and the
- specified page.
- */
- void RangeSelect (const model::SharedPageDescriptor& rpDescriptor);
+ void MoveFocus (
+ const FocusManager::FocusMoveDirection eDirection,
+ const bool bIsShiftDown,
+ const bool bIsControlDown);
- /** Start a rectangle selection at the given position.
- */
- void StartRectangleSelection (const Point& aMouseModelPosition);
+ void StopDragAndDrop (void);
- /** Update the rectangle selection so that the given position becomes
- the new second point of the selection rectangle.
- */
- void UpdateRectangleSelection (const Point& aMouseModelPosition);
-
- /** Select all pages that lie completly in the selection rectangle.
- */
- void ProcessRectangleSelection (bool bToggleSelection);
-
- /** Compute a numerical code that describes a mouse event and that can
- be used for fast look up of the appropriate reaction.
- */
- sal_uInt32 EncodeMouseEvent (
- const EventDescriptor& rDescriptor,
- const MouseEvent& rEvent) const;
-
- /** Compute a numerical code that describes a key event and that can
- be used for fast look up of the appropriate reaction.
- */
- sal_uInt32 EncodeKeyEvent (
- const EventDescriptor& rDescriptor,
- const KeyEvent& rEvent) const;
-
- void EventPreprocessing (const EventDescriptor& rEvent);
- bool EventProcessing (const EventDescriptor& rEvent);
- void EventPostprocessing (const EventDescriptor& rEvent);
+ void SwitchMode (const ::boost::shared_ptr<ModeHandler>& rpHandler);
};
} } } // end of namespace ::sd::slidesorter::controller
#endif
-
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
index c0fab6da84c6..a9617a88c2e6 100644..100755
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
@@ -29,8 +29,10 @@
#define SD_SLIDESORTER_CONTROLLER_SELECTION_MANAGER_HXX
#include "model/SlsSharedPageDescriptor.hxx"
+#include "controller/SlsAnimator.hxx"
#include <sal/types.h>
#include <tools/gen.hxx>
+#include <basegfx/range/b2irectangle.hxx>
#include <vector>
class Link;
@@ -43,6 +45,7 @@ class SlideSorter;
namespace sd { namespace slidesorter { namespace controller {
class SlideSorterController;
+class SelectionObserver;
/** This class is a part of the controller and handles the selection of
slides.
@@ -62,12 +65,13 @@ public:
/** Delete the currently selected slides. When this method returns the
selection is empty.
+ @param bSelectFollowingPage
+ When <TRUE/> then after deleting the selected pages make the
+ slide after the last selected page the new current page.
+ When <FALSE/> then make the first slide before the selected
+ pages the new current slide.
*/
- void DeleteSelectedPages (void);
-
- /** Move the maked pages to a position directly after the specified page.
- */
- bool MoveSelectedPages (const sal_Int32 nTargetPage);
+ void DeleteSelectedPages (const bool bSelectFollowingPage = true);
/** Call this method after the selection has changed (possible several
calls to the PageSelector) to invalidate the relevant slots and send
@@ -75,42 +79,6 @@ public:
*/
void SelectionHasChanged (const bool bMakeSelectionVisible = true);
- /** Return <TRUE/> when the selection has changed but has not yet been
- moved to the visible area of the slide sorter view.
- */
- bool IsMakeSelectionVisiblePending (void) const;
-
- enum SelectionHint { SH_FIRST, SH_LAST, SH_RECENT };
-
- /** Try to make all currently selected page objects visible, i.e. set
- the origin so that the page objects lie inside the visible area.
- When the selection is empty then the visible area is not modified.
-
- <p>This method, and the ones is calls, look into the Properties
- object of the SlideSorter in order to determine whether the current
- selection is to be displayed centered.</p>
- @param eSelectionHint
- This is an advice on which selected page object to handle with
- the highest priority when the whole selection does not fit into
- the visible area.
- @return
- Returns the vertical translation of the visible area. It is 0
- when no update of the visible area was done.
- */
- Size MakeSelectionVisible (
- const SelectionHint eSelectionHint = SH_RECENT);
-
- /** Modify the origin of the visible area so that the given rectangle
- comes into view. This is done with the smallest change: no
- scrolling takes place when the given rectangle already lies in the
- visible area. Otherwise either the top or the bottom of the given
- rectangle is aligned with the top or the bottom of the visible area.
- @return
- Returns the vertical translation of the visible area. It is 0
- when no update of the visible area was done.
- */
- Size MakeRectangleVisible (const Rectangle& rBox);
-
/** Add a listener that is called when the selection of the slide sorter
changes.
@param rListener
@@ -143,6 +111,8 @@ public:
*/
void SetInsertionPosition (const sal_Int32 nInsertionPosition);
+ ::boost::shared_ptr<SelectionObserver> GetSelectionObserver (void) const;
+
private:
SlideSorter& mrSlideSorter;
SlideSorterController& mrController;
@@ -166,6 +136,17 @@ private:
*/
sal_Int32 mnInsertionPosition;
+ /** Animation id for a scroll animation the will eventually set the top
+ and left of the visible area to maRequestedTopLeft.
+ */
+ Animator::AnimationId mnAnimationId;
+ Point maRequestedTopLeft;
+
+ class PageInsertionListener;
+ ::boost::scoped_ptr<PageInsertionListener> mpPageInsertionListener;
+
+ ::boost::shared_ptr<SelectionObserver> mpSelectionObserver;
+
/** Delete the given list of normal pages. This method is a helper
function for DeleteSelectedPages().
@param rSelectedNormalPages
@@ -179,31 +160,6 @@ private:
A list of master pages. Supplying normal pages is an error.
*/
void DeleteSelectedMasterPages (const ::std::vector<SdPage*>& rSelectedMasterPages);
-
- /** Return <TRUE/> when the given rectangle, that typically is the
- bounding box of all currently selected slides, does not fit entirely
- into the visible area of the slide sorter view.
- */
- bool DoesSelectionExceedVisibleArea (const Rectangle& rSelectionBox) const;
-
- /** When not all currently selected slides fit into the visible area of
- the slide sorter view, and thus DoesSelectionExceedVisibleArea()
- would return <TRUE/>, then it is the task of this method to
- determine which part of the selection to move into the visible area.
- @param rpFirst
- The first selected slide. Must not be an empty pointer.
- @param rpLast
- The last selected slide. Must not be an empty pointer.
- @param eSelectionHint
- This hint tells the method on which slide to concentrate,
- i.e. which slide has to be inside the returned visible area.
- @return
- Returns the new visible area.
- */
- Rectangle ResolveLargeSelection (
- const model::SharedPageDescriptor& rpFirst,
- const model::SharedPageDescriptor& rpLast,
- const SelectionHint eSelectionHint);
};
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx
new file mode 100644
index 000000000000..0fb45b403af1
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_CONTROLLER_SELECTION_OBSERVER_HXX
+#define SD_SLIDESORTER_CONTROLLER_SELECTION_OBSERVER_HXX
+
+#include <tools/gen.hxx>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+namespace sd { namespace slidesorter {
+class SlideSorter;
+} }
+
+class SdDrawDocument;
+class SdrPage;
+
+namespace sd { namespace slidesorter { namespace controller {
+
+/** Observe insertions and deletions of pages between calls to
+ StartObservation() and EndObservation(). When the later is called
+ the selection is set to just the newly inserted pages.
+*/
+class SelectionObserver
+{
+public:
+ SelectionObserver (SlideSorter& rSlideSorter);
+ virtual ~SelectionObserver (void);
+
+ void NotifyPageEvent (const SdrPage* pPage);
+ void StartObservation (void);
+ void AbortObservation (void);
+ void EndObservation (void);
+
+ /** Use this little class instead of calling StartObservation and
+ EndObservation directly so that EndObservation is not forgotten or
+ omitted due to an exception or some break or return in the middle of
+ code.
+ */
+ class Context
+ {
+ public:
+ Context (SlideSorter& rSlideSorter);
+ ~Context(void);
+ void Abort (void);
+ private:
+ ::boost::shared_ptr<SelectionObserver> mpSelectionObserver;
+ };
+
+private:
+ SlideSorter& mrSlideSorter;
+ SdDrawDocument* mpDocument;
+ bool mbIsOvservationActive;
+
+ ::std::vector<const SdPage*> maInsertedPages;
+ ::std::vector<sal_Int32> maDeletedPages;
+};
+
+} } } // end of namespace ::sd::slidesorter::controller
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
index 0e58d5d3b411..d2c9f7481624 100755..100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
@@ -27,6 +27,7 @@
#ifndef SD_SLIDESORTER_SLOT_MANAGER_HXX
#define SD_SLIDESORTER_SLOT_MANAGER_HXX
+#include "model/SlsSharedPageDescriptor.hxx"
#include <tools/link.hxx>
#include <memory>
#include <queue>
@@ -71,6 +72,21 @@ public:
void ExecuteCommandAsynchronously (::std::auto_ptr<Command> pCommand);
+ /** Exclude or include one slide or all selected slides.
+ @param rpDescriptor
+ When the pointer is empty then apply the new state to all
+ selected pages. Otherwise apply the new state to just the
+ specified state.
+ */
+ void ChangeSlideExclusionState (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bExcludeSlide);
+
+ /** Call this after a change from normal mode to master mode or back.
+ The affected slots are invalidated.
+ */
+ void NotifyEditModeChange (void);
+
private:
/// The controller for which we manage the slot calls.
SlideSorter& mrSlideSorter;
@@ -93,6 +109,13 @@ private:
*/
void InsertSlide (SfxRequest& rRequest);
+ void DuplicateSelectedSlides (SfxRequest& rRequest);
+
+ /** Use one of several ways to determine where to insert a new page.
+ This can be the current selection or the insertion indicator.
+ */
+ sal_Int32 GetInsertionPosition (void);
+
DECL_LINK(UserEventCallback, void*);
};
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx
new file mode 100644
index 000000000000..289fb1f5f072
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_TRANSFERABLE_HXX
+#define SD_SLIDESORTER_TRANSFERABLE_HXX
+
+#include "sdxfer.hxx"
+
+class SdDrawDocument;
+namespace sd { namespace slidesorter {
+class SlideSorterViewShell;
+} }
+
+namespace sd { namespace slidesorter { namespace controller {
+
+
+/** This class exists to have DragFinished call the correct object: the
+ SlideSorterViewShell instead of the old SlideView.
+*/
+class Transferable
+ : public SdTransferable
+{
+public:
+ class Representative
+ {
+ public:
+ Representative (const Bitmap& rBitmap, const bool bIsExcluded)
+ : maBitmap(rBitmap), mbIsExcluded(bIsExcluded) {}
+ Representative (const Representative& rOther)
+ : maBitmap(rOther.maBitmap), mbIsExcluded(rOther.mbIsExcluded) {}
+ Representative operator= (Representative& rOther)
+ { if (&rOther != this) {maBitmap = rOther.maBitmap; mbIsExcluded = rOther.mbIsExcluded; }
+ return *this;
+ }
+
+ Bitmap maBitmap;
+ bool mbIsExcluded;
+ };
+
+
+ Transferable (
+ SdDrawDocument* pSrcDoc,
+ ::sd::View* pWorkView,
+ BOOL bInitOnGetData,
+ SlideSorterViewShell* pViewShell,
+ const ::std::vector<Representative>& rRepresentatives);
+
+ virtual ~Transferable (void);
+
+ virtual void DragFinished (sal_Int8 nDropAction);
+
+ const ::std::vector<Representative>& GetRepresentatives (void) const;
+
+private:
+ SlideSorterViewShell* mpViewShell;
+ const ::std::vector<Representative> maRepresentatives;
+
+ virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint);
+};
+
+} } } // end of namespace ::sd::slidesorter::controller
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
new file mode 100644
index 000000000000..cdaf9b1588ea
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VISIBLE_AREA_MANAGER_HXX
+#define SD_SLIDESORTER_VISIBLE_AREA_MANAGER_HXX
+
+#include "controller/SlsAnimator.hxx"
+#include "model/SlsSharedPageDescriptor.hxx"
+#include <boost/noncopyable.hpp>
+#include <boost/optional.hpp>
+
+namespace sd { namespace slidesorter { namespace controller {
+
+
+/** Manage requests for scrolling page objects into view.
+*/
+class VisibleAreaManager
+ : public ::boost::noncopyable
+{
+public:
+ VisibleAreaManager (SlideSorter& rSlideSorter);
+ ~VisibleAreaManager (void);
+
+ void ActivateCurrentSlideTracking (void);
+ void DeactivateCurrentSlideTracking (void);
+
+ /** Request the current slide to be moved into the visible area.
+ This request is only obeyed when the current slide tracking is
+ active.
+ @see ActivateCurrentSlideTracking() and DeactivateCurrentSlideTracking()
+ */
+ void RequestCurrentSlideVisible (void);
+
+ /** Request to make the specified page object visible.
+ */
+ void RequestVisible (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bForce = false);
+
+ /** Temporarily disable the update of the visible area.
+ */
+ class TemporaryDisabler
+ {
+ public:
+ TemporaryDisabler (SlideSorter& rSlideSorter);
+ ~TemporaryDisabler (void);
+ private:
+ VisibleAreaManager& mrVisibleAreaManager;
+ };
+
+private:
+ SlideSorter& mrSlideSorter;
+
+ /** List of rectangle that someone wants to be moved into the visible
+ area.
+ Cleared on every call to ForgetVisibleRequests() and MakeVisible().
+ */
+ ::std::vector<Rectangle> maVisibleRequests;
+
+ /** Animation id for a scroll animation that sets the top
+ and left of the visible area to maRequestedVisibleTopLeft.
+ */
+ Animator::AnimationId mnScrollAnimationId;
+ Point maRequestedVisibleTopLeft;
+ Animator::AnimationMode meRequestedAnimationMode;
+ bool mbIsCurrentSlideTrackingActive;
+ int mnDisableCount;
+
+ void MakeVisible (void);
+ ::boost::optional<Point> GetRequestedTopLeft (void) const;
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
index 4ade19087304..9dfd861fd5cf 100755..100644
--- a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
+++ b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
@@ -36,6 +36,7 @@ class SdDrawDocument;
#include "pres.hxx"
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <osl/mutex.hxx>
+#include <vcl/region.hxx>
#include <memory>
#include <vector>
@@ -43,6 +44,9 @@ class SdDrawDocument;
namespace css = ::com::sun::star;
+class SdrPage;
+class SdPage;
+
namespace sd { namespace slidesorter {
class SlideSorter;
} }
@@ -55,6 +59,9 @@ namespace sd { namespace slidesorter { namespace model {
class DocumentPageContainer;
+inline sal_Int32 FromCoreIndex (const USHORT nCoreIndex) { return (nCoreIndex-1)/2; }
+inline USHORT ToCoreIndex (const sal_Int32 nIndex) { return nIndex*2+1; }
+
/** The model of the slide sorter gives access to the slides that are to be
displayed in the slide sorter view. Via the SetDocumentSlides() method
this set of slides can be modified (but do not call it directly, use
@@ -64,8 +71,10 @@ class SlideSorterModel
{
public:
SlideSorterModel (SlideSorter& rSlideSorter);
+ void Init (void);
virtual ~SlideSorterModel (void);
+ void Dispose (void);
/** This method is present to let the view create a ShowView for
displaying slides.
@@ -83,6 +92,9 @@ public:
*/
bool SetEditMode (EditMode eEditMode);
+ /** Set the edit mode to that currently used by the controller.
+ */
+ bool SetEditModeFromController (void);
EditMode GetEditMode (void) const;
PageKind GetPageType (void) const;
@@ -126,6 +138,25 @@ public:
sal_Int32 GetIndex (
const ::com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage>& rxSlide) const;
+ /** Return a page descriptor for the given SdrPage. Page descriptors
+ are created on demand. The page descriptor is found (or not found)
+ in (at most) linear time. Note that all page descriptors in front of
+ the one associated with the given XDrawPage are created when not yet
+ present. When the SdrPage is not found then all descriptors are
+ created.
+ @return
+ Returns the index to the requested page descriptor or -1 when
+ there is no such page descriptor.
+ */
+ sal_Int32 GetIndex (const SdrPage* pPage) const;
+
+ /** Return an index for accessing an SdrModel that corresponds to the
+ given SlideSorterModel index. In many cases we just have to apply
+ the n*2+1 magic. Only when a special model is set, like a custom
+ slide show, then the returned value is different.
+ */
+ USHORT GetCoreIndex (const sal_Int32 nIndex) const;
+
/** Call this method after the document has changed its structure. This
will get the model in sync with the SdDrawDocument. This method
tries not to throw away to much information already gathered. This
@@ -144,16 +175,9 @@ public:
*/
void SynchronizeDocumentSelection (void);
- /** Replace the factory for the creation of the page objects and
- contacts with the given object. The old factory is destroyed.
- */
- void SetPageObjectFactory(
- ::std::auto_ptr<controller::PageObjectFactory> pPageObjectFactory);
-
- /** Return the page object factory. It none has been set so far or it
- has been reset, then a new one is created.
+ /** Set the selection of the called model to exactly that of the document.
*/
- const controller::PageObjectFactory& GetPageObjectFactory (void) const;
+ void SynchronizeModelSelection (void);
/** Return the mutex so that the caller can lock it and then safely
access the model.
@@ -179,6 +203,29 @@ public:
*/
void UpdatePageList (void);
+ bool IsReadOnly (void) const;
+
+ /** The current selection is saved by copying the ST_Selected state into
+ ST_WasSelected for slides.
+ */
+ void SaveCurrentSelection (void);
+
+ /** The current selection is restored from the ST_WasSelected state from
+ the slides.
+ @returns
+ The returned region has to be repainted to reflect the updated
+ selection states.
+ */
+ Region RestoreSelection (void);
+
+ /** Typically called from controller::Listener this method handles the
+ insertion and deletion of single pages.
+ @return
+ Returns <TRUE/> when the given page is relevant for the current
+ page kind and edit mode.
+ */
+ bool NotifyPageEvent (const SdrPage* pPage);
+
private:
mutable ::osl::Mutex maMutex;
SlideSorter& mrSlideSorter;
@@ -187,13 +234,16 @@ private:
EditMode meEditMode;
typedef ::std::vector<SharedPageDescriptor> DescriptorContainer;
mutable DescriptorContainer maPageDescriptors;
- mutable ::std::auto_ptr<controller::PageObjectFactory> mpPageObjectFactory;
/** Resize the descriptor container according to current values of
page kind and edit mode.
*/
void AdaptSize (void);
+ SdPage* GetPage (const sal_Int32 nCoreIndex) const;
+ void InsertSlide (SdPage* pPage);
+ void DeleteSlide (const SdPage* pPage);
+ void UpdateIndices (const sal_Int32 nFirstIndex);
};
} } } // end of namespace ::sd::slidesorter::model
diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
index 81877ce7465c..276f1a7c10a7 100755..100644
--- a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
+++ b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
@@ -28,6 +28,7 @@
#ifndef SD_SLIDESORTER_PAGE_DESCRIPTOR_HXX
#define SD_SLIDESORTER_PAGE_DESCRIPTOR_HXX
+#include "model/SlsVisualState.hxx"
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <tools/gen.hxx>
#include <tools/link.hxx>
@@ -36,21 +37,11 @@
#include <memory>
#include <boost/enable_shared_from_this.hpp>
+#include <boost/scoped_ptr.hpp>
-class SdPage;
-
-namespace sdr { namespace contact {
-class ObjectContact;
-} }
-
-namespace sd { namespace slidesorter { namespace view {
-class PageObject;
-class PageObjectViewObjectContact;
-} } }
-namespace sd { namespace slidesorter { namespace controller {
-class PageObjectFactory;
-} } }
+class SdPage;
+class SdrPage;
namespace sd { namespace slidesorter { namespace model {
@@ -87,8 +78,7 @@ public:
PageDescriptor (
const css::uno::Reference<css::drawing::XDrawPage>& rxPage,
SdPage* pPage,
- const sal_Int32 nIndex,
- const controller::PageObjectFactory& rPageObjectFactory);
+ const sal_Int32 nIndex);
~PageDescriptor (void);
@@ -100,33 +90,22 @@ public:
*/
css::uno::Reference<css::drawing::XDrawPage> GetXDrawPage (void) const;
- /** Return the page shape that is used for visualizing the page.
+ /** Returns the index of the page as it is displayed in the view as page
+ number. The value may differ from the index returned by the
+ XDrawPage when there are hidden slides and the XIndexAccess used to
+ access the model filters them out.
*/
- view::PageObject* GetPageObject (void);
- void ReleasePageObject (void);
+ sal_Int32 GetPageIndex (void) const;
+ void SetPageIndex (const sal_Int32 nIndex);
- /** Return <TRUE/> when the page object is fully or parially visible. */
- bool IsVisible (void) const;
+ bool UpdateMasterPage (void);
- /** Set the visible state that is returned by the IsVisible() method.
- This method is typically called by the view who renders the object
- onto the screen.
- */
- void SetVisible (bool bVisible);
+ enum State { ST_Visible, ST_Selected, ST_WasSelected,
+ ST_Focused, ST_MouseOver, ST_Current, ST_Excluded };
- /** Make sure that the page is selected and return whether the
- selection state changed.
- */
- bool Select (void);
- /** Make sure that the page is not selected and return whether the
- selection state changed.
- */
- bool Deselect (void);
+ bool HasState (const State eState) const;
- /** Return whether the page is selected (and thus bypasses the internal
- mbIsSelected flag.
- */
- bool IsSelected (void) const;
+ bool SetState (const State eState, const bool bStateValue);
/** Set the internal mbIsSelected flag to the selection state of the
page. Use this method to synchronize a page descriptor with the
@@ -137,70 +116,39 @@ public:
returned. When they were the same this method returns
<FALSE/>.
*/
- bool UpdateSelection (void);
-
- bool IsFocused (void) const;
- void SetFocus (void);
- void RemoveFocus (void);
-
- view::PageObjectViewObjectContact* GetViewObjectContact (void) const;
-
- void SetViewObjectContact (
- view::PageObjectViewObjectContact* pViewObjectContact);
+ bool GetCoreSelection (void);
- /** Return the currently used page object factory.
+ /** Set the selection flags of the SdPage objects to the corresponding
+ selection states of the page descriptors.
*/
- const controller::PageObjectFactory& GetPageObjectFactory (void) const;
+ void SetCoreSelection (void);
- /** Replace the current page object factory by the given one.
- */
- void SetPageObjectFactory (const controller::PageObjectFactory& rFactory);
-
- void SetModelBorder (const SvBorder& rBorder);
- SvBorder GetModelBorder (void) const;
+ VisualState& GetVisualState (void);
- /** The size of the area in which the page number is displayed is
- calculated by the SlideSorterView and then stored in the page
- descriptors so that the contact objects can access them. The
- contact objects can not calculate them on demand because the total
- number of slides is needed to do that and this number is not known
- to the contact objects.
- */
- void SetPageNumberAreaModelSize (const Size& rSize);
- Size GetPageNumberAreaModelSize (void) const;
-
- /** Set or revoke the state of this slide being the current slide.
- */
- void SetIsCurrentPage (const bool bIsCurrent);
+ Rectangle GetBoundingBox (void) const;
+ Point GetLocation (const bool bIgnoreLocation = false) const;
+ void SetBoundingBox (const Rectangle& rBoundingBox);
private:
SdPage* mpPage;
css::uno::Reference<css::drawing::XDrawPage> mxPage;
- /** This index is displayed as page number in the view. It may or may
- not be actual page index.
- */
- const sal_Int32 mnIndex;
-
- /// The factory that is used to create PageObject objects.
- const controller::PageObjectFactory* mpPageObjectFactory;
+ SdrPage const* mpMasterPage;
- /** The page object will be destroyed by the page into which it has
- been inserted.
+ /** This index is displayed as page number in the view. It may or may
+ not be the actual page index.
*/
- view::PageObject* mpPageObject;
-
- bool mbIsSelected;
- bool mbIsVisible;
- bool mbIsFocused;
- bool mbIsCurrent;
+ sal_Int32 mnIndex;
- view::PageObjectViewObjectContact* mpViewObjectContact;
+ Rectangle maBoundingBox;
+ VisualState maVisualState;
- /// The borders in model coordinates arround the page object.
- SvBorder maModelBorder;
+ bool mbIsSelected : 1;
+ bool mbWasSelected : 1;
+ bool mbIsVisible : 1;
+ bool mbIsFocused : 1;
+ bool mbIsCurrent : 1;
+ bool mbIsMouseOver : 1;
- /// The size of the page number area in model coordinates.
- Size maPageNumberAreaModelSize;
// Do not use the copy constructor operator. It is not implemented.
PageDescriptor (const PageDescriptor& rDescriptor);
diff --git a/sd/source/ui/slidesorter/inc/model/SlsVisualState.hxx b/sd/source/ui/slidesorter/inc/model/SlsVisualState.hxx
new file mode 100644
index 000000000000..03b242fdd29a
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/model/SlsVisualState.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VISUAL_STATE_HXX
+#define SD_SLIDESORTER_VISUAL_STATE_HXX
+
+#include <sal/types.h>
+#include <tools/gen.hxx>
+#include <boost/function.hpp>
+
+namespace sd { namespace slidesorter { namespace model {
+
+class PageDescriptor;
+
+/** This class gives access to values related to the visualization of page
+ objects. This includes animation state when blending from one state to
+ another.
+*/
+class VisualState
+{
+public:
+ enum State {
+ VS_Selected,
+ VS_Focused,
+ VS_Current,
+ VS_Excluded,
+ VS_None };
+
+ VisualState (const sal_Int32 nPageId);
+ ~VisualState (void);
+
+ State GetCurrentVisualState (void) const;
+ State GetOldVisualState (void) const;
+ void SetVisualState (const State eState);
+ double GetVisualStateBlend (void) const;
+ void SetVisualStateBlend (const double nBlend);
+
+ void UpdateVisualState (const PageDescriptor& rDescriptor);
+
+ void SetMouseOverState (const bool bIsMouseOver);
+
+ sal_Int32 GetStateAnimationId (void) const;
+ void SetStateAnimationId (const sal_Int32 nAnimationId);
+
+ Point GetLocationOffset (void) const;
+ bool SetLocationOffset (const Point& rPoint);
+ sal_Int32 GetLocationAnimationId (void) const;
+ void SetLocationAnimationId (const sal_Int32 nAnimationId);
+
+ double GetButtonAlpha (void) const;
+ void SetButtonAlpha (const double nAlpha);
+ double GetButtonBarAlpha (void) const;
+ void SetButtonBarAlpha (const double nAlpha);
+ sal_Int32 GetButtonAlphaAnimationId (void) const;
+ void SetButtonAlphaAnimationId (const sal_Int32 nAnimationId);
+
+ sal_Int32 mnPageId; // For debugging
+
+private:
+ State meCurrentVisualState;
+ State meOldVisualState;
+ double mnVisualStateBlend;
+ sal_Int32 mnStateAnimationId;
+ bool mbOldMouseOverState;
+ bool mbCurrentMouseOverState;
+
+ Point maLocationOffset;
+ sal_Int32 mnLocationAnimationId;
+
+ double mnButtonAlpha;
+ double mnButtonBarAlpha;
+ sal_Int32 mnButtonAlphaAnimationId;
+};
+
+} } } // end of namespace ::sd::slidesorter::model
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
index 2ef520b1df89..f28287b15a0e 100755..100644
--- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
@@ -28,28 +28,29 @@
#ifndef SD_SLIDESORTER_SLIDE_SORTER_VIEW_HXX
#define SD_SLIDESORTER_SLIDE_SORTER_VIEW_HXX
-#include "View.hxx"
-
+#include "SlideSorter.hxx"
+#include "model/SlsPageDescriptor.hxx"
#include "model/SlsSharedPageDescriptor.hxx"
+#include "view/SlsLayouter.hxx"
+#include "view/SlsILayerPainter.hxx"
+#include "View.hxx"
#include <sfx2/viewfrm.hxx>
#include "pres.hxx"
#include <tools/gen.hxx>
+#include <svx/svdmodel.hxx>
+#include <vcl/region.hxx>
+#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <memory>
#include <boost/shared_ptr.hpp>
+#include <boost/noncopyable.hpp>
class Point;
-namespace sdr { namespace contact {
-class ObjectContact;
-} }
-
-namespace sd { namespace slidesorter {
-class SlideSorter;
-} }
-
namespace sd { namespace slidesorter { namespace controller {
class SlideSorterController;
+class Properties;
} } }
namespace sd { namespace slidesorter { namespace cache {
@@ -62,15 +63,20 @@ class SlideSorterModel;
namespace sd { namespace slidesorter { namespace view {
+class ButtonBar;
+class LayeredDevice;
class Layouter;
-class ViewOverlay;
+class PageObjectPainter;
+class SelectionPainter;
+class ToolTip;
class SlideSorterView
- : public View
+ : public sd::View,
+ public ::boost::noncopyable
{
public:
- TYPEINFO();
+ TYPEINFO ();
/** Create a new view for the slide sorter.
@param rViewShell
@@ -79,53 +85,24 @@ public:
*/
SlideSorterView (SlideSorter& rSlideSorter);
+ void Init (void);
virtual ~SlideSorterView (void);
+ void Dispose (void);
- enum Orientation { HORIZONTAL, VERTICAL };
- void SetOrientation (const Orientation eOrientation);
- Orientation GetOrientation (void) const;
+ /** Set the general way of layouting the page objects. Note that this
+ method does not trigger any repaints or layouts.
+ */
+ bool SetOrientation (const Layouter::Orientation eOrientation);
+ Layouter::Orientation GetOrientation (void) const;
void RequestRepaint (void);
void RequestRepaint (const model::SharedPageDescriptor& rDescriptor);
+ void RequestRepaint (const Rectangle& rRepaintBox);
+ void RequestRepaint (const Region& rRepaintRegion);
Rectangle GetModelArea (void);
- enum CoordinateSystem { CS_SCREEN, CS_MODEL };
- enum BoundingBoxType { BBT_SHAPE, BBT_INFO };
-
- /** Return the rectangle that bounds the page object represented by the
- given page descriptor.
- @param rDescriptor
- The descriptor of the page for which to return the bounding box.
- @param eCoordinateSystem
- Specifies whether to return the screen or model coordinates.
- @param eBoundingBoxType
- Specifies whether to return the bounding box of only the page
- object or the one that additionally includes other displayed
- information like page name and fader symbol.
- */
- Rectangle GetPageBoundingBox (
- const model::SharedPageDescriptor& rpDescriptor,
- CoordinateSystem eCoordinateSystem,
- BoundingBoxType eBoundingBoxType) const;
-
- /** Return the rectangle that bounds the page object represented by the
- given page index .
- @param nIndex
- The index of the page for which to return the bounding box.
- @param eCoordinateSystem
- Specifies whether to return the screen or model coordinates.
- @param eBoundingBoxType
- Specifies whether to return the bounding box of only the page
- object or the one that additionally includes other displayed
- information like page name and fader symbol.
- */
- Rectangle GetPageBoundingBox (
- sal_Int32 nIndex,
- CoordinateSystem eCoordinateSystem,
- BoundingBoxType eBoundingBoxType) const;
-
/** Return the index of the page that is rendered at the given position.
@param rPosition
The position is expected to be in pixel coordinates.
@@ -163,12 +140,17 @@ public:
void HandleDrawModeChange (void);
virtual void Resize (void);
- virtual void CompleteRedraw (OutputDevice* pDevice, const Region& rPaintArea, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L);
- virtual void InvalidateOneWin (
- ::Window& rWindow);
- virtual void InvalidateOneWin (
- ::Window& rWindow,
- const Rectangle& rPaintArea );
+ virtual void CompleteRedraw (
+ OutputDevice* pDevice,
+ const Region& rPaintArea,
+ sdr::contact::ViewObjectContactRedirector* pRedirector = NULL);
+ void Paint (OutputDevice& rDevice, const Rectangle& rRepaintArea);
+
+ virtual void ConfigurationChanged (
+ utl::ConfigurationBroadcaster* pBroadcaster,
+ sal_uInt32 nHint);
+
+ void HandleDataChangeEvent (void);
void Layout (void);
/** This tells the view that it has to re-determine the visibility of
@@ -178,13 +160,10 @@ public:
/** Return the window to which this view renders its output.
*/
- ::sd::Window* GetWindow (void) const;
-
+ // ::boost::shared_ptr<sd::Window> GetWindow (void) const;
::boost::shared_ptr<cache::PageCache> GetPreviewCache (void);
- view::ViewOverlay& GetOverlay (void);
-
/** Set the bounding box of the insertion marker in model coordinates.
It will be painted as a dark rectangle that fills the given box.
@@ -205,19 +184,18 @@ public:
*/
void SetSelectionRectangleVisibility (bool bVisible);
- typedef ::std::pair<sal_Int32,sal_Int32> PageRange;
/** Return the range of currently visible page objects including the
first and last one in that range.
@return
The returned pair of page object indices is empty when the
second index is lower than the first.
*/
- PageRange GetVisiblePageRange (void);
+ Pair GetVisiblePageRange (void);
/** Add a shape to the page. Typically used from inside
PostModelChange().
*/
- void AddSdrObject (SdrObject& rObject);
+ // void AddSdrObject (SdrObject& rObject);
/** Add a listener that is called when the set of visible slides.
@param rListener
@@ -234,71 +212,87 @@ public:
*/
void RemoveVisibilityChangeListener (const Link& rListener);
+ /** The page under the mouse is not highlighted in some contexts. Call
+ this method on context changes.
+ */
+ void UpdatePageUnderMouse (bool bAnimate);
+ void UpdatePageUnderMouse (
+ const Point& rMousePosition,
+ const bool bIsMouseButtonDown,
+ const bool bAnimate = true);
+ void UpdatePageUnderMouse (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const Point& rMousePosition,
+ const bool bIsMouseButtonDown,
+ const bool bAnimate = true);
+ void SetPageUnderMouse (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bAnimate = true);
+
+ bool SetState (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const model::PageDescriptor::State eState,
+ const bool bStateValue,
+ const bool bAnimate = true);
+
+ void UpdateOrientation (void);
+
+ ::boost::shared_ptr<PageObjectPainter> GetPageObjectPainter (void);
+ ::boost::shared_ptr<LayeredDevice> GetLayeredDevice (void) const;
+
+ class DrawLock
+ {
+ public:
+ DrawLock (view::SlideSorterView& rView, const SharedSdWindow& rpWindow);
+ DrawLock (SlideSorter& rSlideSorter);
+ ~DrawLock (void);
+ /** When the DrawLock is disposed then it will not request a repaint
+ on destruction.
+ */
+ void Dispose (void);
+ private:
+ view::SlideSorterView& mrView;
+ SharedSdWindow mpWindow;
+ };
+
+ ButtonBar& GetButtonBar (void) const;
+ ToolTip& GetToolTip (void) const;
+
protected:
virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint);
private:
SlideSorter& mrSlideSorter;
model::SlideSorterModel& mrModel;
- /// This model is used for the maPage object and for the page visualizers
- /// (SdrPageObj)
- SdrModel maPageModel;
- /** This page acts as container for the page objects that represent the
- pages of the document that is represented by the SlideSorterModel.
- */
- SdrPage* mpPage;
+ bool mbIsDisposed;
::std::auto_ptr<Layouter> mpLayouter;
bool mbPageObjectVisibilitiesValid;
::boost::shared_ptr<cache::PageCache> mpPreviewCache;
- ::std::auto_ptr<ViewOverlay> mpViewOverlay;
-
- int mnFirstVisiblePageIndex;
- int mnLastVisiblePageIndex;
-
- SvBorder maPagePixelBorder;
-
+ ::boost::shared_ptr<LayeredDevice> mpLayeredDevice;
+ Range maVisiblePageRange;
bool mbModelChangedWhileModifyEnabled;
-
Size maPreviewSize;
-
bool mbPreciousFlagUpdatePending;
-
- Size maPageNumberAreaModelSize;
- SvBorder maModelBorder;
-
- Orientation meOrientation;
-
+ Layouter::Orientation meOrientation;
+ ::boost::shared_ptr<controller::Properties> mpProperties;
+ model::SharedPageDescriptor mpPageUnderMouse;
+ sal_Int32 mnButtonUnderMouse;
+ ::boost::shared_ptr<PageObjectPainter> mpPageObjectPainter;
+ ::boost::shared_ptr<SelectionPainter> mpSelectionPainter;
+ Region maRedrawRegion;
+ SharedILayerPainter mpBackgroundPainter;
+ ::boost::scoped_ptr<ButtonBar> mpButtonBar;
+ ::boost::scoped_ptr<ToolTip> mpToolTip;
+ bool mbIsRearrangePending;
::std::vector<Link> maVisibilityChangeListeners;
- /** Adapt the coordinates of the given bounding box according to the
- other parameters.
- @param rModelPageObjectBoundingBox
- Bounding box given in model coordinates that bounds only the
- page object.
- @param eCoordinateSystem
- When CS_SCREEN is given then the bounding box is converted into
- screen coordinates.
- @param eBoundingBoxType
- When BBT_INFO is given then the bounding box is made larger so
- that it encloses all relevant displayed information.
- */
- void AdaptBoundingBox (
- Rectangle& rModelPageObjectBoundingBox,
- CoordinateSystem eCoordinateSystem,
- BoundingBoxType eBoundingBoxType) const;
-
/** Determine the visibility of all page objects.
*/
void DeterminePageObjectVisibilities (void);
- /** Update the page borders used by the layouter by using those returned
- by the first page. Call this function when the model changes,
- especially when the number of pages changes, or when the window is
- resized as the borders may be device dependent.
- */
- void UpdatePageBorders (void);
-
void UpdatePreciousFlags (void);
+ void RequestRearrange (void);
+ void Rearrange (void);
};
diff --git a/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx
new file mode 100644
index 000000000000..460c915f8a56
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsButtonBar.hxx
@@ -0,0 +1,362 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VIEW_BUTTON_BAR_HXX
+#define SD_SLIDESORTER_VIEW_BUTTON_BAR_HXX
+
+#include "model/SlsSharedPageDescriptor.hxx"
+#include <tools/gen.hxx>
+#include <rtl/ustring.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/bmpacc.hxx>
+#include <boost/scoped_ptr.hpp>
+
+namespace sd { namespace slidesorter {
+class SlideSorter;
+} }
+
+
+namespace sd { namespace slidesorter { namespace view {
+
+class Theme;
+
+class Button;
+typedef ::boost::shared_ptr<Button> SharedButton;
+
+/** This is a container of buttons and a coordinating controller.
+ The last means that it receives mouse events and forwards them to
+ the right button.
+*/
+class ButtonBar
+{
+public:
+ ButtonBar (SlideSorter& rSlideSorter);
+ ~ButtonBar (void);
+
+ void ProcessButtonDownEvent (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const Point aMouseModelLocation);
+ void ProcessButtonUpEvent (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const Point aMouseModelLocation);
+ void ProcessMouseMotionEvent (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const Point aMouseModelLocation,
+ const bool bIsMouseButtonDown);
+
+ void ResetPage (void);
+
+ /** Return the number of buttons that are to be displayed in page
+ objects which the mouse hovers over.
+ @param bIsExcluded
+ When this flag is <TRUE/> then return the number of
+ buttons that is to be displayed for pages that are
+ excluded from the slide show.
+ */
+ sal_Int32 GetButtonCount (const bool bIsExcluded) const;
+
+ /** Return the specified button.
+ @param nIndex
+ Valid values lie in the range [0,GetButtonCount()).
+ @param bIsExcluded
+ When this flag is <TRUE/> then return a button that is to
+ be displayed for pages that are excluded from the slide
+ show.
+ @return
+ Returns an empty pointer when the given index is not valid.
+ */
+ ::boost::shared_ptr<Button> GetButton (
+ const bool bIsExcluded,
+ const sal_Int32 nIndex) const;
+
+ bool IsMouseOverBar (void) const;
+
+ /** Paint the specified page object. When this is not the same as the
+ one under the mouse (mpDescriptor) then the buttons are all
+ painted in their normal state.
+ */
+ void Paint (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpPageDescriptor);
+
+ bool IsMouseOverButton (void) const;
+
+ void RequestLayout (void);
+
+ /** Return the help text for the button under the mouse.
+ @return
+ When the mouse is not over a button then an empty string
+ is returned.
+ */
+ ::rtl::OUString GetButtonHelpText (void) const;
+
+ /** Request the button bar to be shown.
+ @param bAnimate
+ This flag controls whether to just show the button bar (<FALSE/>)
+ or to fade it in smoothly (<TRUE/>.)
+ */
+ void RequestFadeIn (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bAnimate);
+
+ /** Request the button bar to be hidden.
+ @param bAnimate
+ This flag controls whether to just hide the button bar (<FALSE/>)
+ or to fade it out smoothly (<TRUE/>.)
+ */
+ void RequestFadeOut (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const bool bAnimate);
+
+ /** Return whether the button bar is visible for the givn descriptor (or
+ being faded in.)
+ */
+ bool IsVisible (const model::SharedPageDescriptor& rpDescriptor);
+
+ void HandleDataChangeEvent (void);
+
+ class BackgroundTheme;
+
+ /** While at least one Lock object exists the button bar will not be
+ displayed. Used, e.g. during a mouse multiselection to avoid
+ confusing and unhelpfull visual signals.
+ */
+ class Lock
+ {
+ public:
+ Lock (SlideSorter& rSlideSorter);
+ ~Lock (void);
+ private:
+ ButtonBar& mrButtonBar;
+ };
+
+private:
+ SlideSorter& mrSlideSorter;
+ Size maPageObjectSize;
+ Rectangle maButtonBoundingBox;
+ Point maBackgroundLocation;
+ model::SharedPageDescriptor mpDescriptor;
+ bool mbIsExcluded;
+ boost::shared_ptr<Button> mpButtonUnderMouse;
+ // The button on which the mouse button was pressed.
+ boost::shared_ptr<Button> mpDownButton;
+ ::std::vector<SharedButton> maRegularButtons;
+ ::std::vector<SharedButton> maExcludedButtons;
+ BitmapEx maNormalBackground;
+ BitmapEx maButtonDownBackground;
+ bool mbIsMouseOverBar;
+ ::boost::scoped_ptr<BackgroundTheme> mpBackgroundTheme;
+ int mnLockCount;
+
+ /** Remember the specified page. If it differs from mpDescriptor then
+ the buttons are placed anew.
+ @return
+ The returned flag indicates wether the mpDescriptor member
+ is set to a new value.
+ */
+ bool SetPage (const model::SharedPageDescriptor& rpDescriptor);
+ SharedButton GetButtonAt (const Point aModelLocation);
+ bool SetButtonUnderMouse (const SharedButton& rButton = SharedButton());
+ void PaintButtonBackground (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpPageDescriptor,
+ const Point aOffset);
+ void LayoutButtons (const Size aPageModelSize);
+ bool LayoutButtons (void);
+ BitmapEx CreateBackground (
+ const OutputDevice& rTemplateDevice,
+ const bool bIsButtonDown) const;
+ bool IsMouseOverBar (const Point aModelLocation) const;
+ void StartFadeAnimation (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const double nTargetAlpha,
+ const bool bFadeIn);
+
+ void AcquireLock (void);
+ void ReleaseLock (void);
+};
+
+
+
+
+class Button
+{
+public:
+ Button (
+ SlideSorter& rSlideSorter,
+ const ::rtl::OUString& rsHelpText);
+ virtual ~Button (void);
+
+ enum State { State_Normal, State_Hover, State_Down };
+ enum IconSize { IconSize_Large, IconSize_Medium, IconSize_Small };
+
+ /** Set a new state.
+ @return
+ When the new state is different from the old state
+ then <TRUE/> is returned.
+ */
+ bool SetState (const State eState);
+ State GetState (void) const;
+
+ virtual void Place (const Rectangle aButtonBarBox) = 0;
+ virtual void Paint (
+ OutputDevice& rDevice,
+ const Point aOffset,
+ const double nAlpha,
+ const ::boost::shared_ptr<Theme>& rpTheme) const = 0;
+ virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor) = 0;
+
+ /** Return the bounding box of the layouted button.
+ */
+ Rectangle GetBoundingBox (void) const;
+ /** Return the minimum size required to completely paint the
+ button.
+ */
+ virtual Size GetSize (void) const = 0;
+ virtual Size GetSize (const IconSize eIconSize) const = 0;
+ ::rtl::OUString GetHelpText (void) const;
+ bool IsDown (void) const;
+ void SetActiveState (const bool bIsActive);
+ bool IsActive (void) const;
+ void SetIconSize (const IconSize eIconSize);
+ IconSize GetIconSize (void) const;
+ /** By default a button is always enabled. Override to change this.
+ */
+ virtual bool IsEnabled (void) const;
+
+protected:
+ SlideSorter& mrSlideSorter;
+ State meState;
+ Rectangle maBoundingBox;
+ const ::rtl::OUString msHelpText;
+ // Buttons that lie (partly) outside the button bar are deactivated.
+ bool mbIsActive;
+ IconSize meIconSize;
+};
+
+
+
+class TextButton : public Button
+{
+public:
+ TextButton (
+ SlideSorter& rSlideSorter,
+ const ::rtl::OUString& rsText,
+ const ::rtl::OUString& rsHelpText);
+
+ virtual void Place (const Rectangle aButtonBarBox);
+ virtual void Paint (
+ OutputDevice& rDevice,
+ const Point aOffset,
+ const double nAlpha,
+ const ::boost::shared_ptr<Theme>& rpTheme) const;
+ virtual Size GetSize (void) const;
+ virtual Size GetSize (const IconSize eIconSize) const;
+
+private:
+ const ::rtl::OUString msText;
+};
+
+
+
+class ImageButton : public Button
+{
+public:
+ ImageButton (
+ SlideSorter& rSlideSorter,
+ const BitmapEx& rLargeIcon,
+ const BitmapEx& rLargeHoverIcon,
+ const BitmapEx& rMediumIcon,
+ const BitmapEx& rMediumHoverIcon,
+ const BitmapEx& rSmallIcon,
+ const BitmapEx& rSmallHoverIcon,
+ const ::rtl::OUString& rsHelpText);
+
+ virtual void Place (const Rectangle aButtonBarBox);
+ virtual void Paint (
+ OutputDevice& rDevice,
+ const Point aOffset,
+ const double nAlpha,
+ const ::boost::shared_ptr<Theme>& rpTheme) const;
+ virtual Size GetSize (void) const;
+ virtual Size GetSize (const IconSize eIconSize) const;
+
+private:
+ const BitmapEx maLargeIcon;
+ const BitmapEx maLargeHoverIcon;
+ const BitmapEx maMediumIcon;
+ const BitmapEx maMediumHoverIcon;
+ const BitmapEx maSmallIcon;
+ const BitmapEx maSmallHoverIcon;
+};
+
+
+class UnhideButton : public ImageButton
+{
+public:
+ UnhideButton (SlideSorter& rSlideSorter);
+
+protected:
+ virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
+};
+
+
+class StartShowButton : public ImageButton
+{
+public:
+ StartShowButton (SlideSorter& rSlideSorter);
+ virtual bool IsEnabled (void) const;
+
+protected:
+ virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
+};
+
+
+class HideButton : public ImageButton
+{
+public:
+ HideButton (SlideSorter& rSlideSorter);
+
+protected:
+ virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
+};
+
+
+class DuplicateButton : public ImageButton
+{
+public:
+ DuplicateButton (SlideSorter& rSlideSorter);
+ virtual bool IsEnabled (void) const;
+
+protected:
+ virtual void ProcessClick (const model::SharedPageDescriptor& rpDescriptor);
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsILayerPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsILayerPainter.hxx
new file mode 100644
index 000000000000..853890ee5894
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsILayerPainter.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VIEW_LAYER_PAINTER_HXX
+#define SD_SLIDESORTER_VIEW_LAYER_PAINTER_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+class OutputDevice;
+class Rectangle;
+
+namespace sd { namespace slidesorter { namespace view {
+
+class ILayerInvalidator
+{
+public:
+ virtual void Invalidate (const Rectangle& rInvalidationBox) = 0;
+};
+typedef ::boost::shared_ptr<ILayerInvalidator> SharedILayerInvalidator;
+
+class ILayerPainter
+{
+public:
+ virtual void SetLayerInvalidator (
+ const SharedILayerInvalidator& rpInvalidator) = 0;
+ virtual void Paint (
+ OutputDevice& rDevice,
+ const Rectangle& rRepaintArea) = 0;
+};
+typedef ::boost::shared_ptr<ILayerPainter> SharedILayerPainter;
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsInsertAnimator.hxx b/sd/source/ui/slidesorter/inc/view/SlsInsertAnimator.hxx
new file mode 100644
index 000000000000..cfd789818408
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsInsertAnimator.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VIEW_INSERT_ANIMATOR_HXX
+#define SD_SLIDESORTER_VIEW_INSERT_ANIMATOR_HXX
+
+#include "controller/SlsAnimator.hxx"
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+namespace sd { namespace slidesorter { namespace view {
+
+class InsertPosition;
+
+
+/** Animate the positions of page objects to make room at the insert
+ position while a move or copy operation takes place.
+*/
+class InsertAnimator
+ : private ::boost::noncopyable
+{
+public:
+ InsertAnimator (SlideSorter& rSlideSorter);
+
+ /** Set the position at which we have to make room for the display of an
+ icon.
+ */
+ void SetInsertPosition (const InsertPosition& rInsertPosition);
+
+ enum ResetMode { RM_Normal, RM_AbortAnimations };
+ /** Restore the normal position of all page objects.
+ @param eMode
+ This flag controls wether to start an animation that ends in the
+ normal positions of all slides (AM_Animated) or to restore the
+ normal positions immediately (AM_Immediate).
+ */
+ void Reset (const controller::Animator::AnimationMode eMode);
+
+private:
+ class Implementation;
+ ::boost::shared_ptr<Implementation> mpImplementation;
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx
new file mode 100644
index 000000000000..a9a640d978cf
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_INSERTION_INDICATOR_OVERLAY_HXX
+#define SD_SLIDESORTER_INSERTION_INDICATOR_OVERLAY_HXX
+
+#include "model/SlsSharedPageDescriptor.hxx"
+#include "view/SlsILayerPainter.hxx"
+#include "controller/SlsTransferable.hxx"
+
+#include <tools/gen.hxx>
+#include <vcl/bitmapex.hxx>
+#include <boost/scoped_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <vector>
+
+class OutputDevice;
+class SdPage;
+
+namespace sd { namespace slidesorter {
+class SlideSorter;
+} }
+
+namespace sd { namespace slidesorter { namespace model {
+class PageEnumeration;
+} } }
+
+namespace sd { namespace slidesorter { namespace controller {
+class Transferable;
+} } }
+
+namespace sd { namespace slidesorter { namespace view {
+
+class FramePainter;
+class LayeredDevice;
+
+/** The insertion indicator is painted as a vertical or horizonal bar
+ in the space between slides.
+*/
+class InsertionIndicatorOverlay
+ : public ILayerPainter,
+ public ::boost::enable_shared_from_this<InsertionIndicatorOverlay>
+{
+public:
+ InsertionIndicatorOverlay (SlideSorter& rSlideSorter);
+ virtual ~InsertionIndicatorOverlay (void);
+
+ virtual void SetLayerInvalidator (const SharedILayerInvalidator& rpInvalidator);
+
+ void Create (const controller::Transferable* pTransferable);
+
+ /** Given a position in model coordinates this method calculates the
+ insertion marker both as an index in the document and as a location
+ used for drawing the insertion indicator.
+ */
+ void SetLocation (const Point& rPosition);
+
+ Size GetSize (void) const;
+
+ virtual void Paint (
+ OutputDevice& rDevice,
+ const Rectangle& rRepaintArea);
+
+ bool IsVisible (void) const;
+ void Hide (void);
+ void Show (void);
+
+ Rectangle GetBoundingBox (void) const;
+
+private:
+ SlideSorter& mrSlideSorter;
+ bool mbIsVisible;
+ const sal_Int32 mnLayerIndex;
+ SharedILayerInvalidator mpLayerInvalidator;
+ // Center of the insertion indicator.
+ Point maLocation;
+ BitmapEx maIcon;
+ Point maIconOffset;
+ ::boost::scoped_ptr<FramePainter> mpShadowPainter;
+
+ void SetPositionAndSize (const Rectangle& rBoundingBox);
+ void SelectRepresentatives (
+ model::PageEnumeration& rSelection,
+ ::std::vector<model::SharedPageDescriptor>& rDescriptors) const;
+ Point PaintRepresentatives (
+ OutputDevice& rContent,
+ const Size aPreviewSize,
+ const sal_Int32 nOffset,
+ const ::std::vector<controller::Transferable::Representative>& rPages) const;
+ void PaintPageCount (
+ OutputDevice& rDevice,
+ const sal_Int32 nSelectionCount,
+ const Size aPreviewSize,
+ const Point aFirstPageOffset) const;
+ /** Setup the insertion indicator by creating the icon. It consists of
+ scaled down previews of some of the selected pages.
+ */
+ void Create (
+ const ::std::vector<controller::Transferable::Representative>& rPages,
+ const sal_Int32 nSelectionCount);
+};
+
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
index 9b1fd996e9c0..4d19e41e881b 100755..100644
--- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
@@ -28,18 +28,26 @@
#ifndef SD_SLIDESORTER_VIEW_LAYOUTER_HXX
#define SD_SLIDESORTER_VIEW_LAYOUTER_HXX
+#include "SlideSorter.hxx"
+#include "view/SlsPageObjectLayouter.hxx"
+#include "view/SlsTheme.hxx"
#include <sal/types.h>
#include <tools/fract.hxx>
#include <vcl/mapmod.hxx>
#include <vector>
#include <utility>
+
class MapMode;
class OutputDevice;
class Size;
namespace sd { namespace slidesorter { namespace view {
+class InsertPosition;
+
+
+
/** Calculate the size and position of page objects displayed by a slide
sorter. The layouter takes into account various input values:
1.) Size of the window in which the slide sorter is displayed.
@@ -66,9 +74,14 @@ namespace sd { namespace slidesorter { namespace view {
class Layouter
{
public:
- Layouter (void);
+ enum Orientation { HORIZONTAL, VERTICAL, GRID };
+
+ Layouter (
+ const SharedSdWindow& rpWindow,
+ const ::boost::shared_ptr<Theme>& rpTheme);
~Layouter (void);
+ ::boost::shared_ptr<PageObjectLayouter> GetPageObjectLayouter (void) const;
/** Set the horizontal and vertical borders in pixel coordinates between
the enclosing window and page objects. The borders may be painted
larger then the given values when the space for the insertion marker
@@ -89,23 +102,6 @@ public:
void SetBorders (sal_Int32 nLeftBorder, sal_Int32 nRightBorder,
sal_Int32 nTopBorder, sal_Int32 nBottomBorder);
- /** Set the borders arround every page object.
- @param nLeftBorder
- A negative value indicates that the left border shall not be
- modified. A value of 0 is the default.
- @param nRightBorder
- A negative value indicates that the left border shall not be
- modified. A value of 0 is the default.
- @param nTopBorder
- A negative value indicates that the left border shall not be
- modified. A value of 0 is the default.
- @param nBottomBorder
- A negative value indicates that the left border shall not be
- modified. A value of 0 is the default.
- */
- void SetPageBorders (sal_Int32 nLeftBorder, sal_Int32 nRightBorder,
- sal_Int32 nTopBorder, sal_Int32 nBottomBorder);
-
/** Set the interval of valid column counts. When nMinimalColumnCount
<= nMaximalColumnCount is not fullfilled then the call is ignored.
@param nMinimalColumnCount
@@ -120,37 +116,46 @@ public:
/** Central method of this class. It takes the input values and
calculates the output values. Both given sizes must not be 0 in any
dimension or the call is ignored.
+ @param eOrientation
+ This defines the generaly layout and specifies whether there may
+ be more than one row or more than one column.
@param rWindowSize
The size of the window in pixels that the slide sorter is
- displayed in.
- @param rPageObjectSize
+ displayed in. This can differ from the size of mpWindow during
+ detection of whether or not the scroll bars should be visible.
+ @param rPreviewModelSize
Size of each page in model coordinates.
- @param pDevice
- The map mode of this output device is adapted to the new layout
- of the page objects.
+ @param rpWindow
+ The map mode of this window is adapted to the new layout of the
+ page objects.
@return
The return value indicates whether the Get... methods can be
used to obtain valid values (<TRUE/>).
*/
- bool RearrangeHorizontal (
+ bool Rearrange (
+ const Orientation eOrientation,
const Size& rWindowSize,
- const Size& rPageObjectSize,
- OutputDevice* pDevice,
+ const Size& rPreviewModelSize,
const sal_uInt32 nPageCount);
- bool RearrangeVertical (
- const Size& rWindowSize,
- const Size& rPageObjectSize,
- OutputDevice* pDevice);
/** Change the zoom factor. This does not change the general layout
(number of columns).
*/
- void SetZoom (Fraction nZoomFactor, OutputDevice* pDevice);
+ void _SetZoom (double nZoomFactor);
+ void _SetZoom (Fraction nZoomFactor);
/** Return the number of columns.
*/
sal_Int32 GetColumnCount (void) const;
+ sal_Int32 GetRowCount (void) const;
+
+ sal_Int32 GetRow (const sal_Int32 nIndex) const;
+
+ sal_Int32 GetColumn (const sal_Int32 nIndex) const;
+
+ sal_Int32 GetIndex (const sal_Int32 nRow, const sal_Int32 nColumn) const;
+
/** Return the scale factor that can be set at the map mode of the
output window.
*/
@@ -158,52 +163,25 @@ public:
Size GetPageObjectSize (void) const;
- /** Return the bounding box in model coordinates of the nIndex-th page
+ /** Return the bounding box in window coordinates of the nIndex-th page
object.
*/
- Rectangle GetPageObjectBox (sal_Int32 nIndex) const;
+ Rectangle GetPageObjectBox (
+ const sal_Int32 nIndex,
+ const bool bIncludeBorderAndGap = false) const;
/** Return the bounding box in model coordinates of the page that
contains the given amount of page objects.
*/
- Rectangle GetPageBox (sal_Int32 nObjectCount) const;
-
- /** Return the rectangle that bounds the insertion marker that is
- specified by the parameters.
- @param nIndex
- Index of the page object from which the position of the marker
- will be calculated.
- @param bVertical
- When <TRUE/> then the insertion marker will be calculated with a
- vertical orientation positioned to the left or right of the
- specified page object. A horizontal orientation is indicated by
- <FALSE/>. In this case the marker will be positioned above or
- below the page object.
- @param bLeftOrTop
- This flag indicates whether the insertion marker will be
- positioned above or to the left (<TRUE/>) the page object. When
- <FALSE/> is given then the marker will be positioned below or to
- the right of the page object.
- */
- Rectangle GetInsertionMarkerBox (
- sal_Int32 nIndex,
- bool bVertical,
- bool bLeftOrTop) const;
+ Rectangle GetTotalBoundingBox (void) const;
/** Return the index of the first fully or partially visible page
object. This takes into account only the vertical dimension.
- */
- sal_Int32 GetIndexOfFirstVisiblePageObject (
- const Rectangle& rVisibleArea) const;
-
- /** Return the index of the last fully or partially visible page
- object. This takes into account only the vertical dimension.
@return
- The returned index may be larger than the number of existing
+ The second index may be larger than the number of existing
page objects.
*/
- sal_Int32 GetIndexOfLastVisiblePageObject (
- const Rectangle& rVisibleArea) const;
+ Range GetRangeOfVisiblePageObjects (const Rectangle& rVisibleArea) const;
/** Return the index of the page object that is rendered at the given
point.
@@ -216,167 +194,103 @@ public:
the actual page area the index of that page is returned;
otherwise -1 would be returned to indicate that no page object
has been hit.
+ @param bClampToValidRange
+ When <TRUE/> then values outside the valid range [0,mnPageCount)
+ are mapped to 0 (when smaller than 0) or mnPageCount-1 when
+ equal to or larger than mnPageCount.
+ When <FALSE/> then -1 is returned for values outside the valid range.
@return
The returned index may be larger than the number of existing
page objects.
*/
sal_Int32 GetIndexAtPoint (
const Point& rModelPosition,
- bool bIncludePageBorders = false) const;
-
- /** Return the page index of where to do an insert operation when the
- user would release the the mouse button at the given position after
- a drag operation.
- @param rPosition
+ const bool bIncludePageBorders = false,
+ const bool bClampToValidRange = true) const;
+
+ /** Return an object that describes the logical and visual properties of
+ where to do an insert operation when the user would release the the
+ mouse button at the given position after a drag operation and of
+ where and how to display an insertion indicator.
+ @param rModelPosition
The position in the model coordinate system for which to
determine the insertion page index. The position does not have
to be over a page object to return a valid value.
- @param bAllowVerticalPosition
- When this flag is <TRUE/> then the vertical gaps between rows
- may be taken into account for calculating the insertion index as
- well as the horizontal gaps between columns. This will happen
- only when there is only one column.
- (better name, anyone?)
- @return
- Returns the page index, as accepted by the slide sorter model,
- of the page after which an insertion would take place. An index
- of 0 means that insertion will take place before the first page,
- An index equal to or greater than the page count means to insert
- after the last page.
- A value of -1 indicates that no valid insertion index exists for
- the given point.
+ @param rIndicatorSize
+ The size of the insertion indicator. This size is used to adapt
+ the location when at the left or right of a row or at the top or
+ bottom of a column.
+ @param rModel
+ The model is used to get access to the selection states of the
+ pages. This in turn is used to determine the visual bounding
+ boxes.
*/
- sal_Int32 GetInsertionIndex (
+ InsertPosition GetInsertPosition (
const Point& rModelPosition,
- bool bAllowVerticalPosition) const;
+ const Size& rIndicatorSize,
+ model::SlideSorterModel& rModel) const;
+
+ Range GetValidHorizontalSizeRange (void) const;
+ Range GetValidVerticalSizeRange (void) const;
+
+ class Implementation;
+
+private:
+ ::boost::scoped_ptr<Implementation> mpImplementation;
+ SharedSdWindow mpWindow;
+};
- typedef ::std::pair<double,double> DoublePoint;
- /** Transform a point given in model coordinates in to layouter
- coordinates. Layouter coordinates are floating point numbers where
- the integer part denotes a row or a column and the part after the
- decimal point is a relative position in that row or column.
- */
- DoublePoint ConvertModelToLayouterCoordinates (
- const Point& rModelPoint) const;
- /** Transform a point given in layouter coordinates to model
- coordinates. See ConvertModelToLayouterCoordinates for a
- description of layouter coordinates.
- */
- Point ConvertLayouterToModelCoordinates (
- const DoublePoint&rLayouterPoint) const;
- typedef ::std::vector<Rectangle> BackgroundRectangleList;
+
+
+/** Collect all values concerning the logical and visual properties of the
+ insertion position that is used for drag-and-drop and copy-and-past.
+*/
+class InsertPosition
+{
+public:
+ InsertPosition (void);
+ InsertPosition& operator= (const InsertPosition& rInsertPosition);
+ bool operator== (const InsertPosition& rInsertPosition) const;
+ bool operator!= (const InsertPosition& rInsertPosition) const;
+
+ void SetLogicalPosition (
+ const sal_Int32 nRow,
+ const sal_Int32 nColumn,
+ const sal_Int32 nIndex,
+ const bool bIsAtRunStart,
+ const bool bIsAtRunEnd,
+ const bool bIsExtraSpaceNeeded);
+ void SetGeometricalPosition(
+ const Point aLocation,
+ const Point aLeadingOffset,
+ const Point aTrailingOffset);
+
+ sal_Int32 GetRow (void) const { return mnRow; }
+ sal_Int32 GetColumn (void) const { return mnColumn; }
+ sal_Int32 GetIndex (void) const { return mnIndex; }
+ Point GetLocation (void) const { return maLocation; }
+ Point GetLeadingOffset (void) const { return maLeadingOffset; }
+ Point GetTrailingOffset (void) const { return maTrailingOffset; }
+ bool IsAtRunStart (void) const { return mbIsAtRunStart; }
+ bool IsAtRunEnd (void) const { return mbIsAtRunEnd; }
+ bool IsExtraSpaceNeeded (void) const { return mbIsExtraSpaceNeeded; }
private:
- class ScreenAndModelValue {public:
- sal_Int32 mnScreen,mnModel;
- explicit ScreenAndModelValue (sal_Int32 nScreen, sal_Int32 nModel = 0)
- : mnScreen(nScreen),mnModel(nModel) {}
- };
- ScreenAndModelValue mnRequestedLeftBorder;
- ScreenAndModelValue mnRequestedRightBorder;
- ScreenAndModelValue mnRequestedTopBorder;
- ScreenAndModelValue mnRequestedBottomBorder;
- ScreenAndModelValue mnLeftBorder;
- ScreenAndModelValue mnRightBorder;
- ScreenAndModelValue mnTopBorder;
- ScreenAndModelValue mnBottomBorder;
- ScreenAndModelValue mnLeftPageBorder;
- ScreenAndModelValue mnRightPageBorder;
- ScreenAndModelValue mnTopPageBorder;
- ScreenAndModelValue mnBottomPageBorder;
- ScreenAndModelValue mnVerticalGap;
- ScreenAndModelValue mnHorizontalGap;
- ScreenAndModelValue mnInsertionMarkerThickness;
- ScreenAndModelValue mnTotalVerticalGap;
- ScreenAndModelValue mnTotalHorizontalGap;
- sal_Int32 mnMinimalWidth;
- sal_Int32 mnPreferredWidth;
- sal_Int32 mnMaximalWidth;
- sal_Int32 mnMinimalColumnCount;
- sal_Int32 mnMaximalColumnCount;
- sal_Int32 mnColumnCount;
- Size maPageObjectModelSize;
- Size maPageObjectPixelSize;
-
- BackgroundRectangleList maBackgroundRectangleList;
-
- enum GapMembership { GM_NONE, GM_PREVIOUS, GM_BOTH, GM_NEXT,
- GM_PAGE_BORDER};
-
- /** Calculate the row that the point with the given vertical coordinate
- is over. The horizontal component is ignored.
- @param nYPosition
- Vertical position in model coordinates.
- @param bIncludeBordersAndGaps
- When this flag is <TRUE/> then the area of borders and gaps are
- interpreted as belonging to one of the rows.
- @param eGapMembership
- Specifies to what row the gap areas belong. Here GM_NONE
- corresponds to bIncludeBordersAndGaps being <FALSE/>. When
- GM_BOTH is given then the upper half is associated to the row
- above and the lower half to the row below. Values of
- GM_PREVIOUS and GM_NEXT associate the whole gap area with the
- row above or below respectively.
- */
- sal_Int32 GetRowAtPosition (
- sal_Int32 nYPosition,
- bool bIncludeBordersAndGaps,
- GapMembership eGapMembership = GM_NONE) const;
-
- /** Calculate the column that the point with the given horizontal
- coordinate is over. The verical component is ignored.
- @param nXPosition
- Horizontal position in model coordinates.
- @param bIncludeBordersAndGaps
- When this flag is <TRUE/> then the area of borders and gaps are
- interpreted as belonging to one of the columns.
- @param eGapMembership
- Specifies to what column the gap areas belong. Here GM_NONE
- corresponds to bIncludeBordersAndGaps being <FALSE/>. When
- GM_BOTH is given then the left half is associated with the
- column at the left and the right half with the column to the
- right. Values of GM_PREVIOUS and GM_NEXT associate the whole
- gap area with the column to the left or right respectively.
- */
- sal_Int32 GetColumnAtPosition (
- sal_Int32 nXPosition,
- bool bIncludeBordersAndGaps,
- GapMembership eGapMembership = GM_NONE) const;
-
- /** This method is typically called from GetRowAtPosition() and
- GetColumnAtPosition() to handle a position that lies inside the gap
- between two adjacent rows or columns.
- @param nDistanceIntoGap
- Vertical distance from the bottom of the upper row down into the
- gap or or horizontal distance from the right edge right into the
- gap.
- @param eGapMemberhship
- This value decides what areas in the gap belong to which (or no)
- row or column.
- @param nIndex
- The row index of the upper row or the column index of the left
- column.
- @param nLeftOrTopPageBorder
- Width in model coordinates of the border the the right of or
- below a page.
- @param nGap
- Width or height of the gap in model coordiantes between the
- page borders.
- @return
- Returns either the index of the upper row (as given as nRow), the
- index of the lower row (nRow+1) or -1 to indicate that the
- position belongs to no row.
- */
- sal_Int32 ResolvePositionInGap (
- sal_Int32 nDistanceIntoGap,
- GapMembership eGapMembership,
- sal_Int32 nIndex,
- sal_Int32 nLeftOrTopPageBorder,
- sal_Int32 nGap) const;
+ sal_Int32 mnRow;
+ sal_Int32 mnColumn;
+ sal_Int32 mnIndex;
+ bool mbIsAtRunStart : 1;
+ bool mbIsAtRunEnd : 1;
+ bool mbIsExtraSpaceNeeded : 1;
+ Point maLocation;
+ Point maLeadingOffset;
+ Point maTrailingOffset;
};
+
+
} } } // end of namespace ::sd::slidesorter::view
#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
new file mode 100644
index 000000000000..8e61a8b1b47c
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_PAGE_OBJECT_LAYOUTER_HXX
+#define SD_SLIDESORTER_PAGE_OBJECT_LAYOUTER_HXX
+
+#include "SlideSorter.hxx"
+#include "model/SlsSharedPageDescriptor.hxx"
+#include "tools/gen.hxx"
+#include <vcl/image.hxx>
+
+namespace sd { namespace slidesorter { namespace view {
+
+
+/** In contrast to the Layouter that places page objects in the view, the
+ PageObjectLayouter places the parts of individual page objects like page
+ number area, borders, preview.
+*/
+class PageObjectLayouter
+{
+public:
+ /** Create a new PageObjectLayouter object.
+ @param rPageObjectSize
+ In general either the width or the height will be 0 in order to
+ signal that this size component has to be calculated from the other.
+ This calculation will make the preview as large as possible.
+ @param nPageCount
+ The page count is used to determine how wide the page number
+ area has to be, how many digits to except for the largest page number.
+ */
+ PageObjectLayouter(
+ const ::boost::shared_ptr<Theme>& rpTheme,
+ const Size& rPageObjectWindowSize,
+ const Size& rPreviewModelSize,
+ const SharedSdWindow& rpWindow,
+ const sal_Int32 nPageCount);
+ ~PageObjectLayouter(void);
+
+ enum Part {
+ // The focus indicator is painted outside the actual page object.
+ FocusIndicator,
+ // This is the outer bounding box that includes the preview, page
+ // number, title.
+ PageObject,
+ // Bounding box of the actual preview.
+ Preview,
+ // Bounding box of the mouse indicator indicator frame.
+ MouseOverIndicator,
+ // Bounding box of the page number.
+ PageNumber,
+ // Bounding box of the pane name.
+ Name,
+ // Indicator whether or not there is a slide transition associated
+ // with this slide.
+ TransitionEffectIndicator
+ };
+ /** Two coordinate systems are supported. They differ only in
+ translation not in scale. Both relate to pixel values in the window.
+ A position in the model coordinate system does not change when the window content is
+ scrolled up or down. In the window coordinate system (relative
+ to the top left point of the window)scrolling leads to different values.
+ */
+ enum CoordinateSystem {
+ WindowCoordinateSystem,
+ ModelCoordinateSystem
+ };
+
+ /** Return the bounding box of the page object or one of its graphical
+ parts.
+ @param rWindow
+ This device is used to translate between model and window
+ coordinates.
+ @param rpPageDescriptor
+ The page for which to calculate the bounding box. This may be
+ NULL. When it is NULL then a generic bounding box is calculated
+ for the location (0,0).
+ @param ePart
+ The part of the page object for which to return the bounding
+ box.
+ @param eCoodinateSystem
+ The bounding box can be returned in model and in pixel
+ (window) coordinates.
+ */
+ Rectangle GetBoundingBox (
+ const model::SharedPageDescriptor& rpPageDescriptor,
+ const Part ePart,
+ const CoordinateSystem eCoordinateSystem);
+ Rectangle GetBoundingBox (
+ const Point& rPageObjectLocation,
+ const Part ePart,
+ const CoordinateSystem eCoordinateSystem);
+ Size GetSize (
+ const Part ePart,
+ const CoordinateSystem eCoordinateSystem);
+
+ Image GetTransitionEffectIcon (void) const;
+
+private:
+ SharedSdWindow mpWindow;
+ Size maPageObjectSize;
+ double mnModelToWindowScale;
+ Rectangle maFocusIndicatorBoundingBox;
+ Rectangle maPageObjectBoundingBox;
+ Rectangle maPageNumberAreaBoundingBox;
+ Rectangle maPreviewBoundingBox;
+ Rectangle maTransitionEffectBoundingBox;
+ const Image maTransitionEffectIcon;
+ const ::boost::shared_ptr<Font> mpPageNumberFont;
+
+ Size GetPageNumberAreaSize (const int nPageCount);
+ Rectangle CalculatePreviewBoundingBox (
+ Size& rPageObjectSize,
+ const Size& rPreviewModelSize,
+ const sal_Int32 nPageNumberAreaWidth,
+ const sal_Int32 nFocusIndicatorWidth);
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
new file mode 100644
index 000000000000..e4e28a2e38b2
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_PAGE_OBJECT_PAINTER_HEADER
+#define SD_SLIDESORTER_PAGE_OBJECT_PAINTER_HEADER
+
+#include "SlideSorter.hxx"
+#include "model/SlsPageDescriptor.hxx"
+#include "view/SlsLayouter.hxx"
+#include "view/SlsTheme.hxx"
+#include <boost/scoped_ptr.hpp>
+
+namespace sd { namespace slidesorter { namespace cache {
+class PageCache;
+} } }
+
+namespace sd { namespace slidesorter { namespace view {
+
+class ButtonBar;
+class Layouter;
+class PageObjectLayouter;
+class FramePainter;
+
+class PageObjectPainter
+{
+public:
+ PageObjectPainter (const SlideSorter& rSlideSorter);
+ ~PageObjectPainter (void);
+
+ void PaintPageObject (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor);
+
+ void NotifyResize (const bool bForce = false);
+
+ /** Called when the theme changes, either because it is replaced with
+ another or because the system colors have changed. So, even when
+ the given theme is the same object as the one already in use by this
+ painter everything that depends on the theme is updated.
+ */
+ void SetTheme (const ::boost::shared_ptr<view::Theme>& rpTheme);
+
+ /** Return a preview bitmap for the given page descriptor. When the
+ page is excluded from the show then the preview is marked
+ accordingly.
+ @rpDescriptor
+ Defines the page for which to return the preview.
+ @pReferenceDevice
+ When not <NULL/> then this reference device is used to created a
+ compatible bitmap.
+ @return
+ The returned bitmap may have a different size then the preview area.
+ */
+ Bitmap GetPreviewBitmap (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const OutputDevice* pReferenceDevice) const;
+
+private:
+ const Layouter& mrLayouter;
+ ::boost::shared_ptr<PageObjectLayouter> mpPageObjectLayouter;
+ ::boost::shared_ptr<cache::PageCache> mpCache;
+ ::boost::shared_ptr<controller::Properties> mpProperties;
+ ::boost::shared_ptr<view::Theme> mpTheme;
+ ::boost::shared_ptr<Font> mpPageNumberFont;
+ ::boost::scoped_ptr<FramePainter> mpShadowPainter;
+ ::boost::scoped_ptr<FramePainter> mpFocusBorderPainter;
+ Bitmap maNormalBackground;
+ Bitmap maSelectionBackground;
+ Bitmap maFocusedSelectionBackground;
+ Bitmap maFocusedBackground;
+ Bitmap maMouseOverBackground;
+ Bitmap maMouseOverFocusedBackground;
+ Bitmap maMouseOverSelectedAndFocusedBackground;
+ ::rtl::OUString msUnhideString;
+ ButtonBar& mrButtonBar;
+
+ void PaintBackground (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor);
+ void PaintPreview (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor) const;
+ void PaintPageNumber (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor) const;
+ void PaintTransitionEffect (
+ OutputDevice& rDevice,
+ const model::SharedPageDescriptor& rpDescriptor) const;
+ void PaintBorder (
+ OutputDevice& rDevice,
+ const Theme::GradientColorType eColorType,
+ const Rectangle& rBox) const;
+ Bitmap& GetBackgroundForState (
+ const model::SharedPageDescriptor& rpDescriptor,
+ const OutputDevice& rTemplateDevice);
+ Bitmap& GetBackground(
+ Bitmap& rBackground,
+ Theme::GradientColorType eType,
+ const OutputDevice& rTemplateDevice,
+ const bool bHasFocusBorder);
+ Bitmap CreateBackgroundBitmap(
+ const OutputDevice& rReferenceDevice,
+ const Theme::GradientColorType eType,
+ const bool bHasFocusBorder) const;
+ Bitmap CreateMarkedPreview(
+ const Size& rSize,
+ const Bitmap& rPreview,
+ const BitmapEx& rOverlay,
+ const OutputDevice* pReferenceDevice) const;
+};
+
+} } } // end of namespace sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsResource.hrc b/sd/source/ui/slidesorter/inc/view/SlsResource.hrc
new file mode 100644
index 000000000000..2b85a37d35dc
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsResource.hrc
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_ICONS_HRC
+#define SD_SLIDESORTER_ICONS_HRC
+
+#include "glob.hrc"
+
+#define IMAGE_COMMAND1_LARGE 1
+#define IMAGE_COMMAND1_LARGE_HOVER 2
+#define IMAGE_COMMAND1_MEDIUM 3
+#define IMAGE_COMMAND1_MEDIUM_HOVER 4
+#define IMAGE_COMMAND1_SMALL 5
+#define IMAGE_COMMAND1_SMALL_HOVER 6
+
+#define IMAGE_COMMAND1_LARGE_HC 7
+#define IMAGE_COMMAND1_LARGE_HOVER_HC 8
+#define IMAGE_COMMAND1_MEDIUM_HC 9
+#define IMAGE_COMMAND1_MEDIUM_HOVER_HC 10
+#define IMAGE_COMMAND1_SMALL_HC 11
+#define IMAGE_COMMAND1_SMALL_HOVER_HC 12
+
+
+#define IMAGE_COMMAND2_LARGE 20
+#define IMAGE_COMMAND2_LARGE_HOVER 21
+#define IMAGE_COMMAND2_MEDIUM 22
+#define IMAGE_COMMAND2_MEDIUM_HOVER 23
+#define IMAGE_COMMAND2_SMALL 24
+#define IMAGE_COMMAND2_SMALL_HOVER 25
+
+#define IMAGE_COMMAND2_LARGE_HC 26
+#define IMAGE_COMMAND2_LARGE_HOVER_HC 27
+#define IMAGE_COMMAND2_MEDIUM_HC 28
+#define IMAGE_COMMAND2_MEDIUM_HOVER_HC 29
+#define IMAGE_COMMAND2_SMALL_HC 30
+#define IMAGE_COMMAND2_SMALL_HOVER_HC 31
+
+#define IMAGE_COMMAND2B_LARGE 40
+#define IMAGE_COMMAND2B_LARGE_HOVER 41
+#define IMAGE_COMMAND2B_MEDIUM 42
+#define IMAGE_COMMAND2B_MEDIUM_HOVER 43
+#define IMAGE_COMMAND2B_SMALL 44
+#define IMAGE_COMMAND2B_SMALL_HOVER 45
+
+#define IMAGE_COMMAND2B_LARGE_HC 46
+#define IMAGE_COMMAND2B_LARGE_HOVER_HC 47
+#define IMAGE_COMMAND2B_MEDIUM_HC 48
+#define IMAGE_COMMAND2B_MEDIUM_HOVER_HC 49
+#define IMAGE_COMMAND2B_SMALL_HC 50
+#define IMAGE_COMMAND2B_SMALL_HOVER_HC 51
+
+
+#define IMAGE_COMMAND3_LARGE 60
+#define IMAGE_COMMAND3_LARGE_HOVER 61
+#define IMAGE_COMMAND3_MEDIUM 62
+#define IMAGE_COMMAND3_MEDIUM_HOVER 63
+#define IMAGE_COMMAND3_SMALL 64
+#define IMAGE_COMMAND3_SMALL_HOVER 65
+
+#define IMAGE_COMMAND3_LARGE_HC 66
+#define IMAGE_COMMAND3_LARGE_HOVER_HC 67
+#define IMAGE_COMMAND3_MEDIUM_HC 68
+#define IMAGE_COMMAND3_MEDIUM_HOVER_HC 69
+#define IMAGE_COMMAND3_SMALL_HC 70
+#define IMAGE_COMMAND3_SMALL_HOVER_HC 71
+
+#define IMAGE_BUTTONBAR_LARGE 80
+#define IMAGE_BUTTONBAR_LARGE_HC 81
+#define IMAGE_BUTTONBAR_MEDIUM 82
+#define IMAGE_BUTTONBAR_MEDIUM_HC 83
+#define IMAGE_BUTTONBAR_SMALL 84
+#define IMAGE_BUTTONBAR_SMALL_HC 85
+
+#define IMAGE_SHADOW 90
+#define IMAGE_INSERT_SHADOW 91
+#define IMAGE_HIDE_SLIDE_OVERLAY 92
+#define IMAGE_FOCUS_BORDER 93
+
+#define STRING_DRAG_AND_DROP_PAGES 101
+#define STRING_DRAG_AND_DROP_SLIDES 102
+
+#define STRING_COMMAND1 110
+#define STRING_COMMAND2_A 111
+#define STRING_COMMAND2_B 112
+#define STRING_COMMAND3 113
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
new file mode 100644
index 000000000000..2b39e6d2a3ee
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VIEW_THEME_HXX
+#define SD_SLIDESORTER_VIEW_THEME_HXX
+
+#include "model/SlsVisualState.hxx"
+
+#include <vcl/bitmapex.hxx>
+#include <vcl/font.hxx>
+#include <vcl/gradient.hxx>
+#include <tools/color.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+
+
+namespace sd { namespace slidesorter { namespace controller {
+class Properties;
+} } }
+
+namespace sd { namespace slidesorter { namespace view {
+
+
+/** Collection of colors and styles that are used to paint the slide sorter
+ view.
+*/
+class Theme
+{
+public:
+ Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties);
+
+ /** Call this method to update some colors as response to a change of
+ a system color change.
+ */
+ void Update (
+ const ::boost::shared_ptr<controller::Properties>& rpProperties);
+
+ // BitmapEx GetInsertIndicatorIcon (void) const;
+
+ enum FontType {
+ Font_PageNumber,
+ Font_PageCount,
+ Font_Button
+ };
+ static ::boost::shared_ptr<Font> GetFont (
+ const FontType eType,
+ const OutputDevice& rDevice);
+
+ enum ColorType {
+ Color_Background,
+ Color_ButtonBackground,
+ Color_ButtonText,
+ Color_ButtonTextHover,
+ Color_PageNumberDefault,
+ Color_PageNumberHover,
+ Color_PageNumberHighContrast,
+ Color_PageNumberBrightBackground,
+ Color_PageNumberDarkBackground,
+ Color_Selection,
+ Color_PreviewBorder,
+ Color_PageCountFontColor,
+ _ColorType_Size_
+ };
+ ColorData GetColor (const ColorType eType);
+ void SetColor (const ColorType eType, const ColorData aColorData);
+
+ enum GradientColorType {
+ Gradient_NormalPage,
+ Gradient_SelectedPage,
+ Gradient_SelectedAndFocusedPage,
+ Gradient_MouseOverPage,
+ Gradient_MouseOverSelectedAndFocusedPage,
+ Gradient_FocusedPage,
+ Gradient_ButtonBackground,
+ _GradientColorType_Size_
+ };
+ enum GradientColorClass {
+ Border1,
+ Border2,
+ Fill1,
+ Fill2,
+ Base
+ };
+ ColorData GetGradientColor (
+ const GradientColorType eType,
+ const GradientColorClass eClass);
+ sal_Int32 GetGradientOffset (
+ const GradientColorType eType,
+ const GradientColorClass eClass);
+ void SetGradient (
+ const GradientColorType eType,
+ const ColorData aBaseColor,
+ const sal_Int32 nSaturationOverride,
+ const sal_Int32 nBrightnessOverride,
+ const sal_Int32 nFillStartOffset,
+ const sal_Int32 nFillEndOffset,
+ const sal_Int32 nBorderStartOffset,
+ const sal_Int32 nBorderEndOffset);
+ sal_Int32 GetGradientSaturationOverride (const GradientColorType eType);
+ sal_Int32 GetGradientBrightnessOverride (const GradientColorType eType);
+ void SetGradientSaturationOverride (const GradientColorType eType, const sal_Int32 nValue);
+ void SetGradientBrightnessOverride (const GradientColorType eType, const sal_Int32 nValue);
+
+ enum IconType
+ {
+ Icon_RawShadow,
+ Icon_RawInsertShadow,
+ Icon_HideSlideOverlay,
+ Icon_FocusBorder,
+ Icon_ButtonBarLarge,
+ Icon_ButtonBarMedium,
+ Icon_ButtonBarSmall,
+ Icon_Command1Large,
+ Icon_Command1LargeHover,
+ Icon_Command1Medium,
+ Icon_Command1MediumHover,
+ Icon_Command1Small,
+ Icon_Command1SmallHover,
+ Icon_Command2Large,
+ Icon_Command2LargeHover,
+ Icon_Command2Medium,
+ Icon_Command2MediumHover,
+ Icon_Command2Small,
+ Icon_Command2SmallHover,
+ Icon_Command2BLarge,
+ Icon_Command2BLargeHover,
+ Icon_Command2BMedium,
+ Icon_Command2BMediumHover,
+ Icon_Command2BSmall,
+ Icon_Command2BSmallHover,
+ Icon_Command3Large,
+ Icon_Command3LargeHover,
+ Icon_Command3Medium,
+ Icon_Command3MediumHover,
+ Icon_Command3Small,
+ Icon_Command3SmallHover,
+ _IconType_Size_
+ };
+ const BitmapEx& GetIcon (const IconType eType);
+
+ enum IntegerValueType
+ {
+ Integer_ButtonCornerRadius,
+ Integer_ButtonMaxAlpha,
+ Integer_ButtonBarMaxAlpha,
+ Integer_ButtonPaintType,
+ Integer_ButtonBorder,
+ Integer_ButtonGap,
+ Integer_ButtonFadeInDelay,
+ Integer_ButtonFadeInDuration,
+ Integer_ButtonFadeOutDelay,
+ Integer_ButtonFadeOutDuration,
+ Integer_ToolTipDelay,
+ Integer_FocusIndicatorWidth,
+ _IntegerValueType_Size_
+ };
+ sal_Int32 GetIntegerValue (const IntegerValueType eType) const;
+ void SetIntegerValue (const IntegerValueType eType, const sal_Int32 nValue);
+
+ enum StringType
+ {
+ String_Unhide,
+ String_DragAndDropPages,
+ String_DragAndDropSlides,
+ String_Command1,
+ String_Command2,
+ String_Command2B,
+ String_Command3,
+ _StringType_Size_
+ };
+ ::rtl::OUString GetString (const StringType eType) const;
+
+private:
+ bool mbIsHighContrastMode;
+ class GradientDescriptor
+ {
+ public:
+ ColorData maBaseColor;
+
+ sal_Int32 mnSaturationOverride;
+ sal_Int32 mnBrightnessOverride;
+
+ ColorData maFillColor1;
+ ColorData maFillColor2;
+ ColorData maBorderColor1;
+ ColorData maBorderColor2;
+
+ sal_Int32 mnFillOffset1;
+ sal_Int32 mnFillOffset2;
+ sal_Int32 mnBorderOffset1;
+ sal_Int32 mnBorderOffset2;
+ };
+ ColorData maBackgroundColor;
+ ColorData maPageBackgroundColor;
+ ::std::vector<GradientDescriptor> maGradients;
+ ::std::vector<BitmapEx> maIcons;
+ ::std::vector<ColorData> maColor;
+ ::std::vector<sal_Int32> maIntegerValues;
+ ::std::vector<rtl::OUString> maStrings;
+
+ GradientDescriptor& GetGradient (const GradientColorType eType);
+ /** Guarded initialization of the specified icon in the maIcons
+ container. Call only while a LocalResource object is active.
+ */
+ void InitializeIcon (const IconType eType, USHORT nResourceId);
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx b/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx
new file mode 100644
index 000000000000..b633b1f3f5ca
--- /dev/null
+++ b/sd/source/ui/slidesorter/inc/view/SlsToolTip.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_SLIDESORTER_VIEW_TOOL_TIP_HXX
+#define SD_SLIDESORTER_VIEW_TOOL_TIP_HXX
+
+#include "SlideSorter.hxx"
+#include "model/SlsSharedPageDescriptor.hxx"
+
+namespace sd { namespace slidesorter { namespace view {
+
+/** Manage the display of tool tips. The tool tip text changes when the
+ mouse is moved from slide to slide or from button to button.
+ After the mouse enters a slide the first display of the tool tip is
+ delayed for a short time in order to not draw attention from the slide
+ or its button bar.
+*/
+class ToolTip
+{
+public:
+ ToolTip (SlideSorter& rSlideSorter);
+ ~ToolTip (void);
+
+ /** Set a new page. This modifies the default help text. After a page
+ change a timer is started to delay the display of the tool tip for
+ the new page.
+ @param rpPage
+ When this is empty then the tool tip is hidden.
+ */
+ void SetPage (const model::SharedPageDescriptor& rpPage);
+
+ /** Set and show the default help text.
+ */
+ void ShowDefaultHelpText (const ::rtl::OUString& rsHelpText);
+
+ /** Show a previously set default help text.
+ */
+ void ShowDefaultHelpText (void);
+
+ /** Show a temporary help text.
+ */
+ void ShowHelpText (const ::rtl::OUString& rsHelpText);
+
+ /** Hide the tool tip.
+ @return
+ Returns whether the tool tip was visible at the time this method
+ was called.
+ */
+ bool Hide (void);
+
+private:
+ SlideSorter& mrSlideSorter;
+ model::SharedPageDescriptor mpDescriptor;
+ ::rtl::OUString msDefaultHelpText;
+ ::rtl::OUString msCurrentHelpText;
+ ULONG mnHelpWindowHandle;
+ Timer maTimer;
+
+ /** Request to show the tool tip.
+ @param bForce
+ When <TRUE/> then the tool tip is show right away. Otherwise it
+ is shown after a short delay.
+ */
+ void Show (const bool bForce);
+ void DoShow (void);
+
+ DECL_LINK(DelayTrigger, void*);
+};
+
+
+} } } // end of namespace ::sd::slidesorter::view
+
+#endif
diff --git a/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx b/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx
deleted file mode 100644
index 4ff076f72560..000000000000
--- a/sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SD_SLIDESORTER_VIEW_OVERLAY_HXX
-#define SD_SLIDESORTER_VIEW_OVERLAY_HXX
-
-#include "model/SlsSharedPageDescriptor.hxx"
-
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <osl/mutex.hxx>
-#include <svx/sdr/overlay/overlayobject.hxx>
-#include <tools/gen.hxx>
-#include <vector>
-#include <boost/weak_ptr.hpp>
-#include <boost/noncopyable.hpp>
-
-class OutputDevice;
-class Region;
-
-
-namespace sd { namespace slidesorter {
-class SlideSorter;
-} }
-
-namespace sd { namespace slidesorter { namespace model {
-class PageEnumeration;
-} } }
-
-namespace sd { namespace slidesorter { namespace controller {
-class SlideSorterController;
-} } }
-
-namespace sdr { namespace overlay {
-class OverlayManager;
-} }
-
-namespace sd { namespace slidesorter { namespace view {
-
-
-class InsertionIndicatorOverlay;
-class PageObjectViewObjectContact;
-class SelectionRectangleOverlay;
-class SubstitutionOverlay;
-class ViewOverlay;
-
-/** This base class of slide sorter overlays uses the drawing layer overlay
- support for the display.
-*/
-class OverlayBase
- : public sdr::overlay::OverlayObject
-{
-public:
- OverlayBase (ViewOverlay& rViewOverlay);
- virtual ~OverlayBase (void);
-
-protected:
- ::osl::Mutex maMutex;
-
- ViewOverlay& mrViewOverlay;
-
- /** Make sure that the overlay object is registered at the
- OverlayManager. This registration is done on demand.
- */
- void EnsureRegistration (void);
- void RemoveRegistration();
-};
-
-
-
-
-/** During internal drag and drop the outlines of the selected slides are
- painted at the mouse position in dashed lines.
-*/
-class SubstitutionOverlay
- : public OverlayBase
-{
-public:
- SubstitutionOverlay (ViewOverlay& rViewOverlay);
- virtual ~SubstitutionOverlay (void);
-
- /** Setup the substitution display of the given set of selected pages.
- The given mouse position is remembered so that it later can be
- returned by GetPosition(). This is a convenience feature.
- */
- void Create (
- model::PageEnumeration& rSelection,
- const Point& rPosition);
-
- /** Clear the substitution display. Until the next call of Create() no
- substution is painted.
- */
- void Clear (void);
-
- /** Move the substitution display by the given amount of pixels.
- */
- void Move (const Point& rOffset);
- void SetPosition (const Point& rPosition);
- Point GetPosition (void) const;
-
- // react on stripe definition change
- virtual void stripeDefinitionHasChanged();
-
-protected:
- // geometry creation for OverlayObject
- virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
-
-private:
- Point maPosition;
- basegfx::B2DPolyPolygon maShapes;
-};
-
-
-
-
-/** Slides can be selected by drawing a selection rectangle in the slide
- sorter. When the left mouse button is released all slides that are at
- least partially in the rectangle are selected.
-*/
-class SelectionRectangleOverlay
- : public OverlayBase
-{
-public:
- SelectionRectangleOverlay (ViewOverlay& rViewOverlay);
- virtual ~SelectionRectangleOverlay();
-
- void Start (const Point& rAnchor);
- void Update (const Point& rSecondCorner);
-
- Rectangle GetSelectionRectangle (void);
-
- // react on stripe definition change
- virtual void stripeDefinitionHasChanged();
-
-protected:
- // geometry creation for OverlayObject
- virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
-
-private:
- Point maAnchor;
- Point maSecondCorner;
-};
-
-
-
-
-/** The insertion indicator is painted as a vertical or horizonal bar
- in the space between slides.
-*/
-class InsertionIndicatorOverlay
- : public OverlayBase
-{
-public:
- InsertionIndicatorOverlay (ViewOverlay& rViewOverlay);
- virtual ~InsertionIndicatorOverlay();
-
- /** Given a position in model coordinates this method calculates the
- insertion marker both as an index in the document and as a rectangle
- used for drawing the insertion indicator.
- */
- void SetPosition (const Point& rPosition);
-
- sal_Int32 GetInsertionPageIndex (void) const;
-
-protected:
- // geometry creation for OverlayObject
- virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
-
-private:
- sal_Int32 mnInsertionIndex;
- Rectangle maBoundingBox;
-
- void SetPositionAndSize (const Rectangle& rBoundingBox);
-};
-
-
-
-
-/** Paint a frame around the slide preview under the mouse. The actual
- painting is done by the PageObjectViewObjectContact of the slidesorter.
-*/
-class MouseOverIndicatorOverlay
- : public OverlayBase
-{
-public:
- MouseOverIndicatorOverlay (ViewOverlay& rViewOverlay);
- virtual ~MouseOverIndicatorOverlay (void);
-
- /** Set the page object for which to paint a mouse over indicator.
- @param pContact
- A value of <NULL/> indicates to not paint the mouse over indicator.
- */
- void SetSlideUnderMouse (const model::SharedPageDescriptor& rpDescriptor);
-
-protected:
- // geometry creation for OverlayObject
- virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
-
-private:
- /** The page under the mouse is stored as weak shared pointer so that
- model changes can be handled without having the SlideSorterModel
- inform this class explicitly.
- */
- ::boost::weak_ptr<model::PageDescriptor> mpPageUnderMouse;
-
- view::PageObjectViewObjectContact* GetViewObjectContact (void) const;
-};
-
-
-
-
-/** The view overlay manages and paints some indicators that are painted on
- top of the regular view content (the page objects). It is separated
- from the view to allow the indicators to be altered in position and size
- without repainting the whole view content (inside that the bounding box
- of the indicator). This is achieved by using the drawing layer overlay
- support.
-
- The view overlay itself simply gives access to the more specialized
- classes that handle individual indicators.
-
-*/
-class ViewOverlay
-{
-public:
- ViewOverlay (SlideSorter& rSlideSorter);
- ~ViewOverlay (void);
-
- SelectionRectangleOverlay& GetSelectionRectangleOverlay (void);
- MouseOverIndicatorOverlay& GetMouseOverIndicatorOverlay (void);
- InsertionIndicatorOverlay& GetInsertionIndicatorOverlay (void);
- SubstitutionOverlay& GetSubstitutionOverlay (void);
-
- SlideSorter& GetSlideSorter (void) const;
-
- sdr::overlay::OverlayManager* GetOverlayManager (void) const;
-
-private:
- SlideSorter& mrSlideSorter;
- SelectionRectangleOverlay maSelectionRectangleOverlay;
- MouseOverIndicatorOverlay maMouseOverIndicatorOverlay;
- InsertionIndicatorOverlay maInsertionIndicatorOverlay;
- SubstitutionOverlay maSubstitutionOverlay;
-};
-
-
-
-} } } // end of namespace ::sd::slidesorter::view
-
-#endif