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 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 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 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 ()
 
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
 

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 &, voidmaCmdHdl
 
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 223 of file csvcontrol.hxx.

Constructor & Destructor Documentation

ScCsvControl::ScCsvControl ( const ScCsvLayoutData rData)
explicit

Reference to the accessible implementation object.

Definition at line 59 of file csvcontrol.cxx.

References mrData.

ScCsvControl::~ScCsvControl ( )
overridevirtual

Definition at line 65 of file csvcontrol.cxx.

References mxAccessible.

Member Function Documentation

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().

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().

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().

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().

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().

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().

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 ScCsvRuler::ApplyLayout(), and ScCsvGrid::ApplyLayout().

void ScCsvControl::DisableRepaint ( )
void ScCsvControl::EnableRepaint ( )
void ScCsvControl::Execute ( ScCsvCmdType  eType,
sal_Int32  nParam1 = CSV_POS_INVALID,
sal_Int32  nParam2 = CSV_POS_INVALID 
)
ScAccessibleCsvControl* ScCsvControl::GetAccessible ( )
inline
sal_Int32 ScCsvControl::GetCharWidth ( ) const
inline
const ScCsvCmd& ScCsvControl::GetCmd ( ) const
inline

Returns data of the last command.

Definition at line 285 of file csvcontrol.hxx.

sal_Int32 ScCsvControl::GetFirstVisLine ( ) const
inline
sal_Int32 ScCsvControl::GetFirstVisPos ( ) const
inline
sal_Int32 ScCsvControl::GetFirstX ( ) const
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 ScCsvRuler::GetFocus(), and ScCsvGrid::GetFocus().

sal_Int32 ScCsvControl::GetGridCursorPos ( ) const
inline

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

Definition at line 359 of file csvcontrol.hxx.

References ScCsvLayoutData::mnColCursor.

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

sal_Int32 ScCsvControl::GetHdrHeight ( ) const
inline
sal_Int32 ScCsvControl::GetHdrWidth ( ) const
inline
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().

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 ScCsvRuler::KeyInput(), and ScCsvGrid::KeyInput().

sal_Int32 ScCsvControl::GetLastVisLine ( ) const
sal_Int32 ScCsvControl::GetLastVisPos ( ) const
inline
sal_Int32 ScCsvControl::GetLastX ( ) const
const ScCsvLayoutData& ScCsvControl::GetLayoutData ( ) const
inline

Returns a reference to the current layout data.

Definition at line 296 of file csvcontrol.hxx.

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

sal_Int32 ScCsvControl::GetLineCount ( ) const
inline

Returns the number of data lines.

Definition at line 332 of file csvcontrol.hxx.

References ScCsvLayoutData::mnLineCount.

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

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().

sal_Int32 ScCsvControl::GetLineHeight ( ) const
inline
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().

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().

sal_Int32 ScCsvControl::GetPosCount ( ) const
inline
sal_Int32 ScCsvControl::GetPosFromX ( sal_Int32  nX) const
sal_Int32 ScCsvControl::GetRulerCursorPos ( ) const
inline
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 ScCsvRuler::KeyInput(), and ScCsvGrid::KeyInput().

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(), ScCsvRuler::ScrollVertRel(), and ScCsvGrid::ScrollVertRel().

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().

sal_Int32 ScCsvControl::GetX ( sal_Int32  nPos) const
sal_Int32 ScCsvControl::GetY ( sal_Int32  nLine) const
void ScCsvControl::ImplInvertRect ( OutputDevice rOutDev,
const tools::Rectangle rRect 
)
static
void ScCsvControl::InvalidateGfx ( )
inline
bool ScCsvControl::IsNoRepaint ( ) const
inline

Returns true, if controls will not repaint.

Definition at line 278 of file csvcontrol.hxx.

References ScCsvLayoutData::mnNoRepaint.

Referenced by EnableRepaint(), and Repaint().

bool ScCsvControl::IsRTL ( ) const
inline

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

Definition at line 298 of file csvcontrol.hxx.

References ScCsvLayoutData::mbAppRTL.

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

bool ScCsvControl::IsValidGfx ( ) const
inline

Returns true, if cached graphic is valid.

Definition at line 268 of file csvcontrol.hxx.

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

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().

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().

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

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().

bool ScCsvControl::IsVisibleSplitPos ( sal_Int32  nPos) const
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 ScCsvRuler::LoseFocus(), and ScCsvGrid::LoseFocus().

void ScCsvControl::Repaint ( bool  bInvalidate = false)
void ScCsvControl::SetCmdHdl ( const Link< ScCsvControl &, void > &  rHdl)
inline

Sets a new command handler.

Definition at line 283 of file csvcontrol.hxx.

void ScCsvControl::ValidateGfx ( )
inline

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

Definition at line 266 of file csvcontrol.hxx.

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

Member Data Documentation

ScCsvCmd ScCsvControl::maCmd
private

External command handler.

Definition at line 227 of file csvcontrol.hxx.

Referenced by Execute().

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

Definition at line 226 of file csvcontrol.hxx.

Referenced by Execute().

bool ScCsvControl::mbValidGfx
private

Shared layout data.

Definition at line 230 of file csvcontrol.hxx.

const ScCsvLayoutData& ScCsvControl::mrData
private

Data of last command.

Definition at line 228 of file csvcontrol.hxx.

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

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

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