LibreOffice Module sdext (master) 1
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
sdext::presenter::PresenterScrollBar Class Referenceabstract

Base class of horizontal and vertical scroll bars. More...

#include <PresenterScrollBar.hxx>

Inheritance diagram for sdext::presenter::PresenterScrollBar:
[legend]
Collaboration diagram for sdext::presenter::PresenterScrollBar:
[legend]

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
 
PresenterScrollBaroperator= (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)
 

Protected Attributes

css::uno::Reference< css::uno::XComponentContext > mxComponentContext
 
css::uno::Reference< css::awt::XWindow > mxWindow
 
css::uno::Reference< css::rendering::XCanvas > mxCanvas
 
css::uno::Reference< css::drawing::XPresenterHelper > mxPresenterHelper
 
std::shared_ptr< PresenterPaintManagermpPaintManager
 
double mnThumbPosition
 
double mnTotalSize
 
double mnThumbSize
 
double mnLineHeight
 
css::geometry::RealPoint2D maDragAnchor
 
::std::function< void(double)> maThumbMotionListener
 
Area meButtonDownArea
 
Area meMouseMoveArea
 
css::geometry::RealRectangle2D maBox [AreaCount]
 
bool mbIsNotificationActive
 
std::shared_ptr< PresenterBitmapContainermpBitmaps
 
SharedBitmapDescriptor mpPrevButtonDescriptor
 
SharedBitmapDescriptor mpNextButtonDescriptor
 
SharedBitmapDescriptor mpPagerStartDescriptor
 
SharedBitmapDescriptor mpPagerCenterDescriptor
 
SharedBitmapDescriptor mpPagerEndDescriptor
 
SharedBitmapDescriptor mpThumbStartDescriptor
 
SharedBitmapDescriptor mpThumbCenterDescriptor
 
SharedBitmapDescriptor mpThumbEndDescriptor
 
bool maEnabledState [AreaCount]
 

Static Protected Attributes

static std::weak_ptr< PresenterBitmapContainermpSharedBitmaps
 

Private Member Functions

Area GetArea (const double nX, const double nY) const
 

Private Attributes

std::shared_ptr< MousePressRepeatermpMousePressRepeater
 
SharedBitmapDescriptor mpBackgroundBitmap
 
std::unique_ptr< PresenterCanvasHelpermpCanvasHelper
 
- Private Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

Base class of horizontal and vertical scroll bars.

Definition at line 48 of file PresenterScrollBar.hxx.

Member Enumeration Documentation

◆ Area

Enumerator
Total 
Pager 
Thumb 
PagerUp 
PagerDown 
PrevButton 
NextButton 
None 
AreaCount 

Definition at line 145 of file PresenterScrollBar.hxx.

Constructor & Destructor Documentation

◆ ~PresenterScrollBar()

sdext::presenter::PresenterScrollBar::~PresenterScrollBar ( )
overridevirtual

Definition at line 123 of file PresenterScrollBar.cxx.

◆ PresenterScrollBar() [1/2]

sdext::presenter::PresenterScrollBar::PresenterScrollBar ( const PresenterScrollBar )
delete

◆ PresenterScrollBar() [2/2]

sdext::presenter::PresenterScrollBar::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 
)
protected

Member Function Documentation

◆ CheckValues()

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().

◆ disposing() [1/2]

void SAL_CALL sdext::presenter::PresenterScrollBar::disposing ( )
overridevirtual

Definition at line 127 of file PresenterScrollBar.cxx.

References mpBitmaps, mpMousePressRepeater, and mxWindow.

◆ disposing() [2/2]

void SAL_CALL sdext::presenter::PresenterScrollBar::disposing ( const css::lang::EventObject &  rEvent)
overridevirtual

Definition at line 403 of file PresenterScrollBar.cxx.

References mxWindow.

◆ GetArea()

PresenterScrollBar::Area sdext::presenter::PresenterScrollBar::GetArea ( const double  nX,
const double  nY 
) const
private

◆ GetBitmap()

css::uno::Reference< css::rendering::XBitmap > sdext::presenter::PresenterScrollBar::GetBitmap ( const Area  eArea,
const SharedBitmapDescriptor rpBitmaps 
) const
protected

◆ GetBitmapMode()

PresenterBitmapContainer::BitmapDescriptor::Mode sdext::presenter::PresenterScrollBar::GetBitmapMode ( const Area  eArea) const
protected

◆ GetComponentContext()

css::uno::Reference< css::uno::XComponentContext > const & sdext::presenter::PresenterScrollBar::GetComponentContext ( ) const
inline

Definition at line 60 of file PresenterScrollBar.hxx.

References mxComponentContext.

◆ GetDragDistance()

virtual double sdext::presenter::PresenterScrollBar::GetDragDistance ( const sal_Int32  nX,
const sal_Int32  nY 
) const
protectedpure virtual

◆ GetLineHeight()

double sdext::presenter::PresenterScrollBar::GetLineHeight ( ) const
inline

Definition at line 91 of file PresenterScrollBar.hxx.

References mnLineHeight.

◆ GetMinor()

virtual double sdext::presenter::PresenterScrollBar::GetMinor ( const double  nX,
const double  nY 
) const
protectedpure virtual

◆ GetRectangle()

geometry::RealRectangle2D const & sdext::presenter::PresenterScrollBar::GetRectangle ( const Area  eArea) const
protected

◆ GetSize()

virtual sal_Int32 sdext::presenter::PresenterScrollBar::GetSize ( ) const
pure virtual

◆ GetThumbPosition()

double sdext::presenter::PresenterScrollBar::GetThumbPosition ( ) const
inline

Definition at line 77 of file PresenterScrollBar.hxx.

References mnThumbPosition.

◆ GetThumbSize()

double sdext::presenter::PresenterScrollBar::GetThumbSize ( ) const
inline

Definition at line 88 of file PresenterScrollBar.hxx.

References mnThumbSize.

◆ IsDisabled()

bool sdext::presenter::PresenterScrollBar::IsDisabled ( const Area  eArea) const
protected

Definition at line 545 of file PresenterScrollBar.cxx.

References AreaCount, and maEnabledState.

Referenced by GetBitmapMode().

◆ mouseDragged()

void SAL_CALL sdext::presenter::PresenterScrollBar::mouseDragged ( const css::awt::MouseEvent &  rEvent)
overridevirtual

◆ mouseEntered()

void SAL_CALL sdext::presenter::PresenterScrollBar::mouseEntered ( const css::awt::MouseEvent &  rEvent)
overridevirtual

Definition at line 350 of file PresenterScrollBar.cxx.

◆ mouseExited()

void SAL_CALL sdext::presenter::PresenterScrollBar::mouseExited ( const css::awt::MouseEvent &  rEvent)
overridevirtual

◆ mouseMoved()

void SAL_CALL sdext::presenter::PresenterScrollBar::mouseMoved ( const css::awt::MouseEvent &  rEvent)
overridevirtual

◆ mousePressed()

void SAL_CALL sdext::presenter::PresenterScrollBar::mousePressed ( const css::awt::MouseEvent &  rEvent)
overridevirtual

◆ mouseReleased()

void SAL_CALL sdext::presenter::PresenterScrollBar::mouseReleased ( const css::awt::MouseEvent &  rEvent)
overridevirtual

Definition at line 342 of file PresenterScrollBar.cxx.

References mpMousePressRepeater, mxPresenterHelper, and mxWindow.

◆ operator=()

PresenterScrollBar & sdext::presenter::PresenterScrollBar::operator= ( const PresenterScrollBar )
delete

◆ Paint()

void sdext::presenter::PresenterScrollBar::Paint ( const css::awt::Rectangle &  rUpdateBox)

◆ PaintBackground()

void sdext::presenter::PresenterScrollBar::PaintBackground ( const css::awt::Rectangle &  rRepaintBox)
protected

Definition at line 428 of file PresenterScrollBar.cxx.

References mpBackgroundBitmap, mpCanvasHelper, mxCanvas, and mxWindow.

Referenced by Paint().

◆ PaintBitmap()

void sdext::presenter::PresenterScrollBar::PaintBitmap ( const css::awt::Rectangle &  rRepaintBox,
const Area  eArea,
const SharedBitmapDescriptor rpBitmaps 
)
protected

◆ PaintComposite()

virtual void sdext::presenter::PresenterScrollBar::PaintComposite ( const css::awt::Rectangle &  rRepaintBox,
const Area  eArea,
const SharedBitmapDescriptor rpStartBitmaps,
const SharedBitmapDescriptor rpCenterBitmaps,
const SharedBitmapDescriptor rpEndBitmaps 
)
protectedpure virtual

Implemented in sdext::presenter::PresenterVerticalScrollBar.

Referenced by Paint().

◆ Repaint()

void sdext::presenter::PresenterScrollBar::Repaint ( const css::geometry::RealRectangle2D &  rBox,
const bool  bAsynchronous 
)
protected

◆ SetBackground()

void sdext::presenter::PresenterScrollBar::SetBackground ( const SharedBitmapDescriptor rpBackgroundBitmap)

Definition at line 256 of file PresenterScrollBar.cxx.

References mpBackgroundBitmap.

◆ SetCanvas()

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().

◆ SetLineHeight()

void sdext::presenter::PresenterScrollBar::SetLineHeight ( const double  nLineHeight)

Definition at line 215 of file PresenterScrollBar.cxx.

References mnLineHeight.

◆ SetPosSize()

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().

◆ SetThumbPosition()

void sdext::presenter::PresenterScrollBar::SetThumbPosition ( double  nPosition,
const bool  bAsynchronousRepaint 
)

Set the position of the movable thumb.

Parameters
nPositionA 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().

◆ SetThumbSize()

void sdext::presenter::PresenterScrollBar::SetThumbSize ( const double  nThumbSize)

Set the size of the movable thumb.

Parameters
nThumbSizeA 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().

◆ SetTotalSize()

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().

◆ SetVisible()

void sdext::presenter::PresenterScrollBar::SetVisible ( const bool  bIsVisible)

Definition at line 147 of file PresenterScrollBar.cxx.

References mxWindow.

◆ UpdateBitmaps()

virtual void sdext::presenter::PresenterScrollBar::UpdateBitmaps ( )
protectedpure virtual

◆ UpdateBorders()

virtual void sdext::presenter::PresenterScrollBar::UpdateBorders ( )
protectedpure virtual

◆ UpdateDragAnchor()

virtual void sdext::presenter::PresenterScrollBar::UpdateDragAnchor ( const double  nDragDistance)
protectedpure virtual

◆ UpdateWidthOrHeight()

void sdext::presenter::PresenterScrollBar::UpdateWidthOrHeight ( sal_Int32 &  rSize,
const SharedBitmapDescriptor rpDescriptor 
)
protected

◆ ValidateThumbPosition()

double sdext::presenter::PresenterScrollBar::ValidateThumbPosition ( double  nPosition)
protected

Definition at line 266 of file PresenterScrollBar.cxx.

References mnThumbSize, and mnTotalSize.

Referenced by CheckValues(), and SetThumbPosition().

◆ windowHidden()

void SAL_CALL sdext::presenter::PresenterScrollBar::windowHidden ( const css::lang::EventObject &  rEvent)
overridevirtual

Definition at line 311 of file PresenterScrollBar.cxx.

◆ windowMoved()

void SAL_CALL sdext::presenter::PresenterScrollBar::windowMoved ( const css::awt::WindowEvent &  rEvent)
overridevirtual

Definition at line 307 of file PresenterScrollBar.cxx.

◆ windowPaint()

void SAL_CALL sdext::presenter::PresenterScrollBar::windowPaint ( const css::awt::PaintEvent &  rEvent)
overridevirtual

Definition at line 315 of file PresenterScrollBar.cxx.

References mxCanvas, mxWindow, and Paint().

◆ windowResized()

void SAL_CALL sdext::presenter::PresenterScrollBar::windowResized ( const css::awt::WindowEvent &  rEvent)
overridevirtual

Definition at line 305 of file PresenterScrollBar.cxx.

◆ windowShown()

void SAL_CALL sdext::presenter::PresenterScrollBar::windowShown ( const css::lang::EventObject &  rEvent)
overridevirtual

Definition at line 309 of file PresenterScrollBar.cxx.

Member Data Documentation

◆ maBox

css::geometry::RealRectangle2D sdext::presenter::PresenterScrollBar::maBox[AreaCount]
protected

◆ maDragAnchor

css::geometry::RealPoint2D sdext::presenter::PresenterScrollBar::maDragAnchor
protected

◆ maEnabledState

bool sdext::presenter::PresenterScrollBar::maEnabledState[AreaCount]
protected

◆ maThumbMotionListener

::std::function<void (double)> sdext::presenter::PresenterScrollBar::maThumbMotionListener
protected

Definition at line 159 of file PresenterScrollBar.hxx.

Referenced by SetThumbPosition().

◆ mbIsNotificationActive

bool sdext::presenter::PresenterScrollBar::mbIsNotificationActive
protected

Definition at line 163 of file PresenterScrollBar.hxx.

Referenced by SetThumbPosition().

◆ meButtonDownArea

Area sdext::presenter::PresenterScrollBar::meButtonDownArea
protected

Definition at line 160 of file PresenterScrollBar.hxx.

Referenced by mouseDragged(), mouseExited(), and mousePressed().

◆ meMouseMoveArea

Area sdext::presenter::PresenterScrollBar::meMouseMoveArea
protected

Definition at line 161 of file PresenterScrollBar.hxx.

Referenced by GetBitmapMode(), mouseExited(), and mouseMoved().

◆ mnLineHeight

double sdext::presenter::PresenterScrollBar::mnLineHeight
protected

Definition at line 157 of file PresenterScrollBar.hxx.

Referenced by GetLineHeight(), and SetLineHeight().

◆ mnThumbPosition

double sdext::presenter::PresenterScrollBar::mnThumbPosition
protected

◆ mnThumbSize

double sdext::presenter::PresenterScrollBar::mnThumbSize
protected

◆ mnTotalSize

double sdext::presenter::PresenterScrollBar::mnTotalSize
protected

◆ mpBackgroundBitmap

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpBackgroundBitmap
private

Definition at line 217 of file PresenterScrollBar.hxx.

Referenced by PaintBackground(), and SetBackground().

◆ mpBitmaps

std::shared_ptr<PresenterBitmapContainer> sdext::presenter::PresenterScrollBar::mpBitmaps
protected

◆ mpCanvasHelper

std::unique_ptr<PresenterCanvasHelper> sdext::presenter::PresenterScrollBar::mpCanvasHelper
private

Definition at line 218 of file PresenterScrollBar.hxx.

Referenced by PaintBackground().

◆ mpMousePressRepeater

std::shared_ptr<MousePressRepeater> sdext::presenter::PresenterScrollBar::mpMousePressRepeater
private

◆ mpNextButtonDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpNextButtonDescriptor
protected

◆ mpPagerCenterDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerCenterDescriptor
protected

◆ mpPagerEndDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerEndDescriptor
protected

◆ mpPagerStartDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerStartDescriptor
protected

◆ mpPaintManager

std::shared_ptr<PresenterPaintManager> sdext::presenter::PresenterScrollBar::mpPaintManager
protected

Definition at line 153 of file PresenterScrollBar.hxx.

Referenced by Repaint().

◆ mpPrevButtonDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPrevButtonDescriptor
protected

◆ mpSharedBitmaps

std::weak_ptr< PresenterBitmapContainer > sdext::presenter::PresenterScrollBar::mpSharedBitmaps
staticprotected

Definition at line 164 of file PresenterScrollBar.hxx.

Referenced by SetCanvas().

◆ mpThumbCenterDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbCenterDescriptor
protected

◆ mpThumbEndDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbEndDescriptor
protected

◆ mpThumbStartDescriptor

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbStartDescriptor
protected

◆ mxCanvas

css::uno::Reference<css::rendering::XCanvas> sdext::presenter::PresenterScrollBar::mxCanvas
protected

◆ mxComponentContext

css::uno::Reference<css::uno::XComponentContext> sdext::presenter::PresenterScrollBar::mxComponentContext
protected

Definition at line 149 of file PresenterScrollBar.hxx.

Referenced by GetComponentContext(), and SetCanvas().

◆ mxPresenterHelper

css::uno::Reference<css::drawing::XPresenterHelper> sdext::presenter::PresenterScrollBar::mxPresenterHelper
protected

Definition at line 152 of file PresenterScrollBar.hxx.

Referenced by mouseDragged(), and mouseReleased().

◆ mxWindow

css::uno::Reference<css::awt::XWindow> sdext::presenter::PresenterScrollBar::mxWindow
protected

The documentation for this class was generated from the following files: