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

A data grid control for the CSV import dialog. More...

#include <csvgrid.hxx>

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

Public Member Functions

 ScCsvGrid (const ScCsvLayoutData &rData, std::unique_ptr< weld::Menu > xPopup, ScCsvTableBox *pTableBox)
 Mouse tracking mode: true = select, false = deselect. More...
 
virtual void SetDrawingArea (weld::DrawingArea *pDrawingArea) override
 
ScCsvTableBoxGetTableBox ()
 
virtual ~ScCsvGrid () override
 
void Init ()
 Finishes initialization. More...
 
void UpdateLayoutData ()
 Updates layout data dependent from the control's state. More...
 
void UpdateOffsetX ()
 Updates X coordinate of first visible position dependent from line numbers. More...
 
void ApplyLayout (const ScCsvLayoutData &rOldData)
 Apply current layout data to the grid control. More...
 
void SetFirstImportedLine (sal_Int32 nLine)
 Sets the number of the first imported line (for visual feedback). More...
 
sal_Int32 GetNoScrollCol (sal_Int32 nPos) const
 Finds a column position nearest to nPos which does not cause scrolling the visible area. More...
 
void InsertSplit (sal_Int32 nPos)
 Inserts a split. More...
 
void RemoveSplit (sal_Int32 nPos)
 Removes a split. More...
 
void MoveSplit (sal_Int32 nPos, sal_Int32 nNewPos)
 Inserts a new or removes an existing split. More...
 
void RemoveAllSplits ()
 Removes all splits. More...
 
void SetSplits (const ScCsvSplits &rSplits)
 Removes all splits and inserts the splits from rSplits. More...
 
sal_uInt32 GetColumnCount () const
 Returns the number of columns. More...
 
sal_uInt32 GetFirstVisColumn () const
 Returns the index of the first visible column. More...
 
sal_uInt32 GetLastVisColumn () const
 Returns the index of the last visible column. More...
 
bool IsValidColumn (sal_uInt32 nColIndex) const
 Returns true, if nColIndex points to an existing column. More...
 
bool IsVisibleColumn (sal_uInt32 nColIndex) const
 Returns true, if column with index nColIndex is (at least partly) visible. More...
 
sal_Int32 GetColumnX (sal_uInt32 nColIndex) const
 Returns X coordinate of the specified column. More...
 
sal_uInt32 GetColumnFromX (sal_Int32 nX) const
 Returns column index from output coordinate. More...
 
sal_Int32 GetColumnPos (sal_uInt32 nColIndex) const
 Returns start position of the column with the specified index. More...
 
sal_uInt32 GetColumnFromPos (sal_Int32 nPos) const
 Returns column index from position. More...
 
sal_Int32 GetColumnWidth (sal_uInt32 nColIndex) const
 Returns the character width of the column with the specified index. More...
 
const ScCsvColStateVecGetColumnStates () const
 Returns the vector with the states of all columns. More...
 
void SetColumnStates (const ScCsvColStateVec &rColStates)
 Sets all column states to the values in the passed vector. More...
 
sal_Int32 GetSelColumnType () const
 Returns the data type of the selected columns. More...
 
void SetSelColumnType (sal_Int32 nType)
 Changes the data type of all selected columns. More...
 
void SetTypeNames (const std::vector< OUString > &rTypeNames)
 Sets new UI data type names. More...
 
const OUString & GetColumnTypeName (sal_uInt32 nColIndex) const
 Returns the UI type name of the specified column. More...
 
void FillColumnDataSep (ScAsciiOptions &rOptions) const
 Fills the options object with column data for separators mode. More...
 
void FillColumnDataFix (ScAsciiOptions &rOptions) const
 Fills the options object with column data for fixed width mode. More...
 
bool IsSelected (sal_uInt32 nColIndex) const
 Returns true, if the specified column is selected. More...
 
sal_uInt32 GetFirstSelected () const
 Returns index of the first selected column. More...
 
sal_uInt32 GetNextSelected (sal_uInt32 nFromIndex) const
 Returns index of the first selected column really after nFromIndex. More...
 
void Select (sal_uInt32 nColIndex, bool bSelect=true)
 Selects or deselects the specified column. More...
 
void ToggleSelect (sal_uInt32 nColIndex)
 Toggles selection of the specified column. More...
 
void SelectRange (sal_uInt32 nColIndex1, sal_uInt32 nColIndex2, bool bSelect=true)
 Selects or deselects the specified column range. More...
 
void SelectAll (bool bSelect=true)
 Selects or deselects all columns. More...
 
sal_uInt32 GetFocusColumn () const
 Returns index of the focused column. More...
 
void ImplSetTextLineSep (sal_Int32 nLine, const OUString &rTextLine, const OUString &rSepChars, sal_Unicode cTextSep, bool bMergeSep, bool bRemoveSpace=false)
 Fills all cells of a line with the passed text (separators mode). More...
 
void ImplSetTextLineFix (sal_Int32 nLine, const OUString &rTextLine)
 Fills all cells of a line with the passed text (fixed width mode). More...
 
const OUString & GetCellText (sal_uInt32 nColIndex, sal_Int32 nLine) const
 Returns the text of the specified cell. More...
 
void ImplRedraw (vcl::RenderContext &rRenderContext)
 Redraws the entire data grid. More...
 
EditEngineGetEditEngine ()
 Returns a pointer to the used edit engine. More...
 
- Public Member Functions inherited from ScCsvControl
 ScCsvControl (const ScCsvLayoutData &rData)
 Reference to the accessible implementation object. More...
 
virtual ~ScCsvControl () 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 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
 
- Public Member Functions inherited from utl::ConfigurationListener
virtual ~ConfigurationListener ()
 
virtual void ConfigurationChanged (ConfigurationBroadcaster *p, ConfigurationHints nHint)=0
 

Protected Member Functions

virtual void Resize () override
 
virtual void GetFocus () override
 
virtual void LoseFocus () 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 bool Command (const CommandEvent &rCEvt) override
 
virtual tools::Rectangle GetFocusRect () override
 
virtual void StyleUpdated () override
 
virtual void ConfigurationChanged (::utl::ConfigurationBroadcaster *, ConfigurationHints) override
 
virtual void Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
 
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible () override
 Creates a new accessible object. More...
 

Private Types

typedef ::std::unique_ptr< ScEditEngineDefaulterScEditEnginePtr
 

Private Member Functions

SAL_DLLPRIVATE void InitColors ()
 Reads colors from system settings. More...
 
SAL_DLLPRIVATE void InitFonts ()
 Initializes all font settings. More...
 
SAL_DLLPRIVATE void InitSizeData ()
 Initializes all data dependent from the control's size. More...
 
SAL_DLLPRIVATE bool ImplInsertSplit (sal_Int32 nPos)
 Inserts a split and adjusts column data. More...
 
SAL_DLLPRIVATE bool ImplRemoveSplit (sal_Int32 nPos)
 Removes a split and adjusts column data. More...
 
SAL_DLLPRIVATE void ImplClearSplits ()
 Clears the split array and re-inserts boundary splits. More...
 
SAL_DLLPRIVATE sal_Int32 GetColumnType (sal_uInt32 nColIndex) const
 Returns the data type of the specified column. More...
 
SAL_DLLPRIVATE void SetColumnType (sal_uInt32 nColIndex, sal_Int32 nColType)
 Sets the data type of the specified column. More...
 
SAL_DLLPRIVATE void ScrollVertRel (ScMoveMode eDir)
 Scrolls data grid vertically. More...
 
SAL_DLLPRIVATE void ExecutePopup (const Point &rPos)
 Executes the data type popup menu. More...
 
SAL_DLLPRIVATE void MoveCursor (sal_uInt32 nColIndex)
 Moves column cursor to a new position. More...
 
SAL_DLLPRIVATE void MoveCursorRel (ScMoveMode eDir)
 Moves column cursor to the given direction. More...
 
SAL_DLLPRIVATE void ImplClearSelection ()
 Clears the entire selection without notify. More...
 
SAL_DLLPRIVATE void DoSelectAction (sal_uInt32 nColIndex, sal_uInt16 nModifier)
 Executes selection action for a specific column. More...
 
sal_Int32 GetWidth () const
 Returns the width of the control. More...
 
sal_Int32 GetHeight () const
 Returns the height of the control. More...
 
SAL_DLLPRIVATE void ImplSetColumnClipRegion (OutputDevice &rOutDev, sal_uInt32 nColIndex)
 Sets a clip region in the specified output device for the specified column. More...
 
SAL_DLLPRIVATE void ImplDrawColumnHeader (OutputDevice &rOutDev, sal_uInt32 nColIndex, Color aFillColor)
 Draws the header of the specified column to the specified output device. More...
 
SAL_DLLPRIVATE void ImplDrawCellText (const Point &rPos, const OUString &rText)
 Draws the text at the specified position to maBackgrDev. More...
 
SAL_DLLPRIVATE void ImplDrawFirstLineSep (bool bSet)
 Draws the "first imported line" separator to maBackgrDev (or erases, if bSet is false). More...
 
SAL_DLLPRIVATE void ImplDrawColumnBackgr (sal_uInt32 nColIndex)
 Draws the column with index nColIndex to maBackgrDev. More...
 
SAL_DLLPRIVATE void ImplDrawRowHeaders ()
 Draws the row headers column to maBackgrDev. More...
 
SAL_DLLPRIVATE void ImplDrawBackgrDev ()
 Draws all columns and the row headers column to maBackgrDev. More...
 
SAL_DLLPRIVATE void ImplDrawColumnSelection (sal_uInt32 nColIndex)
 Draws the column with index nColIndex with its selection state to maGridDev. More...
 
SAL_DLLPRIVATE void ImplDrawGridDev ()
 Draws all columns with selection and cursor to maGridDev. More...
 
SAL_DLLPRIVATE void ImplDrawColumn (sal_uInt32 nColIndex)
 Redraws the entire column (background and selection). More...
 
SAL_DLLPRIVATE void ImplDrawHorzScrolled (sal_Int32 nOldPos)
 Optimized drawing: Scrolls horizontally and redraws only missing parts. More...
 
SAL_DLLPRIVATE void ImplInvertCursor (sal_Int32 nPos)
 Inverts the cursor bar at the specified position in maGridDev. More...
 

Private Attributes

ScCsvTableBoxmpTableBox
 
VclPtr< VirtualDevicempBackgrDev
 Grid Parent. More...
 
VclPtr< VirtualDevicempGridDev
 Grid background, headers, cell texts. More...
 
std::unique_ptr< weld::MenumxPopup
 Data grid with selection and cursor. More...
 
::svtools::ColorConfigmpColorConfig
 Popup menu for column types. More...
 
Color maBackColor
 Application color configuration. More...
 
Color maGridColor
 Cell background color. More...
 
Color maGridPBColor
 Table grid color. More...
 
Color maAppBackColor
 Grid color for "first imported line" delimiter. More...
 
Color maTextColor
 Background color for unused area. More...
 
Color maHeaderBackColor
 Text color for data area. More...
 
Color maHeaderGridColor
 Background color for headers. More...
 
Color maHeaderTextColor
 Grid color for headers. More...
 
Color maSelectColor
 Text color for headers. More...
 
ScEditEnginePtr mpEditEngine
 Header color of selected columns. More...
 
vcl::Font maHeaderFont
 For drawing cell texts. More...
 
vcl::Font maMonoFont
 Font for column and row headers. More...
 
Size maWinSize
 Monospace font for data cells. More...
 
Size maEdEngSize
 Size of the control. More...
 
ScCsvSplits maSplits
 Paper size for edit engine. More...
 
ScCsvColStateVec maColStates
 Vector with split positions. More...
 
std::vector< OUString > maTypeNames
 State of each column. More...
 
std::vector< std::vector< OUString > > maTexts
 UI names of data types. More...
 
sal_Int32 mnFirstImpLine
 2D-vector for cell texts. More...
 
sal_uInt32 mnRecentSelCol
 First imported line (0-based). More...
 
sal_uInt32 mnMTCurrCol
 Index of most recently selected column. More...
 
bool mbTracking
 Current column of mouse tracking. More...
 
bool mbMTSelecting
 True if Mouse tracking. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ScCsvControl
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 inherited from ScCsvControl
rtl::Reference< ScAccessibleCsvControlmxAccessible
 Content of virtual devices valid? More...
 

Detailed Description

A data grid control for the CSV import dialog.

The design of this control simulates a Calc spreadsheet with row and column headers.

Definition at line 58 of file csvgrid.hxx.

Member Typedef Documentation

typedef ::std::unique_ptr< ScEditEngineDefaulter > ScCsvGrid::ScEditEnginePtr
private

Definition at line 61 of file csvgrid.hxx.

Constructor & Destructor Documentation

ScCsvGrid::ScCsvGrid ( const ScCsvLayoutData rData,
std::unique_ptr< weld::Menu xPopup,
ScCsvTableBox pTableBox 
)
explicit

Mouse tracking mode: true = select, false = deselect.

Definition at line 72 of file csvgrid.cxx.

References Create(), VclPtr< VirtualDevice >::get(), maEdEngSize, mpBackgrDev, mpEditEngine, and SAL_MAX_UINT32.

ScCsvGrid::~ScCsvGrid ( )
overridevirtual

Member Function Documentation

void ScCsvGrid::ApplyLayout ( const ScCsvLayoutData rOldData)
bool ScCsvGrid::Command ( const CommandEvent rCEvt)
overrideprotectedvirtual
void ScCsvGrid::ConfigurationChanged ( ::utl::ConfigurationBroadcaster ,
ConfigurationHints   
)
overrideprotectedvirtual

Definition at line 1056 of file csvgrid.cxx.

References InitColors(), and ScCsvControl::Repaint().

css::uno::Reference< css::accessibility::XAccessible > ScCsvGrid::CreateAccessible ( )
overrideprotectedvirtual

Creates a new accessible object.

Reimplemented from weld::CustomWidgetController.

Definition at line 1410 of file csvgrid.cxx.

References ScCsvControl::mxAccessible.

void ScCsvGrid::DoSelectAction ( sal_uInt32  nColIndex,
sal_uInt16  nModifier 
)
private
void ScCsvGrid::ExecutePopup ( const Point rPos)
private

Executes the data type popup menu.

Definition at line 616 of file csvgrid.cxx.

References CSVCMD_SETCOLUMNTYPE, ScCsvControl::Execute(), weld::CustomWidgetController::GetDrawingArea(), and mxPopup.

Referenced by Command().

void ScCsvGrid::FillColumnDataFix ( ScAsciiOptions rOptions) const

Fills the options object with column data for fixed width mode.

Definition at line 581 of file csvgrid.cxx.

References GetColumnCount(), GetColumnPos(), GetColumnType(), lcl_GetExtColumnType(), MAXCOLCOUNT, ScCsvExpData::mnIndex, ScCsvExpData::mnType, nCount, rData, SAL_MAX_INT32, SC_COL_SKIP, and ScAsciiOptions::SetColumnInfo().

void ScCsvGrid::FillColumnDataSep ( ScAsciiOptions rOptions) const

Fills the options object with column data for separators mode.

Definition at line 565 of file csvgrid.cxx.

References CSV_TYPE_DEFAULT, GetColumnCount(), GetColumnType(), lcl_GetExtColumnType(), nCount, and ScAsciiOptions::SetColumnInfo().

const OUString & ScCsvGrid::GetCellText ( sal_uInt32  nColIndex,
sal_Int32  nLine 
) const

Returns the text of the specified cell.

Definition at line 852 of file csvgrid.cxx.

References EMPTY_OUSTRING, ScCsvControl::GetFirstVisLine(), and maTexts.

Referenced by ScAccessibleCsvGrid::implGetCellText().

sal_uInt32 ScCsvGrid::GetColumnCount ( ) const
inline
sal_uInt32 ScCsvGrid::GetColumnFromPos ( sal_Int32  nPos) const

Returns column index from position.

A split counts to its following column.

Definition at line 477 of file csvgrid.cxx.

References maSplits, and ScCsvSplits::UpperBound().

Referenced by GetColumnFromX(), GetFirstVisColumn(), GetLastVisColumn(), ImplDrawHorzScrolled(), ImplInsertSplit(), ImplRemoveSplit(), InsertSplit(), MouseMove(), MoveSplit(), and RemoveSplit().

sal_uInt32 ScCsvGrid::GetColumnFromX ( sal_Int32  nX) const
sal_Int32 ScCsvGrid::GetColumnPos ( sal_uInt32  nColIndex) const
inline

Returns start position of the column with the specified index.

Definition at line 168 of file csvgrid.hxx.

Referenced by DoSelectAction(), FillColumnDataFix(), GetColumnWidth(), GetColumnX(), ScAccessibleCsvCell::grabFocus(), ImplDrawColumnBackgr(), IsVisibleColumn(), MoveCursor(), and MoveSplit().

const ScCsvColStateVec& ScCsvGrid::GetColumnStates ( ) const
inline

Returns the vector with the states of all columns.

Definition at line 175 of file csvgrid.hxx.

sal_Int32 ScCsvGrid::GetColumnType ( sal_uInt32  nColIndex) const
private

Returns the data type of the specified column.

Definition at line 496 of file csvgrid.cxx.

References CSV_TYPE_NOSELECTION, IsValidColumn(), and maColStates.

Referenced by FillColumnDataFix(), FillColumnDataSep(), GetColumnTypeName(), GetSelColumnType(), and ImplInsertSplit().

const OUString & ScCsvGrid::GetColumnTypeName ( sal_uInt32  nColIndex) const

Returns the UI type name of the specified column.

Definition at line 551 of file csvgrid.cxx.

References EMPTY_OUSTRING, GetColumnType(), and maTypeNames.

Referenced by ImplDrawColumnHeader(), and ScAccessibleCsvGrid::implGetCellText().

sal_Int32 ScCsvGrid::GetColumnWidth ( sal_uInt32  nColIndex) const

Returns the character width of the column with the specified index.

Definition at line 482 of file csvgrid.cxx.

References GetColumnPos(), and IsValidColumn().

Referenced by ScAccessibleCsvCell::implGetRealSize(), ImplSetTextLineFix(), and ImplSetTextLineSep().

sal_Int32 ScCsvGrid::GetColumnX ( sal_uInt32  nColIndex) const
EditEngine * ScCsvGrid::GetEditEngine ( )

Returns a pointer to the used edit engine.

Definition at line 1083 of file csvgrid.cxx.

References mpEditEngine.

Referenced by ScAccessibleCsvCell::implCreateEditSource().

sal_uInt32 ScCsvGrid::GetFirstSelected ( ) const
sal_uInt32 ScCsvGrid::GetFirstVisColumn ( ) const

Returns the index of the first visible column.

Definition at line 443 of file csvgrid.cxx.

References GetColumnFromPos(), and ScCsvControl::GetFirstVisPos().

Referenced by ImplDrawBackgrDev(), and ImplDrawGridDev().

void ScCsvGrid::GetFocus ( )
overrideprotectedvirtual
sal_uInt32 ScCsvGrid::GetFocusColumn ( ) const
inline

Returns index of the focused column.

Definition at line 221 of file csvgrid.hxx.

References ScCsvControl::GetGridCursorPos().

Referenced by Command(), ScAccessibleCsvCell::getAccessibleStateSet(), GetFocusRect(), KeyInput(), and MoveCursorRel().

tools::Rectangle ScCsvGrid::GetFocusRect ( )
overrideprotectedvirtual
sal_Int32 ScCsvGrid::GetHeight ( ) const
inlineprivate

Returns the height of the control.

Definition at line 279 of file csvgrid.hxx.

References Size::Height().

Referenced by Command(), GetFocusRect(), ImplDrawBackgrDev(), ImplDrawHorzScrolled(), ImplDrawRowHeaders(), and ImplSetColumnClipRegion().

sal_uInt32 ScCsvGrid::GetLastVisColumn ( ) const

Returns the index of the last visible column.

Definition at line 448 of file csvgrid.cxx.

References GetColumnFromPos(), ScCsvControl::GetLastVisPos(), and ScCsvControl::GetPosCount().

Referenced by ImplDrawBackgrDev(), ImplDrawFirstLineSep(), and ImplDrawGridDev().

sal_uInt32 ScCsvGrid::GetNextSelected ( sal_uInt32  nFromIndex) const
sal_Int32 ScCsvGrid::GetNoScrollCol ( sal_Int32  nPos) const

Finds a column position nearest to nPos which does not cause scrolling the visible area.

Definition at line 223 of file csvgrid.cxx.

References CSV_POS_INVALID, CSV_SCROLL_DIST, ScCsvControl::GetFirstVisPos(), ScCsvControl::GetLastVisPos(), and ScCsvControl::GetMaxPosOffset().

Referenced by GetFocus().

sal_Int32 ScCsvGrid::GetSelColumnType ( ) const

Returns the data type of the selected columns.

Definition at line 510 of file csvgrid.cxx.

References CSV_COLUMN_INVALID, CSV_TYPE_MULTI, CSV_TYPE_NOSELECTION, GetColumnType(), GetFirstSelected(), GetNextSelected(), and nType.

ScCsvTableBox* ScCsvGrid::GetTableBox ( )
inline

Definition at line 99 of file csvgrid.hxx.

Referenced by ScAccessibleCsvGrid::getAccessibleRelationSet().

sal_Int32 ScCsvGrid::GetWidth ( ) const
inlineprivate

Returns the width of the control.

Definition at line 277 of file csvgrid.hxx.

References Size::Width().

Referenced by Command(), and ImplDrawBackgrDev().

void ScCsvGrid::ImplClearSelection ( )
private

Clears the entire selection without notify.

Definition at line 741 of file csvgrid.cxx.

References ImplDrawGridDev(), and maColStates.

Referenced by DoSelectAction(), and KeyInput().

void ScCsvGrid::ImplClearSplits ( )
private
void ScCsvGrid::ImplDrawBackgrDev ( )
private
void ScCsvGrid::ImplDrawCellText ( const Point rPos,
const OUString &  rText 
)
private
void ScCsvGrid::ImplDrawColumn ( sal_uInt32  nColIndex)
private

Redraws the entire column (background and selection).

Definition at line 1320 of file csvgrid.cxx.

References ImplDrawColumnBackgr(), and ImplDrawColumnSelection().

Referenced by ImplDrawHorzScrolled(), InsertSplit(), MoveSplit(), and RemoveSplit().

void ScCsvGrid::ImplDrawColumnBackgr ( sal_uInt32  nColIndex)
private
void ScCsvGrid::ImplDrawColumnHeader ( OutputDevice rOutDev,
sal_uInt32  nColIndex,
Color  aFillColor 
)
private
void ScCsvGrid::ImplDrawColumnSelection ( sal_uInt32  nColIndex)
private
void ScCsvGrid::ImplDrawFirstLineSep ( bool  bSet)
private
void ScCsvGrid::ImplDrawGridDev ( )
private
void ScCsvGrid::ImplDrawHorzScrolled ( sal_Int32  nOldPos)
private
void ScCsvGrid::ImplDrawRowHeaders ( )
private
bool ScCsvGrid::ImplInsertSplit ( sal_Int32  nPos)
private
void ScCsvGrid::ImplInvertCursor ( sal_Int32  nPos)
private
void ScCsvGrid::ImplRedraw ( vcl::RenderContext rRenderContext)
bool ScCsvGrid::ImplRemoveSplit ( sal_Int32  nPos)
private
void ScCsvGrid::ImplSetColumnClipRegion ( OutputDevice rOutDev,
sal_uInt32  nColIndex 
)
private

Sets a clip region in the specified output device for the specified column.

Definition at line 1088 of file csvgrid.cxx.

References GetColumnX(), ScCsvControl::GetFirstX(), GetHeight(), ScCsvControl::GetLastX(), and OutputDevice::SetClipRegion().

Referenced by ImplDrawColumnBackgr(), and ImplDrawColumnSelection().

void ScCsvGrid::ImplSetTextLineFix ( sal_Int32  nLine,
const OUString &  rTextLine 
)
void ScCsvGrid::ImplSetTextLineSep ( sal_Int32  nLine,
const OUString &  rTextLine,
const OUString &  rSepChars,
sal_Unicode  cTextSep,
bool  bMergeSep,
bool  bRemoveSpace = false 
)
void ScCsvGrid::Init ( void  )

Finishes initialization.

Must be called after constructing a new object.

Definition at line 132 of file csvgrid.cxx.

References InitColors(), mpColorConfig, and SC_MOD.

void ScCsvGrid::InitColors ( )
private
void ScCsvGrid::InitFonts ( )
private
void ScCsvGrid::InitSizeData ( )
private

Initializes all data dependent from the control's size.

Definition at line 311 of file csvgrid.cxx.

References weld::CustomWidgetController::GetOutputSizePixel(), ScCsvControl::InvalidateGfx(), maWinSize, mpBackgrDev, mpGridDev, and VirtualDevice::SetOutputSizePixel().

Referenced by Resize().

void ScCsvGrid::InsertSplit ( sal_Int32  nPos)
bool ScCsvGrid::IsSelected ( sal_uInt32  nColIndex) const
bool ScCsvGrid::IsValidColumn ( sal_uInt32  nColIndex) const

Returns true, if nColIndex points to an existing column.

Definition at line 453 of file csvgrid.cxx.

References GetColumnCount().

Referenced by Command(), GetColumnType(), GetColumnWidth(), ImplSetTextLineSep(), IsSelected(), IsVisibleColumn(), MouseButtonDown(), MoveCursor(), Select(), SelectRange(), and SetColumnType().

bool ScCsvGrid::IsVisibleColumn ( sal_uInt32  nColIndex) const

Returns true, if column with index nColIndex is (at least partly) visible.

Definition at line 458 of file csvgrid.cxx.

References GetColumnPos(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetLastVisPos(), and IsValidColumn().

Referenced by GetFocusRect(), and ImplDrawColumnBackgr().

bool ScCsvGrid::KeyInput ( const KeyEvent rKEvt)
overrideprotectedvirtual
void ScCsvGrid::LoseFocus ( )
overrideprotectedvirtual

Reimplemented from ScCsvControl.

Definition at line 883 of file csvgrid.cxx.

References ScCsvControl::LoseFocus(), and ScCsvControl::Repaint().

bool ScCsvGrid::MouseButtonDown ( const MouseEvent rMEvt)
overrideprotectedvirtual
bool ScCsvGrid::MouseButtonUp ( const MouseEvent rMEvt)
overrideprotectedvirtual

Reimplemented from weld::CustomWidgetController.

Definition at line 917 of file csvgrid.cxx.

References mbTracking.

bool ScCsvGrid::MouseMove ( const MouseEvent rMEvt)
overrideprotectedvirtual
void ScCsvGrid::MoveCursor ( sal_uInt32  nColIndex)
private
void ScCsvGrid::MoveCursorRel ( ScMoveMode  eDir)
private

Moves column cursor to the given direction.

Definition at line 713 of file csvgrid.cxx.

References CSV_COLUMN_INVALID, GetColumnCount(), GetFocusColumn(), MOVE_FIRST, MOVE_LAST, MOVE_NEXT, MOVE_PREV, and MoveCursor().

Referenced by KeyInput().

void ScCsvGrid::MoveSplit ( sal_Int32  nPos,
sal_Int32  nNewPos 
)
void ScCsvGrid::Paint ( vcl::RenderContext rRenderContext,
const tools::Rectangle  
)
overrideprotectedvirtual

Implements weld::CustomWidgetController.

Definition at line 1064 of file csvgrid.cxx.

References ImplRedraw().

void ScCsvGrid::RemoveAllSplits ( )
void ScCsvGrid::RemoveSplit ( sal_Int32  nPos)
void ScCsvGrid::Resize ( )
overrideprotectedvirtual
void ScCsvGrid::ScrollVertRel ( ScMoveMode  eDir)
private
void ScCsvGrid::Select ( sal_uInt32  nColIndex,
bool  bSelect = true 
)
void ScCsvGrid::SelectAll ( bool  bSelect = true)
void ScCsvGrid::SelectRange ( sal_uInt32  nColIndex1,
sal_uInt32  nColIndex2,
bool  bSelect = true 
)
void ScCsvGrid::SetColumnStates ( const ScCsvColStateVec rColStates)
void ScCsvGrid::SetColumnType ( sal_uInt32  nColIndex,
sal_Int32  nColType 
)
private

Sets the data type of the specified column.

Definition at line 501 of file csvgrid.cxx.

References ScCsvControl::AccSendTableUpdateEvent(), IsValidColumn(), and maColStates.

Referenced by SetSelColumnType().

void ScCsvGrid::SetDrawingArea ( weld::DrawingArea pDrawingArea)
overridevirtual
void ScCsvGrid::SetFirstImportedLine ( sal_Int32  nLine)

Sets the number of the first imported line (for visual feedback).

nLine is 0-based!

Definition at line 214 of file csvgrid.cxx.

References ImplDrawFirstLineSep(), ImplDrawGridDev(), mnFirstImpLine, and ScCsvControl::Repaint().

void ScCsvGrid::SetSelColumnType ( sal_Int32  nType)
void ScCsvGrid::SetSplits ( const ScCsvSplits rSplits)
void ScCsvGrid::SetTypeNames ( const std::vector< OUString > &  rTypeNames)

Sets new UI data type names.

Definition at line 537 of file csvgrid.cxx.

References CSV_TYPE_DEFAULT, maColStates, maTypeNames, mxPopup, nCount, and ScCsvControl::Repaint().

void ScCsvGrid::StyleUpdated ( )
overrideprotectedvirtual
void ScCsvGrid::ToggleSelect ( sal_uInt32  nColIndex)

Toggles selection of the specified column.

Definition at line 658 of file csvgrid.cxx.

References IsSelected(), and Select().

Referenced by DoSelectAction(), and KeyInput().

void ScCsvGrid::UpdateLayoutData ( )
void ScCsvGrid::UpdateOffsetX ( )

Updates X coordinate of first visible position dependent from line numbers.

Definition at line 155 of file csvgrid.cxx.

References CSVCMD_SETHDRWIDTH, ScCsvControl::Execute(), weld::CustomWidgetController::GetDrawingArea(), and ScCsvControl::GetLastVisLine().

Referenced by ApplyLayout(), and UpdateLayoutData().

Member Data Documentation

Color ScCsvGrid::maAppBackColor
private

Grid color for "first imported line" delimiter.

Definition at line 72 of file csvgrid.hxx.

Referenced by ImplDrawBackgrDev(), ImplDrawHorzScrolled(), ImplDrawRowHeaders(), and InitColors().

Color ScCsvGrid::maBackColor
private

Application color configuration.

Definition at line 69 of file csvgrid.hxx.

Referenced by ImplDrawColumnBackgr(), and InitColors().

ScCsvColStateVec ScCsvGrid::maColStates
private
Size ScCsvGrid::maEdEngSize
private

Size of the control.

Definition at line 83 of file csvgrid.hxx.

Referenced by ImplDrawCellText(), and ScCsvGrid().

Color ScCsvGrid::maGridColor
private

Cell background color.

Definition at line 70 of file csvgrid.hxx.

Referenced by ImplDrawColumnBackgr(), ImplDrawFirstLineSep(), and InitColors().

Color ScCsvGrid::maGridPBColor
private

Table grid color.

Definition at line 71 of file csvgrid.hxx.

Referenced by ImplDrawFirstLineSep(), and InitColors().

Color ScCsvGrid::maHeaderBackColor
private

Text color for data area.

Definition at line 74 of file csvgrid.hxx.

Referenced by ImplDrawColumnBackgr(), ImplDrawColumnSelection(), ImplDrawRowHeaders(), and InitColors().

vcl::Font ScCsvGrid::maHeaderFont
private

For drawing cell texts.

Definition at line 80 of file csvgrid.hxx.

Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), InitFonts(), SetDrawingArea(), and UpdateLayoutData().

Color ScCsvGrid::maHeaderGridColor
private

Background color for headers.

Definition at line 75 of file csvgrid.hxx.

Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), and InitColors().

Color ScCsvGrid::maHeaderTextColor
private

Grid color for headers.

Definition at line 76 of file csvgrid.hxx.

Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), and InitColors().

vcl::Font ScCsvGrid::maMonoFont
private

Font for column and row headers.

Definition at line 81 of file csvgrid.hxx.

Referenced by InitFonts(), and UpdateLayoutData().

Color ScCsvGrid::maSelectColor
private

Text color for headers.

Definition at line 77 of file csvgrid.hxx.

Referenced by ImplDrawColumnSelection(), and InitColors().

ScCsvSplits ScCsvGrid::maSplits
private
Color ScCsvGrid::maTextColor
private

Background color for unused area.

Definition at line 73 of file csvgrid.hxx.

Referenced by ImplDrawCellText(), ImplDrawColumnBackgr(), and InitColors().

std::vector< std::vector<OUString> > ScCsvGrid::maTexts
private

UI names of data types.

Definition at line 88 of file csvgrid.hxx.

Referenced by GetCellText(), ImplDrawColumnBackgr(), ImplSetTextLineFix(), and ImplSetTextLineSep().

std::vector<OUString> ScCsvGrid::maTypeNames
private

State of each column.

Definition at line 87 of file csvgrid.hxx.

Referenced by GetColumnTypeName(), KeyInput(), and SetTypeNames().

Size ScCsvGrid::maWinSize
private

Monospace font for data cells.

Definition at line 82 of file csvgrid.hxx.

Referenced by Command(), ImplDrawColumnSelection(), ImplDrawGridDev(), ImplDrawHorzScrolled(), ImplRedraw(), and InitSizeData().

bool ScCsvGrid::mbMTSelecting
private

True if Mouse tracking.

Definition at line 94 of file csvgrid.hxx.

Referenced by DoSelectAction(), and MouseButtonDown().

bool ScCsvGrid::mbTracking
private

Current column of mouse tracking.

Definition at line 93 of file csvgrid.hxx.

Referenced by DoSelectAction(), MouseButtonDown(), MouseButtonUp(), and MouseMove().

sal_Int32 ScCsvGrid::mnFirstImpLine
private

2D-vector for cell texts.

Definition at line 90 of file csvgrid.hxx.

Referenced by ImplDrawFirstLineSep(), and SetFirstImportedLine().

sal_uInt32 ScCsvGrid::mnMTCurrCol
private

Index of most recently selected column.

Definition at line 92 of file csvgrid.hxx.

Referenced by MouseButtonDown(), and MouseMove().

sal_uInt32 ScCsvGrid::mnRecentSelCol
private

First imported line (0-based).

Definition at line 91 of file csvgrid.hxx.

Referenced by DoSelectAction(), KeyInput(), Select(), and SelectRange().

VclPtr<VirtualDevice> ScCsvGrid::mpBackgrDev
private
::svtools::ColorConfig* ScCsvGrid::mpColorConfig
private

Popup menu for column types.

Definition at line 68 of file csvgrid.hxx.

Referenced by Init(), InitColors(), and ~ScCsvGrid().

ScEditEnginePtr ScCsvGrid::mpEditEngine
private

Header color of selected columns.

Definition at line 79 of file csvgrid.hxx.

Referenced by GetEditEngine(), ImplDrawCellText(), ImplDrawColumnBackgr(), InitFonts(), and ScCsvGrid().

VclPtr<VirtualDevice> ScCsvGrid::mpGridDev
private

Grid background, headers, cell texts.

Definition at line 65 of file csvgrid.hxx.

Referenced by ImplDrawColumnSelection(), ImplDrawGridDev(), ImplDrawHorzScrolled(), ImplInvertCursor(), ImplRedraw(), InitSizeData(), and ~ScCsvGrid().

ScCsvTableBox* ScCsvGrid::mpTableBox
private

Definition at line 63 of file csvgrid.hxx.

Referenced by Resize().

std::unique_ptr<weld::Menu> ScCsvGrid::mxPopup
private

Data grid with selection and cursor.

Definition at line 66 of file csvgrid.hxx.

Referenced by ExecutePopup(), and SetTypeNames().


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