LibreOffice Module sc (master) 1
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
ScCsvControl Class Reference

Base class for the CSV ruler and the data grid control. More...

#include <csvcontrol.hxx>

Inheritance diagram for ScCsvControl:
[legend]
Collaboration diagram for ScCsvControl:
[legend]

Public Member Functions

 ScCsvControl (const ScCsvLayoutData &rData)
 Reference to the accessible implementation object. More...
 
virtual ~ScCsvControl () override
 
virtual void GetFocus () override
 
virtual void LoseFocus () override
 
void AccSendFocusEvent (bool bFocused)
 Sends a GetFocus or LoseFocus event to the accessibility object. More...
 
void AccSendCaretEvent ()
 Sends a caret changed event to the accessibility object. More...
 
void AccSendVisibleEvent ()
 Sends a visible area changed event to the accessibility object. More...
 
void AccSendSelectionEvent ()
 Sends a selection changed event to the accessibility object. More...
 
void AccSendTableUpdateEvent (sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows=true)
 Sends a table model changed event for changed cell contents to the accessibility object. More...
 
void AccSendInsertColumnEvent (sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn)
 Sends a table model changed event for an inserted column to the accessibility object. More...
 
void AccSendRemoveColumnEvent (sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn)
 Sends a table model changed event for a removed column to the accessibility object. More...
 
ScAccessibleCsvControlGetAccessible ()
 
void InvalidateGfx ()
 Sets the graphic invalid (next Redraw() will not use cached graphic). More...
 
void ValidateGfx ()
 Sets the graphic valid (next Redraw() will use cached graphic). More...
 
bool IsValidGfx () const
 Returns true, if cached graphic is valid. More...
 
void Repaint (bool bInvalidate=false)
 Repaints all controls. More...
 
void DisableRepaint ()
 Increases no-repaint counter (controls do not repaint until the last EnableRepaint()). More...
 
void EnableRepaint ()
 Decreases no-repaint counter and repaints if counter reaches 0. More...
 
bool IsNoRepaint () const
 Returns true, if controls will not repaint. More...
 
void SetCmdHdl (const Link< ScCsvControl &, void > &rHdl)
 Sets a new command handler. More...
 
const ScCsvCmdGetCmd () const
 Returns data of the last command. More...
 
void Execute (ScCsvCmdType eType, sal_Int32 nParam1=CSV_POS_INVALID, sal_Int32 nParam2=CSV_POS_INVALID)
 Executes a command by calling command handler. More...
 
const ScCsvLayoutDataGetLayoutData () const
 Returns a reference to the current layout data. More...
 
bool IsRTL () const
 Returns true, if the Right-to-Left layout mode is active. More...
 
sal_Int32 GetPosCount () const
 Returns the number of available positions. More...
 
sal_Int32 GetVisPosCount () const
 Returns the number of visible positions. More...
 
sal_Int32 GetFirstVisPos () const
 Returns the first visible position. More...
 
sal_Int32 GetLastVisPos () const
 Returns the last visible position. More...
 
sal_Int32 GetMaxPosOffset () const
 Returns highest possible position for first visible character. More...
 
bool IsValidSplitPos (sal_Int32 nPos) const
 Returns true, if it is allowed to set a split at nPos. More...
 
bool IsVisibleSplitPos (sal_Int32 nPos) const
 Returns true, if nPos is an allowed AND visible split position. More...
 
sal_Int32 GetHdrWidth () const
 Returns the width of the header column. More...
 
sal_Int32 GetCharWidth () const
 Returns the width of one character column. More...
 
sal_Int32 GetHdrX () const
 Returns the start position of the header column. More...
 
sal_Int32 GetFirstX () const
 Returns the X position of the first pixel of the data area. More...
 
sal_Int32 GetLastX () const
 Returns the X position of the last pixel of the data area. More...
 
sal_Int32 GetX (sal_Int32 nPos) const
 Returns output X coordinate of the specified position. More...
 
sal_Int32 GetPosFromX (sal_Int32 nX) const
 Returns position from output coordinate. More...
 
sal_Int32 GetLineCount () const
 Returns the number of data lines. More...
 
sal_Int32 GetVisLineCount () const
 Returns the number of visible lines (including partly visible bottom line). More...
 
sal_Int32 GetFirstVisLine () const
 Returns index of first visible line. More...
 
sal_Int32 GetLastVisLine () const
 Returns index of last visible line. More...
 
sal_Int32 GetMaxLineOffset () const
 Returns highest possible index for first line. More...
 
bool IsValidLine (sal_Int32 nLine) const
 Returns true, if nLine is a valid line index. More...
 
bool IsVisibleLine (sal_Int32 nLine) const
 Returns true, if nLine is a valid and visible line index. More...
 
sal_Int32 GetHdrHeight () const
 Returns the height of the header line. More...
 
sal_Int32 GetLineHeight () const
 Returns the height of one line. More...
 
sal_Int32 GetY (sal_Int32 nLine) const
 Returns output Y coordinate of the specified line. More...
 
sal_Int32 GetLineFromY (sal_Int32 nY) const
 Returns line index from output coordinate. More...
 
sal_Int32 GetRulerCursorPos () const
 Returns the ruler cursor position. More...
 
sal_Int32 GetGridCursorPos () const
 Returns the data grid cursor position (not column index!). More...
 
- 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
 

Static Public Member Functions

static void ImplInvertRect (OutputDevice &rOutDev, const tools::Rectangle &rRect)
 Inverts a rectangle in the specified output device. More...
 
static ScMoveMode GetHorzDirection (sal_uInt16 nCode, bool bHomeEnd)
 Returns direction code for the keys LEFT, RIGHT, HOME, END. More...
 
static ScMoveMode GetVertDirection (sal_uInt16 nCode, bool bHomeEnd)
 Returns direction code for the keys UP, DOWN, HOME, END, PAGE UP, PAGE DOWN. More...
 
- Static Public Member Functions inherited from weld::CustomWidgetController
static bool IsUpdateMode ()
 

Protected Attributes

rtl::Reference< ScAccessibleCsvControlmxAccessible
 Content of virtual devices valid? More...
 

Private Attributes

Link< ScCsvControl &, void > maCmdHdl
 
ScCsvCmd maCmd
 External command handler. More...
 
const ScCsvLayoutDatamrData
 Data of last command. More...
 
bool mbValidGfx
 Shared layout data. More...
 

Detailed Description

Base class for the CSV ruler and the data grid control.

Implements command handling.

Definition at line 222 of file csvcontrol.hxx.

Constructor & Destructor Documentation

◆ ScCsvControl()

ScCsvControl::ScCsvControl ( const ScCsvLayoutData rData)
explicit

Reference to the accessible implementation object.

Definition at line 59 of file csvcontrol.cxx.

References mrData.

◆ ~ScCsvControl()

ScCsvControl::~ScCsvControl ( )
overridevirtual

Definition at line 65 of file csvcontrol.cxx.

References mxAccessible.

Member Function Documentation

◆ AccSendCaretEvent()

void ScCsvControl::AccSendCaretEvent ( )

Sends a caret changed event to the accessibility object.

Definition at line 92 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvRuler::MoveCursor().

◆ AccSendFocusEvent()

void ScCsvControl::AccSendFocusEvent ( bool  bFocused)

Sends a GetFocus or LoseFocus event to the accessibility object.

Definition at line 86 of file csvcontrol.cxx.

References mxAccessible.

Referenced by GetFocus(), and LoseFocus().

◆ AccSendInsertColumnEvent()

void ScCsvControl::AccSendInsertColumnEvent ( sal_uInt32  nFirstColumn,
sal_uInt32  nLastColumn 
)

Sends a table model changed event for an inserted column to the accessibility object.

Definition at line 116 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvGrid::ImplInsertSplit().

◆ AccSendRemoveColumnEvent()

void ScCsvControl::AccSendRemoveColumnEvent ( sal_uInt32  nFirstColumn,
sal_uInt32  nLastColumn 
)

Sends a table model changed event for a removed column to the accessibility object.

Definition at line 122 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvGrid::ImplClearSplits(), and ScCsvGrid::ImplRemoveSplit().

◆ AccSendSelectionEvent()

void ScCsvControl::AccSendSelectionEvent ( )

Sends a selection changed event to the accessibility object.

Definition at line 104 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvGrid::Select(), ScCsvGrid::SelectRange(), and ScCsvGrid::SetColumnStates().

◆ AccSendTableUpdateEvent()

void ScCsvControl::AccSendTableUpdateEvent ( sal_uInt32  nFirstColumn,
sal_uInt32  nLastColumn,
bool  bAllRows = true 
)

Sends a table model changed event for changed cell contents to the accessibility object.

Definition at line 110 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvGrid::ImplInsertSplit(), ScCsvGrid::ImplRemoveSplit(), ScCsvGrid::MoveSplit(), ScCsvGrid::SetColumnStates(), and ScCsvGrid::SetColumnType().

◆ AccSendVisibleEvent()

void ScCsvControl::AccSendVisibleEvent ( )

Sends a visible area changed event to the accessibility object.

Definition at line 98 of file csvcontrol.cxx.

References mxAccessible.

Referenced by ScCsvGrid::ApplyLayout(), and ScCsvRuler::ApplyLayout().

◆ DisableRepaint()

void ScCsvControl::DisableRepaint ( )

◆ EnableRepaint()

void ScCsvControl::EnableRepaint ( )

◆ Execute()

void ScCsvControl::Execute ( ScCsvCmdType  eType,
sal_Int32  nParam1 = CSV_POS_INVALID,
sal_Int32  nParam2 = CSV_POS_INVALID 
)

◆ GetAccessible()

ScAccessibleCsvControl * ScCsvControl::GetAccessible ( )
inline

◆ GetCharWidth()

sal_Int32 ScCsvControl::GetCharWidth ( ) const
inline

◆ GetCmd()

const ScCsvCmd & ScCsvControl::GetCmd ( ) const
inline

Returns data of the last command.

Definition at line 284 of file csvcontrol.hxx.

◆ GetFirstVisLine()

sal_Int32 ScCsvControl::GetFirstVisLine ( ) const
inline

◆ GetFirstVisPos()

sal_Int32 ScCsvControl::GetFirstVisPos ( ) const
inline

◆ GetFirstX()

sal_Int32 ScCsvControl::GetFirstX ( ) const

◆ GetFocus()

void ScCsvControl::GetFocus ( )
overridevirtual

Reimplemented from weld::CustomWidgetController.

Reimplemented in ScCsvGrid, and ScCsvRuler.

Definition at line 74 of file csvcontrol.cxx.

References AccSendFocusEvent(), and weld::CustomWidgetController::GetFocus().

Referenced by ScCsvGrid::GetFocus(), and ScCsvRuler::GetFocus().

◆ GetGridCursorPos()

sal_Int32 ScCsvControl::GetGridCursorPos ( ) const
inline

Returns the data grid cursor position (not column index!).

Definition at line 358 of file csvcontrol.hxx.

References mrData.

Referenced by ScCsvGrid::GetFocus(), and ScCsvGrid::GetFocusColumn().

◆ GetHdrHeight()

sal_Int32 ScCsvControl::GetHdrHeight ( ) const
inline

◆ GetHdrWidth()

sal_Int32 ScCsvControl::GetHdrWidth ( ) const
inline

◆ GetHdrX()

sal_Int32 ScCsvControl::GetHdrX ( ) const

Returns the start position of the header column.

Definition at line 180 of file csvcontrol.cxx.

References GetHdrWidth(), IsRTL(), ScCsvLayoutData::mnWinWidth, and mrData.

Referenced by ScCsvGrid::ImplDrawRowHeaders(), and ScAccessibleCsvCell::implGetRealPos().

◆ GetHorzDirection()

ScMoveMode ScCsvControl::GetHorzDirection ( sal_uInt16  nCode,
bool  bHomeEnd 
)
static

Returns direction code for the keys LEFT, RIGHT, HOME, END.

Parameters
bHomeEndfalse = ignore HOME and END key.

Definition at line 252 of file csvcontrol.cxx.

References KEY_END, KEY_HOME, KEY_LEFT, KEY_RIGHT, MOVE_FIRST, MOVE_LAST, MOVE_NEXT, MOVE_NONE, and MOVE_PREV.

Referenced by ScCsvGrid::KeyInput(), and ScCsvRuler::KeyInput().

◆ GetLastVisLine()

sal_Int32 ScCsvControl::GetLastVisLine ( ) const

◆ GetLastVisPos()

sal_Int32 ScCsvControl::GetLastVisPos ( ) const
inline

◆ GetLastX()

sal_Int32 ScCsvControl::GetLastX ( ) const

◆ GetLayoutData()

const ScCsvLayoutData & ScCsvControl::GetLayoutData ( ) const
inline

Returns a reference to the current layout data.

Definition at line 295 of file csvcontrol.hxx.

References mrData.

Referenced by ScCsvGrid::ApplyLayout(), and ScCsvRuler::ApplyLayout().

◆ GetLineCount()

sal_Int32 ScCsvControl::GetLineCount ( ) const
inline

Returns the number of data lines.

Definition at line 331 of file csvcontrol.hxx.

References mrData.

Referenced by GetLastVisLine(), GetMaxLineOffset(), and IsValidLine().

◆ GetLineFromY()

sal_Int32 ScCsvControl::GetLineFromY ( sal_Int32  nY) const

Returns line index from output coordinate.

Definition at line 235 of file csvcontrol.cxx.

References GetFirstVisLine(), GetHdrHeight(), and GetLineHeight().

Referenced by ScAccessibleCsvGrid::getAccessibleAtPoint().

◆ GetLineHeight()

sal_Int32 ScCsvControl::GetLineHeight ( ) const
inline

◆ GetMaxLineOffset()

sal_Int32 ScCsvControl::GetMaxLineOffset ( ) const

Returns highest possible index for first line.

Definition at line 215 of file csvcontrol.cxx.

References GetLineCount(), and GetVisLineCount().

Referenced by ScCsvGrid::ScrollVertRel().

◆ GetMaxPosOffset()

sal_Int32 ScCsvControl::GetMaxPosOffset ( ) const

Returns highest possible position for first visible character.

Definition at line 165 of file csvcontrol.cxx.

References GetPosCount(), and GetVisPosCount().

Referenced by ScCsvGrid::GetNoScrollCol(), and ScCsvRuler::GetNoScrollPos().

◆ GetPosCount()

sal_Int32 ScCsvControl::GetPosCount ( ) const
inline

◆ GetPosFromX()

sal_Int32 ScCsvControl::GetPosFromX ( sal_Int32  nX) const

◆ GetRulerCursorPos()

sal_Int32 ScCsvControl::GetRulerCursorPos ( ) const
inline

◆ GetVertDirection()

ScMoveMode ScCsvControl::GetVertDirection ( sal_uInt16  nCode,
bool  bHomeEnd 
)
static

Returns direction code for the keys UP, DOWN, HOME, END, PAGE UP, PAGE DOWN.

Parameters
bHomeEndfalse = ignore HOME and END key.

Definition at line 267 of file csvcontrol.cxx.

References KEY_DOWN, KEY_END, KEY_HOME, KEY_PAGEDOWN, KEY_PAGEUP, KEY_UP, MOVE_FIRST, MOVE_LAST, MOVE_NEXT, MOVE_NEXTPAGE, MOVE_NONE, MOVE_PREV, and MOVE_PREVPAGE.

Referenced by ScCsvGrid::KeyInput(), and ScCsvRuler::KeyInput().

◆ GetVisLineCount()

sal_Int32 ScCsvControl::GetVisLineCount ( ) const

Returns the number of visible lines (including partly visible bottom line).

Definition at line 205 of file csvcontrol.cxx.

References GetHdrHeight(), GetLineHeight(), ScCsvLayoutData::mnWinHeight, and mrData.

Referenced by GetLastVisLine(), GetMaxLineOffset(), ScCsvGrid::ScrollVertRel(), and ScCsvRuler::ScrollVertRel().

◆ GetVisPosCount()

sal_Int32 ScCsvControl::GetVisPosCount ( ) const

Returns the number of visible positions.

Definition at line 160 of file csvcontrol.cxx.

References GetCharWidth(), GetHdrWidth(), ScCsvLayoutData::mnWinWidth, and mrData.

Referenced by GetMaxPosOffset(), ScCsvGrid::ImplDrawHorzScrolled(), and ScCsvGrid::MoveCursor().

◆ GetX()

sal_Int32 ScCsvControl::GetX ( sal_Int32  nPos) const

◆ GetY()

sal_Int32 ScCsvControl::GetY ( sal_Int32  nLine) const

◆ ImplInvertRect()

void ScCsvControl::ImplInvertRect ( OutputDevice rOutDev,
const tools::Rectangle rRect 
)
static

◆ InvalidateGfx()

void ScCsvControl::InvalidateGfx ( )
inline

◆ IsNoRepaint()

bool ScCsvControl::IsNoRepaint ( ) const
inline

Returns true, if controls will not repaint.

Definition at line 277 of file csvcontrol.hxx.

References mrData.

Referenced by EnableRepaint(), and Repaint().

◆ IsRTL()

bool ScCsvControl::IsRTL ( ) const
inline

Returns true, if the Right-to-Left layout mode is active.

Definition at line 297 of file csvcontrol.hxx.

References mrData.

Referenced by GetFirstX(), GetHdrX(), GetLastX(), and ScCsvGrid::ImplDrawRowHeaders().

◆ IsValidGfx()

bool ScCsvControl::IsValidGfx ( ) const
inline

Returns true, if cached graphic is valid.

Definition at line 267 of file csvcontrol.hxx.

Referenced by ScCsvGrid::ImplDrawHorzScrolled(), ScCsvGrid::ImplRedraw(), and ScCsvRuler::ImplRedraw().

◆ IsValidLine()

bool ScCsvControl::IsValidLine ( sal_Int32  nLine) const

Returns true, if nLine is a valid line index.

Definition at line 220 of file csvcontrol.cxx.

References GetLineCount().

Referenced by IsVisibleLine().

◆ IsValidSplitPos()

bool ScCsvControl::IsValidSplitPos ( sal_Int32  nPos) const

Returns true, if it is allowed to set a split at nPos.

Definition at line 170 of file csvcontrol.cxx.

References GetPosCount(), and nPos.

Referenced by ScCsvRuler::FindEmptyPos(), and IsVisibleSplitPos().

◆ IsVisibleLine()

bool ScCsvControl::IsVisibleLine ( sal_Int32  nLine) const

Returns true, if nLine is a valid and visible line index.

Definition at line 225 of file csvcontrol.cxx.

References GetFirstVisLine(), GetLastVisLine(), and IsValidLine().

Referenced by ScCsvGrid::ImplDrawFirstLineSep().

◆ IsVisibleSplitPos()

bool ScCsvControl::IsVisibleSplitPos ( sal_Int32  nPos) const

◆ LoseFocus()

void ScCsvControl::LoseFocus ( )
overridevirtual

Reimplemented from weld::CustomWidgetController.

Reimplemented in ScCsvGrid, and ScCsvRuler.

Definition at line 80 of file csvcontrol.cxx.

References AccSendFocusEvent(), and weld::CustomWidgetController::LoseFocus().

Referenced by ScCsvGrid::LoseFocus(), and ScCsvRuler::LoseFocus().

◆ Repaint()

void ScCsvControl::Repaint ( bool  bInvalidate = false)

◆ SetCmdHdl()

void ScCsvControl::SetCmdHdl ( const Link< ScCsvControl &, void > &  rHdl)
inline

Sets a new command handler.

Definition at line 282 of file csvcontrol.hxx.

◆ ValidateGfx()

void ScCsvControl::ValidateGfx ( )
inline

Sets the graphic valid (next Redraw() will use cached graphic).

Definition at line 265 of file csvcontrol.hxx.

Referenced by ScCsvGrid::ImplRedraw(), ScCsvRuler::ImplRedraw(), ScCsvGrid::InsertSplit(), ScCsvGrid::MoveSplit(), and ScCsvGrid::RemoveSplit().

Member Data Documentation

◆ maCmd

ScCsvCmd ScCsvControl::maCmd
private

External command handler.

Definition at line 226 of file csvcontrol.hxx.

Referenced by Execute().

◆ maCmdHdl

Link<ScCsvControl&,void> ScCsvControl::maCmdHdl
private

Definition at line 225 of file csvcontrol.hxx.

Referenced by Execute().

◆ mbValidGfx

bool ScCsvControl::mbValidGfx
private

Shared layout data.

Definition at line 229 of file csvcontrol.hxx.

◆ mrData

const ScCsvLayoutData& ScCsvControl::mrData
private

Data of last command.

Definition at line 227 of file csvcontrol.hxx.

Referenced by DisableRepaint(), EnableRepaint(), GetHdrX(), GetLastX(), GetVisLineCount(), and GetVisPosCount().

◆ mxAccessible

rtl::Reference<ScAccessibleCsvControl> ScCsvControl::mxAccessible
protected

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