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, const std::shared_ptr< PresenterPaintManager > &rpPaintManager, const ::std::function< void(double)> &rThumbMotionListener)
 
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)> const 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

Enumerator
Total 
Pager 
Thumb 
PagerUp 
PagerDown 
PrevButton 
NextButton 
None 
AreaCount 

Definition at line 145 of file PresenterScrollBar.hxx.

Constructor & Destructor Documentation

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

Definition at line 135 of file PresenterScrollBar.cxx.

sdext::presenter::PresenterScrollBar::PresenterScrollBar ( const PresenterScrollBar )
delete
sdext::presenter::PresenterScrollBar::PresenterScrollBar ( const css::uno::Reference< css::uno::XComponentContext > &  rxComponentContext,
const css::uno::Reference< css::awt::XWindow > &  rxParentWindow,
const std::shared_ptr< PresenterPaintManager > &  rpPaintManager,
const ::std::function< void(double)> &  rThumbMotionListener 
)
protected

Member Function Documentation

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 274 of file PresenterScrollBar.cxx.

References mnThumbPosition, and ValidateThumbPosition().

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

Definition at line 139 of file PresenterScrollBar.cxx.

References mpBitmaps, mpMousePressRepeater, mxWindow, and xComponent.

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

Definition at line 416 of file PresenterScrollBar.cxx.

References mxWindow.

PresenterScrollBar::Area sdext::presenter::PresenterScrollBar::GetArea ( const double  nX,
const double  nY 
) const
private
css::uno::Reference< css::rendering::XBitmap > sdext::presenter::PresenterScrollBar::GetBitmap ( const Area  eArea,
const SharedBitmapDescriptor rpBitmaps 
) const
protected
PresenterBitmapContainer::BitmapDescriptor::Mode sdext::presenter::PresenterScrollBar::GetBitmapMode ( const Area  eArea) const
protected
css::uno::Reference<css::uno::XComponentContext> const& sdext::presenter::PresenterScrollBar::GetComponentContext ( ) const
inline

Definition at line 60 of file PresenterScrollBar.hxx.

References mxComponentContext.

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

Definition at line 91 of file PresenterScrollBar.hxx.

References mnLineHeight.

virtual double sdext::presenter::PresenterScrollBar::GetMinor ( const double  nX,
const double  nY 
) const
protectedpure virtual
geometry::RealRectangle2D const & sdext::presenter::PresenterScrollBar::GetRectangle ( const Area  eArea) const
protected
virtual sal_Int32 sdext::presenter::PresenterScrollBar::GetSize ( ) const
pure virtual
double sdext::presenter::PresenterScrollBar::GetThumbPosition ( ) const
inline

Definition at line 77 of file PresenterScrollBar.hxx.

References mnThumbPosition.

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

Definition at line 88 of file PresenterScrollBar.hxx.

References mnThumbSize.

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

Definition at line 558 of file PresenterScrollBar.cxx.

References AreaCount, and maEnabledState.

Referenced by GetBitmapMode().

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

Definition at line 363 of file PresenterScrollBar.cxx.

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

Definition at line 355 of file PresenterScrollBar.cxx.

References mpMousePressRepeater, mxPresenterHelper, and mxWindow.

PresenterScrollBar& sdext::presenter::PresenterScrollBar::operator= ( const PresenterScrollBar )
delete
void sdext::presenter::PresenterScrollBar::Paint ( const css::awt::Rectangle &  rUpdateBox)
void sdext::presenter::PresenterScrollBar::PaintBackground ( const css::awt::Rectangle &  rRepaintBox)
protected

Definition at line 441 of file PresenterScrollBar.cxx.

References mpBackgroundBitmap, mpCanvasHelper, mxCanvas, and mxWindow.

Referenced by Paint().

void sdext::presenter::PresenterScrollBar::PaintBitmap ( const css::awt::Rectangle &  rRepaintBox,
const Area  eArea,
const SharedBitmapDescriptor rpBitmaps 
)
protected
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().

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

Definition at line 269 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 233 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 227 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 165 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.

Parameters
nPositionA value between 0 and the last value given to SetTotalSize() minus the last value given to SetThumbSize().

Definition at line 179 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.

Parameters
nThumbSizeA value not larger than the last value given to SetTotalSize().

Definition at line 215 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 205 of file PresenterScrollBar.cxx.

References GetRectangle(), mnTotalSize, Repaint(), Total, and UpdateBorders().

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

Definition at line 159 of file PresenterScrollBar.cxx.

References mxWindow.

virtual void sdext::presenter::PresenterScrollBar::UpdateBitmaps ( )
protectedpure virtual
virtual void sdext::presenter::PresenterScrollBar::UpdateBorders ( )
protectedpure virtual
virtual void sdext::presenter::PresenterScrollBar::UpdateDragAnchor ( const double  nDragDistance)
protectedpure virtual
void sdext::presenter::PresenterScrollBar::UpdateWidthOrHeight ( sal_Int32 &  rSize,
const SharedBitmapDescriptor rpDescriptor 
)
protected
double sdext::presenter::PresenterScrollBar::ValidateThumbPosition ( double  nPosition)
protected

Definition at line 279 of file PresenterScrollBar.cxx.

References mnThumbSize, and mnTotalSize.

Referenced by CheckValues(), and SetThumbPosition().

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

Definition at line 324 of file PresenterScrollBar.cxx.

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

Definition at line 320 of file PresenterScrollBar.cxx.

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

Definition at line 328 of file PresenterScrollBar.cxx.

References mxCanvas, mxWindow, and Paint().

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

Definition at line 318 of file PresenterScrollBar.cxx.

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

Definition at line 322 of file PresenterScrollBar.cxx.

Member Data Documentation

css::geometry::RealRectangle2D sdext::presenter::PresenterScrollBar::maBox[AreaCount]
protected
css::geometry::RealPoint2D sdext::presenter::PresenterScrollBar::maDragAnchor
protected
bool sdext::presenter::PresenterScrollBar::maEnabledState[AreaCount]
protected
::std::function<void (double)> const sdext::presenter::PresenterScrollBar::maThumbMotionListener
protected

Definition at line 159 of file PresenterScrollBar.hxx.

Referenced by SetThumbPosition().

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

Definition at line 163 of file PresenterScrollBar.hxx.

Referenced by SetThumbPosition().

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

Definition at line 160 of file PresenterScrollBar.hxx.

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

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

Definition at line 161 of file PresenterScrollBar.hxx.

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

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

Definition at line 157 of file PresenterScrollBar.hxx.

Referenced by GetLineHeight(), and SetLineHeight().

double sdext::presenter::PresenterScrollBar::mnThumbPosition
protected
double sdext::presenter::PresenterScrollBar::mnThumbSize
protected
double sdext::presenter::PresenterScrollBar::mnTotalSize
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpBackgroundBitmap
private

Definition at line 217 of file PresenterScrollBar.hxx.

Referenced by PaintBackground(), and SetBackground().

std::shared_ptr<PresenterBitmapContainer> sdext::presenter::PresenterScrollBar::mpBitmaps
protected
std::unique_ptr<PresenterCanvasHelper> sdext::presenter::PresenterScrollBar::mpCanvasHelper
private

Definition at line 218 of file PresenterScrollBar.hxx.

Referenced by PaintBackground().

std::shared_ptr<MousePressRepeater> sdext::presenter::PresenterScrollBar::mpMousePressRepeater
private
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpNextButtonDescriptor
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerCenterDescriptor
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerEndDescriptor
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPagerStartDescriptor
protected
std::shared_ptr<PresenterPaintManager> sdext::presenter::PresenterScrollBar::mpPaintManager
protected

Definition at line 153 of file PresenterScrollBar.hxx.

Referenced by Repaint().

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpPrevButtonDescriptor
protected
std::weak_ptr< PresenterBitmapContainer > sdext::presenter::PresenterScrollBar::mpSharedBitmaps
staticprotected

Definition at line 164 of file PresenterScrollBar.hxx.

Referenced by SetCanvas().

SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbCenterDescriptor
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbEndDescriptor
protected
SharedBitmapDescriptor sdext::presenter::PresenterScrollBar::mpThumbStartDescriptor
protected
css::uno::Reference<css::rendering::XCanvas> sdext::presenter::PresenterScrollBar::mxCanvas
protected
css::uno::Reference<css::uno::XComponentContext> sdext::presenter::PresenterScrollBar::mxComponentContext
protected

Definition at line 149 of file PresenterScrollBar.hxx.

Referenced by GetComponentContext(), and SetCanvas().

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

Definition at line 152 of file PresenterScrollBar.hxx.

Referenced by mouseDragged(), and mouseReleased().

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

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