diff options
author | Andre Fischer <af@openoffice.org> | 2010-03-10 17:33:53 +0100 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2010-03-10 17:33:53 +0100 |
commit | 538a067d216e87d2f01b144eb7e711ce0dca93b4 (patch) | |
tree | b85261e032edfeee4bb332ee7808241ccc1d270f /sd/source/ui/slidesorter/inc/view | |
parent | 9c1e4f81d79eb618e1f9b088ec08faffd539e81f (diff) |
renaissance1: #i107215# Improved calculation of insertion indicator, excluded pages.
Diffstat (limited to 'sd/source/ui/slidesorter/inc/view')
4 files changed, 53 insertions, 18 deletions
diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index a6b1a389e5e4..14ee98ffd693 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -106,7 +106,6 @@ public: given position. */ sal_Int32 GetPageIndexAtPoint (const Point& rPosition) const; - sal_Int32 GetFadePageIndexAtPoint (const Point& rPosition) const; view::Layouter& GetLayouter (void); @@ -193,14 +192,18 @@ public: void UpdatePageUnderMouse ( const Point& rMousePosition, - const bool bIsMouseButtonDown); - void SetPageUnderMouse (const model::SharedPageDescriptor& rpDescriptor); + const bool bIsMouseButtonDown, + const bool bAnimate = true); + void SetPageUnderMouse ( + const model::SharedPageDescriptor& rpDescriptor, + const bool bAnimate = true); void SetButtonUnderMouse (const sal_Int32 nButtonIndex); bool SetState ( const model::SharedPageDescriptor& rpDescriptor, const model::PageDescriptor::State eState, - const bool bStateValue); + const bool bStateValue, + const bool bAnimate = true); ::boost::shared_ptr<PageObjectPainter> GetPageObjectPainter (void); ::boost::shared_ptr<LayeredDevice> GetLayeredDevice (void) const; @@ -211,6 +214,10 @@ 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; diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx index 228da649c3eb..12bc67aa5e4b 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx @@ -39,6 +39,7 @@ #include <vector> #include <utility> + class MapMode; class OutputDevice; class Size; @@ -228,7 +229,7 @@ public: 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 rPosition + @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. @@ -236,10 +237,15 @@ public: 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. */ InsertPosition GetInsertPosition ( const Point& rModelPosition, - const Size& rIndicatorSize) const; + const Size& rIndicatorSize, + model::SlideSorterModel& rModel) const; /** Return whether the main orientation of the slides in the slide sorter is vertical, i.e. all slides are arranged in one column. @@ -349,7 +355,30 @@ private: sal_Int32 nIndex, sal_Int32 nGap) const; - Rectangle GetPreviewBox (const sal_Int32 nIndex) const; + /** Calculate the logical part of the insert position, i.e. the page + after whicht to insert. + */ + void CalculateLogicalInsertPosition ( + const Point& rModelPosition, + InsertPosition& rPosition) const; + + /** Calculate the geometrical part of the insert position, i.e. the + location of where to display the insertion indicator and the + distances about which the leading and trailing pages have to be + moved to make room for the indicator. + */ + void CalculateGeometricPosition ( + InsertPosition& rPosition, + const Size& rIndicatorSize, + const bool bIsVertical, + model::SlideSorterModel& rModel) const; + + /** Return the bounding box of the preview or, when selected, of the page + object. Thus, it returns something like a visual bounding box. + */ + Rectangle GetInnerBoundingBox ( + model::SlideSorterModel& rModel, + const sal_Int32 nIndex) const; }; @@ -370,6 +399,8 @@ public: 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; } @@ -379,6 +410,8 @@ private: sal_Int32 mnColumn; sal_Int32 mnIndex; Point maLocation; + Point maLeadingOffset; + Point maTrailingOffset; bool mbIsAtRunStart : 1; bool mbIsAtRunEnd : 1; bool mbIsExtraSpaceNeeded : 1; diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx index 46f3881fe6da..99ceee121b42 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx @@ -85,20 +85,13 @@ public: }; /** 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 window coordinate system does not change when the window content is - scrolled up or down. In the screen coordinate system (relative + 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. - Example: Scroll up the point (0,0) in the the window coordinate - system by 20 pixels. It lies not inside the visible area of the - window anymore. Its screen coordinates are now (-20,0). - - WindowCoordinateSystem corresponds to the logic coordinate system of - class Window, while ScreenCoordinateSystem corresponds to its pixel - coordinate system. */ enum CoordinateSystem { WindowCoordinateSystem, - ScreenCoordinateSystem}; + ModelCoordinateSystem}; /** Return the bounding box of the page object or one of its graphical parts. diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx index 83f1d75f5126..5b7241aaadc2 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx @@ -106,7 +106,8 @@ public: enum IconType { RawShadow, - RawInsertShadow + RawInsertShadow, + HideSlideOverlay }; BitmapEx GetIcon (const IconType eType); @@ -127,6 +128,7 @@ private: GradientDescriptor maMouseOverGradient; BitmapEx maRawShadow; BitmapEx maRawInsertShadow; + BitmapEx maHideSlideOverlay; }; |