LibreOffice Module slideshow (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
slideshow::internal::SlideOverlayButton Class Reference

#include <slideoverlaybutton.hxx>

Inheritance diagram for slideshow::internal::SlideOverlayButton:
[legend]
Collaboration diagram for slideshow::internal::SlideOverlayButton:
[legend]

Public Member Functions

 SlideOverlayButton (const SlideOverlayButton &)=delete
 
SlideOverlayButtonoperator= (const SlideOverlayButton &)=delete
 
void show ()
 Shows button icon. More...
 
void hide ()
 Hides button icon. More...
 
css::geometry::IntegerSize2D getSize () const
 
basegfx::B2DPoint calcSpritePos (UnoViewSharedPtr const &rView) const
 
virtual void viewAdded (const UnoViewSharedPtr &rView)=0
 Notify new view. More...
 
virtual void viewRemoved (const UnoViewSharedPtr &rView)=0
 Notify removed view. More...
 
virtual void viewChanged (const UnoViewSharedPtr &rView)=0
 Notify changed view. More...
 
virtual void viewsChanged ()=0
 Notify that all views changed. More...
 
- Public Member Functions inherited from slideshow::internal::SharedPtrAble
virtual ~SharedPtrAble ()
 
- Public Member Functions inherited from slideshow::internal::MouseEventHandler
virtual ~MouseEventHandler ()
 
virtual bool handleMousePressed (const css::awt::MouseEvent &e)=0
 Handle a mouse button pressed event. More...
 
virtual bool handleMouseReleased (const css::awt::MouseEvent &e)=0
 Handle a mouse button released event. More...
 
virtual bool handleMouseDragged (const css::awt::MouseEvent &e)=0
 Handle a mouse was moved with a pressed button event. More...
 
virtual bool handleMouseMoved (const css::awt::MouseEvent &e)=0
 Handle a mouse was moved event. More...
 

Static Public Member Functions

static SlideOverlayButtonSharedPtr create (const css::uno::Reference< css::rendering::XBitmap > &xIconBitmap, css::awt::Point pPosition, std::function< void(basegfx::B2DPoint)> clickHandler, ScreenUpdater &rScreenUpdater, EventMultiplexer &rEventMultiplexer, const UnoViewContainer &rViewContainer)
 

Private Types

typedef std::vector< std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr > > ViewsVecT
 

Private Member Functions

 SlideOverlayButton (css::uno::Reference< css::rendering::XBitmap > xIconBitmap, css::awt::Point pPosition, std::function< void(basegfx::B2DPoint)> clickHandler, ScreenUpdater &rScreenUpdater, EventMultiplexer &rEventMultiplexer, const UnoViewContainer &rViewContainer)
 
virtual void viewAdded (const UnoViewSharedPtr &rView) override
 Notify new view. More...
 
virtual void viewRemoved (const UnoViewSharedPtr &rView) override
 Notify removed view. More...
 
virtual void viewChanged (const UnoViewSharedPtr &rView) override
 Notify changed view. More...
 
virtual void viewsChanged () override
 Notify that all views changed. More...
 
virtual bool handleMousePressed (const css::awt::MouseEvent &e) override
 Handle a mouse button pressed event. More...
 
virtual bool handleMouseReleased (const css::awt::MouseEvent &e) override
 Handle a mouse button released event. More...
 
virtual bool handleMouseDragged (const css::awt::MouseEvent &e) override
 Handle a mouse was moved with a pressed button event. More...
 
virtual bool handleMouseMoved (const css::awt::MouseEvent &e) override
 Handle a mouse was moved event. More...
 
void setVisible (const bool bVisible)
 

Private Attributes

css::uno::Reference< css::rendering::XBitmap > mxIconBitmap
 
EventMultiplexermrEventMultiplexer
 
css::awt::Point mpPosition
 
std::function< void(basegfx::B2DPoint)> mClickHandler
 
ViewsVecT maViews
 
ScreenUpdatermrScreenUpdater
 
bool mbVisible = false
 

Detailed Description

Definition at line 45 of file slideoverlaybutton.hxx.

Member Typedef Documentation

◆ ViewsVecT

Definition at line 89 of file slideoverlaybutton.hxx.

Constructor & Destructor Documentation

◆ SlideOverlayButton() [1/2]

slideshow::internal::SlideOverlayButton::SlideOverlayButton ( const SlideOverlayButton )
delete

Referenced by create().

◆ SlideOverlayButton() [2/2]

slideshow::internal::SlideOverlayButton::SlideOverlayButton ( css::uno::Reference< css::rendering::XBitmap >  xIconBitmap,
css::awt::Point  pPosition,
std::function< void(basegfx::B2DPoint)>  clickHandler,
ScreenUpdater rScreenUpdater,
EventMultiplexer rEventMultiplexer,
const UnoViewContainer rViewContainer 
)
private

Definition at line 52 of file slideoverlaybutton.cxx.

References viewAdded().

Member Function Documentation

◆ calcSpritePos()

basegfx::B2DPoint slideshow::internal::SlideOverlayButton::calcSpritePos ( UnoViewSharedPtr const &  rView) const

Definition at line 85 of file slideoverlaybutton.cxx.

References mpPosition, and mxIconBitmap.

Referenced by viewAdded(), viewChanged(), and viewsChanged().

◆ create()

SlideOverlayButtonSharedPtr slideshow::internal::SlideOverlayButton::create ( const css::uno::Reference< css::rendering::XBitmap > &  xIconBitmap,
css::awt::Point  pPosition,
std::function< void(basegfx::B2DPoint)>  clickHandler,
ScreenUpdater rScreenUpdater,
EventMultiplexer rEventMultiplexer,
const UnoViewContainer rViewContainer 
)
static

◆ getSize()

css::geometry::IntegerSize2D slideshow::internal::SlideOverlayButton::getSize ( ) const

Definition at line 83 of file slideoverlaybutton.cxx.

References mxIconBitmap.

◆ handleMouseDragged()

bool slideshow::internal::SlideOverlayButton::handleMouseDragged ( const css::awt::MouseEvent &  e)
overrideprivatevirtual

Handle a mouse was moved with a pressed button event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 181 of file slideoverlaybutton.cxx.

◆ handleMouseMoved()

bool slideshow::internal::SlideOverlayButton::handleMouseMoved ( const css::awt::MouseEvent &  e)
overrideprivatevirtual

Handle a mouse was moved event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 183 of file slideoverlaybutton.cxx.

◆ handleMousePressed()

bool slideshow::internal::SlideOverlayButton::handleMousePressed ( const css::awt::MouseEvent &  e)
overrideprivatevirtual

Handle a mouse button pressed event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the mouse event. When this method returns false, possibly other, less prioritized handlers can be called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 157 of file slideoverlaybutton.cxx.

◆ handleMouseReleased()

bool slideshow::internal::SlideOverlayButton::handleMouseReleased ( const css::awt::MouseEvent &  e)
overrideprivatevirtual

Handle a mouse button released event.

Parameters
eThe mouse event that occurred. The x,y coordinates of the event are already transformed back to user coordinate space, taking the inverse transform of the view in which the event occurred.
Returns
true, if this handler has successfully processed the pause event. When this method returns false, possibly other, less prioritized handlers are called, too.

Implements slideshow::internal::MouseEventHandler.

Definition at line 159 of file slideoverlaybutton.cxx.

References basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), mClickHandler, mpPosition, mrEventMultiplexer, mxIconBitmap, and slideshow::internal::EventMultiplexer::toNormalPoint().

◆ hide()

void slideshow::internal::SlideOverlayButton::hide ( )
inline

Hides button icon.

Definition at line 63 of file slideoverlaybutton.hxx.

References setVisible().

◆ operator=()

SlideOverlayButton & slideshow::internal::SlideOverlayButton::operator= ( const SlideOverlayButton )
delete

◆ setVisible()

void slideshow::internal::SlideOverlayButton::setVisible ( const bool  bVisible)
private

◆ show()

void slideshow::internal::SlideOverlayButton::show ( )
inline

Shows button icon.

Definition at line 59 of file slideoverlaybutton.hxx.

References setVisible().

◆ viewAdded()

void slideshow::internal::SlideOverlayButton::viewAdded ( const UnoViewSharedPtr rView)
overrideprivatevirtual

Notify new view.

Parameters
rViewThe newly added view

Implements slideshow::internal::ViewEventHandler.

Definition at line 95 of file slideoverlaybutton.cxx.

References calcSpritePos(), canvas::tools::initRenderState(), canvas::tools::initViewState(), maViews, mxIconBitmap, and TOOLS_WARN_EXCEPTION.

Referenced by SlideOverlayButton().

◆ viewChanged()

void slideshow::internal::SlideOverlayButton::viewChanged ( const UnoViewSharedPtr rView)
overrideprivatevirtual

Notify changed view.

Reasons for a viewChanged notification can be different view size, transformation, or other device properties (color resolution or profile, etc.)

Parameters
rViewThe changed view

Implements slideshow::internal::ViewEventHandler.

Definition at line 132 of file slideoverlaybutton.cxx.

References calcSpritePos(), and maViews.

◆ viewRemoved()

void slideshow::internal::SlideOverlayButton::viewRemoved ( const UnoViewSharedPtr rView)
overrideprivatevirtual

Notify removed view.

Parameters
rViewThe removed view

Implements slideshow::internal::ViewEventHandler.

Definition at line 124 of file slideoverlaybutton.cxx.

References maViews.

◆ viewsChanged()

void slideshow::internal::SlideOverlayButton::viewsChanged ( )
overrideprivatevirtual

Notify that all views changed.

Reasons for a viewChanged notification can be different view size, transformation, or other device properties (color resolution or profile, etc.)

Note that this method avoids hidden inefficiencies (O(n^2) behaviour when viewChanged() needs to perform linear searches)

Implements slideshow::internal::ViewEventHandler.

Definition at line 147 of file slideoverlaybutton.cxx.

References calcSpritePos(), and maViews.

Member Data Documentation

◆ maViews

ViewsVecT slideshow::internal::SlideOverlayButton::maViews
private

Definition at line 96 of file slideoverlaybutton.hxx.

Referenced by setVisible(), viewAdded(), viewChanged(), viewRemoved(), and viewsChanged().

◆ mbVisible

bool slideshow::internal::SlideOverlayButton::mbVisible = false
private

Definition at line 98 of file slideoverlaybutton.hxx.

Referenced by setVisible().

◆ mClickHandler

std::function<void(basegfx::B2DPoint)> slideshow::internal::SlideOverlayButton::mClickHandler
private

Definition at line 94 of file slideoverlaybutton.hxx.

Referenced by handleMouseReleased().

◆ mpPosition

css::awt::Point slideshow::internal::SlideOverlayButton::mpPosition
private

Definition at line 93 of file slideoverlaybutton.hxx.

Referenced by calcSpritePos(), and handleMouseReleased().

◆ mrEventMultiplexer

EventMultiplexer& slideshow::internal::SlideOverlayButton::mrEventMultiplexer
private

Definition at line 92 of file slideoverlaybutton.hxx.

Referenced by handleMouseReleased().

◆ mrScreenUpdater

ScreenUpdater& slideshow::internal::SlideOverlayButton::mrScreenUpdater
private

Definition at line 97 of file slideoverlaybutton.hxx.

Referenced by setVisible().

◆ mxIconBitmap

css::uno::Reference<css::rendering::XBitmap> slideshow::internal::SlideOverlayButton::mxIconBitmap
private

Definition at line 91 of file slideoverlaybutton.hxx.

Referenced by calcSpritePos(), getSize(), handleMouseReleased(), and viewAdded().


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