LibreOffice Module sd (master) 1
|
Base class of horizontal and vertical scroll bars. More...
#include <PresenterScrollBar.hxx>
Classes | |
class | MousePressRepeater |
Public Types | |
enum | Area { Total , Pager , Thumb , PagerUp , PagerDown , PrevButton , NextButton , None , AreaCount = None } |
Public Member Functions | |
virtual | ~PresenterScrollBar () override |
PresenterScrollBar (const PresenterScrollBar &)=delete | |
PresenterScrollBar & | operator= (const PresenterScrollBar &)=delete |
virtual void SAL_CALL | disposing () override |
css::uno::Reference< css::uno::XComponentContext > const & | GetComponentContext () const |
void | SetVisible (const bool bIsVisible) |
void | SetPosSize (const css::geometry::RealRectangle2D &rBox) |
Set the bounding box of the scroll bar. More... | |
void | SetThumbPosition (double nPosition, const bool bAsynchronousRepaint) |
Set the position of the movable thumb. More... | |
double | GetThumbPosition () const |
void | SetTotalSize (const double nTotalSize) |
Set the upper border of the slider range. More... | |
void | SetThumbSize (const double nThumbSize) |
Set the size of the movable thumb. More... | |
double | GetThumbSize () const |
void | SetLineHeight (const double nLineHeight) |
double | GetLineHeight () const |
void | SetCanvas (const css::uno::Reference< css::rendering::XCanvas > &rxCanvas) |
Set the canvas that is used for painting the scroll bar. More... | |
void | SetBackground (const SharedBitmapDescriptor &rpBackgroundBitmap) |
void | CheckValues () |
Call this after changing total size or thumb position or size to move the thumb to a valid position. More... | |
void | Paint (const css::awt::Rectangle &rUpdateBox) |
On some occasions it is necessary to trigger the painting of a scrollbar from the outside. More... | |
virtual sal_Int32 | GetSize () const =0 |
virtual void SAL_CALL | windowResized (const css::awt::WindowEvent &rEvent) override |
virtual void SAL_CALL | windowMoved (const css::awt::WindowEvent &rEvent) override |
virtual void SAL_CALL | windowShown (const css::lang::EventObject &rEvent) override |
virtual void SAL_CALL | windowHidden (const css::lang::EventObject &rEvent) override |
virtual void SAL_CALL | windowPaint (const css::awt::PaintEvent &rEvent) override |
virtual void SAL_CALL | mousePressed (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | mouseReleased (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | mouseEntered (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | mouseExited (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | mouseMoved (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | mouseDragged (const css::awt::MouseEvent &rEvent) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &rEvent) override |
Protected Member Functions | |
css::geometry::RealRectangle2D const & | GetRectangle (const Area eArea) const |
virtual double | GetDragDistance (const sal_Int32 nX, const sal_Int32 nY) const =0 |
virtual void | UpdateDragAnchor (const double nDragDistance)=0 |
virtual double | GetMinor (const double nX, const double nY) const =0 |
virtual void | UpdateBorders ()=0 |
virtual void | UpdateBitmaps ()=0 |
virtual void | PaintComposite (const css::awt::Rectangle &rRepaintBox, const Area eArea, const SharedBitmapDescriptor &rpStartBitmaps, const SharedBitmapDescriptor &rpCenterBitmaps, const SharedBitmapDescriptor &rpEndBitmaps)=0 |
PresenterScrollBar (const css::uno::Reference< css::uno::XComponentContext > &rxComponentContext, const css::uno::Reference< css::awt::XWindow > &rxParentWindow, std::shared_ptr< PresenterPaintManager > xPaintManager, ::std::function< void(double)> aThumbMotionListener) | |
void | Repaint (const css::geometry::RealRectangle2D &rBox, const bool bAsynchronous) |
void | PaintBackground (const css::awt::Rectangle &rRepaintBox) |
void | PaintBitmap (const css::awt::Rectangle &rRepaintBox, const Area eArea, const SharedBitmapDescriptor &rpBitmaps) |
void | UpdateWidthOrHeight (sal_Int32 &rSize, const SharedBitmapDescriptor &rpDescriptor) |
css::uno::Reference< css::rendering::XBitmap > | GetBitmap (const Area eArea, const SharedBitmapDescriptor &rpBitmaps) const |
PresenterBitmapContainer::BitmapDescriptor::Mode | GetBitmapMode (const Area eArea) const |
bool | IsDisabled (const Area eArea) const |
double | ValidateThumbPosition (double nPosition) |
Static Protected Attributes | |
static std::weak_ptr< PresenterBitmapContainer > | mpSharedBitmaps |
Private Member Functions | |
Area | GetArea (const double nX, const double nY) const |
Private Attributes | |
std::shared_ptr< MousePressRepeater > | mpMousePressRepeater |
SharedBitmapDescriptor | mpBackgroundBitmap |
std::unique_ptr< PresenterCanvasHelper > | mpCanvasHelper |
![]() | |
mutable::osl::Mutex | m_aMutex |
Base class of horizontal and vertical scroll bars.
Definition at line 48 of file PresenterScrollBar.hxx.
Enumerator | |
---|---|
Total | |
Pager | |
Thumb | |
PagerUp | |
PagerDown | |
PrevButton | |
NextButton | |
None | |
AreaCount |
Definition at line 145 of file PresenterScrollBar.hxx.
|
overridevirtual |
Definition at line 123 of file PresenterScrollBar.cxx.
|
delete |
|
protected |
void sdext::presenter::PresenterScrollBar::CheckValues | ( | ) |
Call this after changing total size or thumb position or size to move the thumb to a valid position.
Definition at line 261 of file PresenterScrollBar.cxx.
References mnThumbPosition, and ValidateThumbPosition().
|
overridevirtual |
Definition at line 127 of file PresenterScrollBar.cxx.
References mpBitmaps, mpMousePressRepeater, and mxWindow.
|
overridevirtual |
Definition at line 403 of file PresenterScrollBar.cxx.
References mxWindow.
|
private |
Definition at line 486 of file PresenterScrollBar.cxx.
References GetRectangle(), sdext::presenter::PresenterGeometryHelper::IsInside(), NextButton, None, Pager, PagerDown, PagerUp, PrevButton, and Thumb.
Referenced by mouseMoved(), and mousePressed().
|
protected |
Definition at line 524 of file PresenterScrollBar.cxx.
References GetBitmapMode().
Referenced by PaintBitmap(), and sdext::presenter::PresenterVerticalScrollBar::PaintComposite().
|
protected |
Definition at line 534 of file PresenterScrollBar.cxx.
References sdext::presenter::PresenterBitmapContainer::BitmapDescriptor::Disabled, IsDisabled(), meMouseMoveArea, sdext::presenter::PresenterBitmapContainer::BitmapDescriptor::MouseOver, and sdext::presenter::PresenterBitmapContainer::BitmapDescriptor::Normal.
Referenced by GetBitmap().
|
inline |
Definition at line 60 of file PresenterScrollBar.hxx.
References mxComponentContext.
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by mouseDragged().
|
inline |
Definition at line 91 of file PresenterScrollBar.hxx.
References mnLineHeight.
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by UpdateWidthOrHeight().
|
protected |
Definition at line 410 of file PresenterScrollBar.cxx.
References AreaCount, and maBox.
Referenced by GetArea(), mouseExited(), mouseMoved(), PaintBitmap(), sdext::presenter::PresenterVerticalScrollBar::PaintComposite(), SetCanvas(), SetThumbPosition(), SetThumbSize(), and SetTotalSize().
|
pure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
|
inline |
Definition at line 77 of file PresenterScrollBar.hxx.
References mnThumbPosition.
|
inline |
Definition at line 88 of file PresenterScrollBar.hxx.
References mnThumbSize.
|
protected |
Definition at line 545 of file PresenterScrollBar.cxx.
References AreaCount, and maEnabledState.
Referenced by GetBitmapMode().
|
overridevirtual |
Definition at line 383 of file PresenterScrollBar.cxx.
References GetDragDistance(), meButtonDownArea, mnThumbPosition, mpMousePressRepeater, mxPresenterHelper, mxWindow, SetThumbPosition(), Thumb, and UpdateDragAnchor().
|
overridevirtual |
Definition at line 350 of file PresenterScrollBar.cxx.
|
overridevirtual |
Definition at line 352 of file PresenterScrollBar.cxx.
References GetRectangle(), meButtonDownArea, meMouseMoveArea, mpMousePressRepeater, None, and Repaint().
|
overridevirtual |
Definition at line 368 of file PresenterScrollBar.cxx.
References GetArea(), GetRectangle(), meMouseMoveArea, mpMousePressRepeater, None, and Repaint().
|
overridevirtual |
Definition at line 333 of file PresenterScrollBar.cxx.
References GetArea(), maDragAnchor, meButtonDownArea, and mpMousePressRepeater.
|
overridevirtual |
Definition at line 342 of file PresenterScrollBar.cxx.
References mpMousePressRepeater, mxPresenterHelper, and mxWindow.
|
delete |
void sdext::presenter::PresenterScrollBar::Paint | ( | const css::awt::Rectangle & | rUpdateBox | ) |
On some occasions it is necessary to trigger the painting of a scrollbar from the outside.
Definition at line 275 of file PresenterScrollBar.cxx.
References sdext::presenter::PresenterGeometryHelper::AreRectanglesDisjoint(), mpNextButtonDescriptor, mpPagerCenterDescriptor, mpPagerEndDescriptor, mpPagerStartDescriptor, mpPrevButtonDescriptor, mpThumbCenterDescriptor, mpThumbEndDescriptor, mpThumbStartDescriptor, mxCanvas, mxWindow, NextButton, PagerDown, PagerUp, PaintBackground(), PaintBitmap(), PaintComposite(), PrevButton, and Thumb.
Referenced by windowPaint().
|
protected |
Definition at line 428 of file PresenterScrollBar.cxx.
References mpBackgroundBitmap, mpCanvasHelper, mxCanvas, and mxWindow.
Referenced by Paint().
|
protected |
Definition at line 443 of file PresenterScrollBar.cxx.
References sdext::presenter::PresenterGeometryHelper::ConvertRectangle(), sdext::presenter::PresenterGeometryHelper::CreatePolygon(), GetBitmap(), GetRectangle(), sdext::presenter::PresenterGeometryHelper::Intersection(), mxCanvas, and mxWindow.
Referenced by Paint().
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by Paint().
|
protected |
Definition at line 417 of file PresenterScrollBar.cxx.
References sdext::presenter::PresenterGeometryHelper::ConvertRectangle(), mpPaintManager, and mxWindow.
Referenced by mouseExited(), mouseMoved(), SetCanvas(), SetThumbPosition(), SetThumbSize(), and SetTotalSize().
void sdext::presenter::PresenterScrollBar::SetBackground | ( | const SharedBitmapDescriptor & | rpBackgroundBitmap | ) |
Definition at line 256 of file PresenterScrollBar.cxx.
References mpBackgroundBitmap.
void sdext::presenter::PresenterScrollBar::SetCanvas | ( | const css::uno::Reference< css::rendering::XCanvas > & | rxCanvas | ) |
Set the canvas that is used for painting the scroll bar.
Definition at line 221 of file PresenterScrollBar.cxx.
References Exception, GetRectangle(), mpBitmaps, mpSharedBitmaps, mxCanvas, mxComponentContext, Repaint(), Total, UpdateBitmaps(), and UpdateBorders().
void sdext::presenter::PresenterScrollBar::SetLineHeight | ( | const double | nLineHeight | ) |
Definition at line 215 of file PresenterScrollBar.cxx.
References mnLineHeight.
void sdext::presenter::PresenterScrollBar::SetPosSize | ( | const css::geometry::RealRectangle2D & | rBox | ) |
Set the bounding box of the scroll bar.
Definition at line 153 of file PresenterScrollBar.cxx.
References mxWindow, and UpdateBorders().
void sdext::presenter::PresenterScrollBar::SetThumbPosition | ( | double | nPosition, |
const bool | bAsynchronousRepaint | ||
) |
Set the position of the movable thumb.
nPosition | A value between 0 and the last value given to SetTotalSize() minus the last value given to SetThumbSize(). |
Definition at line 167 of file PresenterScrollBar.cxx.
References Exception, GetRectangle(), maThumbMotionListener, mbIsNotificationActive, mnThumbPosition, Repaint(), Total, UpdateBorders(), and ValidateThumbPosition().
Referenced by mouseDragged().
void sdext::presenter::PresenterScrollBar::SetThumbSize | ( | const double | nThumbSize | ) |
Set the size of the movable thumb.
nThumbSize | A value not larger than the last value given to SetTotalSize(). |
Definition at line 203 of file PresenterScrollBar.cxx.
References GetRectangle(), mnThumbSize, Repaint(), Total, and UpdateBorders().
void sdext::presenter::PresenterScrollBar::SetTotalSize | ( | const double | nTotalSize | ) |
Set the upper border of the slider range.
Definition at line 193 of file PresenterScrollBar.cxx.
References GetRectangle(), mnTotalSize, Repaint(), Total, and UpdateBorders().
void sdext::presenter::PresenterScrollBar::SetVisible | ( | const bool | bIsVisible | ) |
Definition at line 147 of file PresenterScrollBar.cxx.
References mxWindow.
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by SetCanvas().
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by SetCanvas(), SetPosSize(), SetThumbPosition(), SetThumbSize(), and SetTotalSize().
|
protectedpure virtual |
Implemented in sdext::presenter::PresenterVerticalScrollBar.
Referenced by mouseDragged().
|
protected |
Definition at line 507 of file PresenterScrollBar.cxx.
References GetMinor().
Referenced by sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 266 of file PresenterScrollBar.cxx.
References mnThumbSize, and mnTotalSize.
Referenced by CheckValues(), and SetThumbPosition().
|
overridevirtual |
Definition at line 311 of file PresenterScrollBar.cxx.
|
overridevirtual |
Definition at line 307 of file PresenterScrollBar.cxx.
|
overridevirtual |
Definition at line 315 of file PresenterScrollBar.cxx.
|
overridevirtual |
Definition at line 305 of file PresenterScrollBar.cxx.
|
overridevirtual |
Definition at line 309 of file PresenterScrollBar.cxx.
|
protected |
Definition at line 162 of file PresenterScrollBar.hxx.
Referenced by GetRectangle(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBorders().
|
protected |
Definition at line 158 of file PresenterScrollBar.hxx.
Referenced by sdext::presenter::PresenterVerticalScrollBar::GetDragDistance(), mousePressed(), and sdext::presenter::PresenterVerticalScrollBar::UpdateDragAnchor().
|
protected |
Definition at line 174 of file PresenterScrollBar.hxx.
Referenced by IsDisabled(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBorders().
|
protected |
Definition at line 159 of file PresenterScrollBar.hxx.
Referenced by SetThumbPosition().
|
protected |
Definition at line 163 of file PresenterScrollBar.hxx.
Referenced by SetThumbPosition().
|
protected |
Definition at line 160 of file PresenterScrollBar.hxx.
Referenced by mouseDragged(), mouseExited(), and mousePressed().
|
protected |
Definition at line 161 of file PresenterScrollBar.hxx.
Referenced by GetBitmapMode(), mouseExited(), and mouseMoved().
|
protected |
Definition at line 157 of file PresenterScrollBar.hxx.
Referenced by GetLineHeight(), and SetLineHeight().
|
protected |
Definition at line 154 of file PresenterScrollBar.hxx.
Referenced by CheckValues(), sdext::presenter::PresenterVerticalScrollBar::GetDragDistance(), GetThumbPosition(), mouseDragged(), SetThumbPosition(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBorders().
|
protected |
Definition at line 156 of file PresenterScrollBar.hxx.
Referenced by sdext::presenter::PresenterVerticalScrollBar::GetDragDistance(), GetThumbSize(), SetThumbSize(), sdext::presenter::PresenterVerticalScrollBar::UpdateBorders(), and ValidateThumbPosition().
|
protected |
Definition at line 155 of file PresenterScrollBar.hxx.
Referenced by sdext::presenter::PresenterVerticalScrollBar::GetDragDistance(), SetTotalSize(), sdext::presenter::PresenterVerticalScrollBar::UpdateBorders(), sdext::presenter::PresenterVerticalScrollBar::UpdateDragAnchor(), and ValidateThumbPosition().
|
private |
Definition at line 217 of file PresenterScrollBar.hxx.
Referenced by PaintBackground(), and SetBackground().
|
protected |
Definition at line 165 of file PresenterScrollBar.hxx.
Referenced by disposing(), SetCanvas(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
private |
Definition at line 218 of file PresenterScrollBar.hxx.
Referenced by PaintBackground().
|
private |
Definition at line 216 of file PresenterScrollBar.hxx.
Referenced by disposing(), mouseDragged(), mouseExited(), mouseMoved(), mousePressed(), and mouseReleased().
|
protected |
Definition at line 167 of file PresenterScrollBar.hxx.
Referenced by Paint(), sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBorders().
|
protected |
Definition at line 169 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 170 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 168 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 153 of file PresenterScrollBar.hxx.
Referenced by Repaint().
|
protected |
Definition at line 166 of file PresenterScrollBar.hxx.
Referenced by Paint(), sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBorders().
|
staticprotected |
Definition at line 164 of file PresenterScrollBar.hxx.
Referenced by SetCanvas().
|
protected |
Definition at line 172 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 173 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 171 of file PresenterScrollBar.hxx.
Referenced by Paint(), and sdext::presenter::PresenterVerticalScrollBar::UpdateBitmaps().
|
protected |
Definition at line 151 of file PresenterScrollBar.hxx.
Referenced by Paint(), PaintBackground(), PaintBitmap(), sdext::presenter::PresenterVerticalScrollBar::PaintComposite(), SetCanvas(), and windowPaint().
|
protected |
Definition at line 149 of file PresenterScrollBar.hxx.
Referenced by GetComponentContext(), and SetCanvas().
|
protected |
Definition at line 152 of file PresenterScrollBar.hxx.
Referenced by mouseDragged(), and mouseReleased().
|
protected |
Definition at line 150 of file PresenterScrollBar.hxx.
Referenced by disposing(), sdext::presenter::PresenterVerticalScrollBar::GetDragDistance(), mouseDragged(), mouseReleased(), Paint(), PaintBackground(), PaintBitmap(), sdext::presenter::PresenterVerticalScrollBar::PaintComposite(), Repaint(), SetPosSize(), SetVisible(), sdext::presenter::PresenterVerticalScrollBar::UpdateBorders(), sdext::presenter::PresenterVerticalScrollBar::UpdateDragAnchor(), and windowPaint().