LibreOffice Module svx (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
svx::DialControl Class Referencefinal

This control allows to input a rotation angle, visualized by a dial. More...

#include <dialcontrol.hxx>

Inheritance diagram for svx::DialControl:
Collaboration diagram for svx::DialControl:


struct  DialControl_Impl

Public Member Functions

virtual void SetDrawingArea (weld::DrawingArea *pDrawingArea) override
virtual void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void StyleUpdated () override
virtual bool MouseButtonDown (const MouseEvent &rMEvt) override
virtual bool MouseMove (const MouseEvent &rMEvt) override
virtual bool MouseButtonUp (const MouseEvent &rMEvt) override
virtual bool KeyInput (const KeyEvent &rKEvt) override
virtual void LoseFocus () override
virtual void Resize () override
Degree100 GetRotation () const
 Returns the current rotation angle in 1/100 degrees. More...
void SetRotation (Degree100 nAngle)
 Sets the rotation to the passed value (in 1/100 degrees). More...
bool HasRotation () const
 Returns true, if the control is not in "don't care" state. More...
void SetNoRotation ()
 Sets the control to "don't care" state. More...
void SetLinkedField (weld::MetricSpinButton *pField, sal_Int32 nDecimalPlaces=0)
 Links the passed numeric edit field to the control (bi-directional). More...
void SaveValue ()
 Save value for later comparison. More...
bool IsValueModified () const
 Compare value with the saved value. More...
const OUString & GetText () const
void SetText (const OUString &rText)
void SetModifyHdl (const Link< DialControl &, void > &rLink)
void Init (const Size &rWinSize)
void set_visible (bool bVisible)
- Public Member Functions inherited from weld::CustomWidgetController
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible ()
virtual void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)=0
virtual void Resize ()
virtual bool MouseButtonDown (const MouseEvent &)
virtual bool MouseMove (const MouseEvent &)
virtual bool MouseButtonUp (const MouseEvent &)
virtual void GetFocus ()
virtual void LoseFocus ()
virtual void StyleUpdated ()
virtual bool Command (const CommandEvent &)
virtual bool KeyInput (const KeyEvent &)
virtual tools::Rectangle GetFocusRect ()
virtual FactoryFunction GetUITestFactory () const
virtual OUString RequestHelp (tools::Rectangle &)
virtual OUString GetHelpText () const
Size const & GetOutputSizePixel () const
void SetOutputSizePixel (const Size &rSize)
virtual void SetDrawingArea (weld::DrawingArea *pDrawingArea)
weld::DrawingAreaGetDrawingArea () const
void Invalidate ()
void Invalidate (const tools::Rectangle &rRect)
virtual void Show ()
virtual void Hide ()
void SetCursor (void *pData)
void GrabFocus ()
bool HasFocus () const
bool HasChildFocus () const
bool IsVisible () const
bool IsReallyVisible () const
bool IsEnabled () const
void Enable () const
void Disable () const
bool IsActive () const
int GetTextHeight () const
int GetTextWidth (const OUString &rText) const
OUString GetAccessibleName () const
OUString GetAccessibleDescription () const
void CaptureMouse ()
bool IsMouseCaptured () const
Point GetPointerPosPixel () const
void EnableRTL (bool bEnable)
bool IsRTLEnabled () const
void ReleaseMouse ()
void SetPointer (PointerStyle ePointerStyle)
void SetHelpId (const OUString &rHelpId)
void SetAccessibleName (const OUString &rName)
void SetInputContext (const InputContext &rInputContext)
void SetCursorRect (const tools::Rectangle &rCursorRect, int nExtTextInputWidth)
virtual int GetSurroundingText (OUString &)
virtual bool DeleteSurroundingText (const Selection &)
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget ()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard () const
void SetDragDataTransferable (rtl::Reference< TransferDataContainer > &rTransferable, sal_uInt8 eDNDConstants)
virtual bool StartDrag ()
void set_size_request (int nWidth, int nHeight)
void queue_resize ()
 CustomWidgetController ()
virtual ~CustomWidgetController ()
 CustomWidgetController (CustomWidgetController const &)=default
 CustomWidgetController (CustomWidgetController &&)=default
CustomWidgetControlleroperator= (CustomWidgetController const &)=default
CustomWidgetControlleroperator= (CustomWidgetController &&)=default

Private Member Functions

void HandleMouseEvent (const Point &rPos, bool bInitial)
void HandleEscapeEvent ()
void SetRotation (Degree100 nAngle, bool bBroadcast)
void Init (const Size &rWinSize, const vcl::Font &rWinFont)
void InvalidateControl ()
 DECL_DLLPRIVATE_LINK (LinkedFieldModifyHdl, weld::MetricSpinButton &, void)

Private Attributes

std::unique_ptr< DialControl_ImplmpImpl

Additional Inherited Members

- Static Public Member Functions inherited from weld::CustomWidgetController
static bool IsUpdateMode ()

Detailed Description

This control allows to input a rotation angle, visualized by a dial.

Usage: A single click sets a rotation angle rounded to steps of 15 degrees. Dragging with the left mouse button sets an exact rotation angle. Pressing the ESCAPE key during mouse drag cancels the operation and restores the old state of the control.

It is possible to link a numeric field to this control using the function SetLinkedField(). The DialControl will take full control of this numeric field:

Definition at line 75 of file dialcontrol.hxx.

Member Function Documentation


svx::DialControl::DECL_DLLPRIVATE_LINK ( LinkedFieldModifyHdl  ,
weld::MetricSpinButton ,

◆ GetRotation()

Degree100 svx::DialControl::GetRotation ( ) const

Returns the current rotation angle in 1/100 degrees.

Definition at line 352 of file dialcontrol.cxx.

References mpImpl.

Referenced by SetRotation().

◆ GetText()

const OUString & svx::DialControl::GetText ( ) const

Definition at line 115 of file dialcontrol.hxx.

Referenced by InvalidateControl().

◆ HandleEscapeEvent()

void svx::DialControl::HandleEscapeEvent ( )

◆ HandleMouseEvent()

void svx::DialControl::HandleMouseEvent ( const Point rPos,
bool  bInitial 

Definition at line 447 of file dialcontrol.cxx.

References mpImpl, SetRotation(), Point::X(), and Point::Y().

Referenced by MouseButtonDown(), and MouseMove().

◆ HasRotation()

bool svx::DialControl::HasRotation ( ) const

Returns true, if the control is not in "don't care" state.

Definition at line 336 of file dialcontrol.cxx.

References mpImpl.

◆ Init() [1/2]

void svx::DialControl::Init ( const Size rWinSize)

◆ Init() [2/2]

void svx::DialControl::Init ( const Size rWinSize,
const vcl::Font rWinFont 

◆ InvalidateControl()

void svx::DialControl::InvalidateControl ( )

◆ IsValueModified()

bool svx::DialControl::IsValueModified ( ) const

Compare value with the saved value.

Definition at line 392 of file dialcontrol.cxx.

References mpImpl.

◆ KeyInput()

bool svx::DialControl::KeyInput ( const KeyEvent rKEvt)

◆ LoseFocus()

void svx::DialControl::LoseFocus ( )

Reimplemented from weld::CustomWidgetController.

Definition at line 330 of file dialcontrol.cxx.

References HandleEscapeEvent().

◆ MouseButtonDown()

bool svx::DialControl::MouseButtonDown ( const MouseEvent rMEvt)

◆ MouseButtonUp()

bool svx::DialControl::MouseButtonUp ( const MouseEvent rMEvt)

◆ MouseMove()

bool svx::DialControl::MouseMove ( const MouseEvent rMEvt)

◆ Paint()

void svx::DialControl::Paint ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 

Implements weld::CustomWidgetController.

Definition at line 276 of file dialcontrol.cxx.

References OutputDevice::DrawBitmapEx(), and mpImpl.

◆ Resize()

void svx::DialControl::Resize ( )

◆ SaveValue()

void svx::DialControl::SaveValue ( )

Save value for later comparison.

Definition at line 387 of file dialcontrol.cxx.

References mpImpl.

◆ set_visible()

void svx::DialControl::set_visible ( bool  bVisible)

Definition at line 122 of file dialcontrol.hxx.

References bVisible, Hide, and svx::Show.

◆ SetDrawingArea()

void svx::DialControl::SetDrawingArea ( weld::DrawingArea pDrawingArea)

◆ SetLinkedField()

void svx::DialControl::SetLinkedField ( weld::MetricSpinButton pField,
sal_Int32  nDecimalPlaces = 0 

Links the passed numeric edit field to the control (bi-directional).

nDecimalPlaces: field value is unsign given decimal places default is 0 which means field values are in degrees, 2 means 100th of degree

Definition at line 362 of file dialcontrol.cxx.

References weld::MetricSpinButton::connect_value_changed(), LINK, and mpImpl.

◆ SetModifyHdl()

void svx::DialControl::SetModifyHdl ( const Link< DialControl &, void > &  rLink)

Definition at line 442 of file dialcontrol.cxx.

References mpImpl.

◆ SetNoRotation()

void svx::DialControl::SetNoRotation ( )

Sets the control to "don't care" state.

Definition at line 341 of file dialcontrol.cxx.

References InvalidateControl(), and mpImpl.

◆ SetRotation() [1/2]

void svx::DialControl::SetRotation ( Degree100  nAngle)

Sets the rotation to the passed value (in 1/100 degrees).

Definition at line 357 of file dialcontrol.cxx.

References SetRotation().

Referenced by HandleEscapeEvent(), HandleMouseEvent(), svx::IMPL_LINK_NOARG(), and SetRotation().

◆ SetRotation() [2/2]

void svx::DialControl::SetRotation ( Degree100  nAngle,
bool  bBroadcast 

Definition at line 424 of file dialcontrol.cxx.

References get(), GetRotation(), InvalidateControl(), mpImpl, and NormAngle36000().

◆ SetText()

void svx::DialControl::SetText ( const OUString &  rText)

Definition at line 116 of file dialcontrol.hxx.

◆ StyleUpdated()

void svx::DialControl::StyleUpdated ( )

Reimplemented from weld::CustomWidgetController.

Definition at line 282 of file dialcontrol.cxx.

References Init(), InvalidateControl(), and mpImpl.

Member Data Documentation

◆ mpImpl

std::unique_ptr< DialControl_Impl > svx::DialControl::mpImpl

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