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:
[legend]
Collaboration diagram for svx::DialControl:
[legend]

Classes

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
 
sal_Int32 GetRotation () const
 Returns the current rotation angle in 1/100 degrees. More...
 
void SetRotation (sal_Int32 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 GetFocus ()
 
virtual bool Command (const CommandEvent &)
 
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)
 
weld::DrawingAreaGetDrawingArea () const
 
void Invalidate ()
 
void Invalidate (const tools::Rectangle &rRect)
 
virtual void Show ()
 
virtual void Hide ()
 
void GrabFocus ()
 
bool HasFocus () 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
 
void EnableRTL (bool bEnable)
 
bool IsRTLEnabled () const
 
void ReleaseMouse ()
 
void SetPointer (PointerStyle ePointerStyle)
 
void SetHelpId (const OString &rHelpId)
 
void SetAccessibleName (const OUString &rName)
 
void SetDragDataTransferrable (rtl::Reference< TransferDataContainer > &rTransferrable, 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 (sal_Int32 nAngle, bool bBroadcast)
 
void Init (const Size &rWinSize, const vcl::Font &rWinFont)
 
void InvalidateControl ()
 
 DECL_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_LINK ( LinkedFieldModifyHdl  ,
weld::MetricSpinButton ,
void   
)
private
sal_Int32 svx::DialControl::GetRotation ( ) const

Returns the current rotation angle in 1/100 degrees.

Definition at line 351 of file dialcontrol.cxx.

References mpImpl.

Referenced by SetRotation().

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

Definition at line 115 of file dialcontrol.hxx.

Referenced by InvalidateControl().

void svx::DialControl::HandleEscapeEvent ( )
private
void svx::DialControl::HandleMouseEvent ( const Point &  rPos,
bool  bInitial 
)
private

Definition at line 447 of file dialcontrol.cxx.

References mpImpl, basegfx::rad2deg(), and SetRotation().

Referenced by MouseButtonDown(), and MouseMove().

bool svx::DialControl::HasRotation ( ) const

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

Definition at line 335 of file dialcontrol.cxx.

References mpImpl.

void svx::DialControl::Init ( const Size rWinSize)
void svx::DialControl::Init ( const Size rWinSize,
const vcl::Font rWinFont 
)
private
void svx::DialControl::InvalidateControl ( )
private
bool svx::DialControl::IsValueModified ( ) const

Compare value with the saved value.

Definition at line 391 of file dialcontrol.cxx.

References mpImpl.

bool svx::DialControl::KeyInput ( const KeyEvent rKEvt)
overridevirtual
void svx::DialControl::LoseFocus ( )
overridevirtual

Reimplemented from weld::CustomWidgetController.

Definition at line 329 of file dialcontrol.cxx.

References HandleEscapeEvent().

bool svx::DialControl::MouseButtonDown ( const MouseEvent rMEvt)
overridevirtual
bool svx::DialControl::MouseButtonUp ( const MouseEvent rMEvt)
overridevirtual
bool svx::DialControl::MouseMove ( const MouseEvent rMEvt)
overridevirtual
void svx::DialControl::Paint ( vcl::RenderContext rRenderContext,
const tools::Rectangle rRect 
)
overridevirtual

Implements weld::CustomWidgetController.

Definition at line 275 of file dialcontrol.cxx.

References OutputDevice::DrawBitmapEx(), mpImpl, and Point.

void svx::DialControl::Resize ( )
overridevirtual
void svx::DialControl::SaveValue ( )

Save value for later comparison.

Definition at line 386 of file dialcontrol.cxx.

References mpImpl.

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

Definition at line 122 of file dialcontrol.hxx.

References svx::Hide, and svx::Show.

void svx::DialControl::SetDrawingArea ( weld::DrawingArea pDrawingArea)
overridevirtual
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 361 of file dialcontrol.cxx.

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

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

Definition at line 442 of file dialcontrol.cxx.

References mpImpl.

void svx::DialControl::SetNoRotation ( )

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

Definition at line 340 of file dialcontrol.cxx.

References InvalidateControl(), and mpImpl.

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

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

Definition at line 356 of file dialcontrol.cxx.

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

void svx::DialControl::SetRotation ( sal_Int32  nAngle,
bool  bBroadcast 
)
private

Definition at line 423 of file dialcontrol.cxx.

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

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

Definition at line 116 of file dialcontrol.hxx.

void svx::DialControl::StyleUpdated ( )
overridevirtual

Reimplemented from weld::CustomWidgetController.

Definition at line 281 of file dialcontrol.cxx.

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

Member Data Documentation

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

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