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

The control in the CSV import dialog that contains a ruler and a data grid to visualize and modify the current import settings. More...

#include <csvtablebox.hxx>

Collaboration diagram for ScCsvTableBox:
[legend]

Public Member Functions

 ScCsvTableBox (weld::Builder &rBuilder)
 false = Separators, true = Fixed width. More...
 
 ~ScCsvTableBox ()
 
void Init ()
 Finishes initialization. More...
 
void SetSeparatorsMode ()
 Sets the control to separators mode. More...
 
void SetFixedWidthMode ()
 Sets the control to fixed width mode. More...
 
ScCsvRulerGetRuler ()
 
ScCsvGridGetGrid ()
 
SAL_DLLPRIVATE void InitControls ()
 Initializes the children controls (pos/size, scroll bars, ...). More...
 
void SetUniStrings (const OUString *pTextLines, const OUString &rSepChars, sal_Unicode cTextSep, bool bMergeSep, bool bRemoveSpace)
 Fills all cells of all lines with the passed texts (Unicode strings). More...
 
void InitTypes (const weld::ComboBox &rListBox)
 Reads UI strings for data types from the list box. More...
 
sal_Int32 GetSelColumnType () const
 Returns the data type of the selected columns. More...
 
void FillColumnData (ScAsciiOptions &rOptions) const
 Fills the options object with current column data. More...
 
void SetUpdateTextHdl (const Link< ScCsvTableBox &, void > &rHdl)
 Sets a new handler for "update cell texts" requests. More...
 
void SetColTypeHdl (const Link< ScCsvTableBox &, void > &rHdl)
 Sets a new handler for "column selection changed" events. More...
 

Private Member Functions

SAL_DLLPRIVATE void InitHScrollBar ()
 Initializes size and position data of horizontal scrollbar. More...
 
SAL_DLLPRIVATE void InitVScrollBar ()
 Initializes size and position data of vertical scrollbar. More...
 
SAL_DLLPRIVATE void ImplSetPosOffset (sal_Int32 nPos)
 Calculates and sets valid position offset nearest to nPos. More...
 
SAL_DLLPRIVATE void ImplSetLineOffset (sal_Int32 nLine)
 Calculates and sets valid line offset nearest to nLine. More...
 
SAL_DLLPRIVATE void MakePosVisible (sal_Int32 nPos)
 Moves controls (not cursors!) so that nPos becomes visible. More...
 
 DECL_DLLPRIVATE_LINK (CsvCmdHdl, ScCsvControl &, void)
 
 DECL_DLLPRIVATE_LINK (HScrollHdl, weld::ScrolledWindow &, void)
 
 DECL_DLLPRIVATE_LINK (VScrollHdl, weld::ScrolledWindow &, void)
 
 DECL_DLLPRIVATE_LINK (ScrollEndHdl, Timer *, void)
 

Private Attributes

ScCsvLayoutData maData
 
std::unique_ptr< ScCsvRulermxRuler
 Current layout data of the controls. More...
 
std::unique_ptr< ScCsvGridmxGrid
 The ruler for fixed width mode. More...
 
std::unique_ptr< weld::ScrolledWindowmxScroll
 Calc-like data table for fixed width mode. More...
 
std::unique_ptr< weld::CustomWeldmxRulerWeld
 Scrolled Window. More...
 
std::unique_ptr< weld::CustomWeldmxGridWeld
 Connect the ruler to its drawingarea. More...
 
Link< ScCsvTableBox &, void > maUpdateTextHdl
 connect the grid to its drawingarea More...
 
Link< ScCsvTableBox &, void > maColTypeHdl
 Updates all cell texts. More...
 
Idle maEndScrollIdle
 Handler for exporting the column type. More...
 
ScCsvColStateVec maFixColStates
 Called when horizontal scrolling has ended. More...
 
ScCsvColStateVec maSepColStates
 Column states in fixed width mode. More...
 
sal_Int32 mnFixedWidth
 Column states in separators mode. More...
 
bool mbFixedMode
 Cached total width for fixed width mode. More...
 

Detailed Description

The control in the CSV import dialog that contains a ruler and a data grid to visualize and modify the current import settings.

Definition at line 43 of file csvtablebox.hxx.

Constructor & Destructor Documentation

◆ ScCsvTableBox()

ScCsvTableBox::ScCsvTableBox ( weld::Builder rBuilder)
explicit

◆ ~ScCsvTableBox()

ScCsvTableBox::~ScCsvTableBox ( )

Definition at line 53 of file csvtablebox.cxx.

Member Function Documentation

◆ DECL_DLLPRIVATE_LINK() [1/4]

ScCsvTableBox::DECL_DLLPRIVATE_LINK ( CsvCmdHdl  ,
ScCsvControl ,
void   
)
private

◆ DECL_DLLPRIVATE_LINK() [2/4]

ScCsvTableBox::DECL_DLLPRIVATE_LINK ( HScrollHdl  ,
weld::ScrolledWindow ,
void   
)
private

◆ DECL_DLLPRIVATE_LINK() [3/4]

ScCsvTableBox::DECL_DLLPRIVATE_LINK ( ScrollEndHdl  ,
Timer ,
void   
)
private

◆ DECL_DLLPRIVATE_LINK() [4/4]

ScCsvTableBox::DECL_DLLPRIVATE_LINK ( VScrollHdl  ,
weld::ScrolledWindow ,
void   
)
private

◆ FillColumnData()

void ScCsvTableBox::FillColumnData ( ScAsciiOptions rOptions) const

Fills the options object with current column data.

Definition at line 194 of file csvtablebox.cxx.

References mbFixedMode, and mxGrid.

◆ GetGrid()

ScCsvGrid & ScCsvTableBox::GetGrid ( )
inline

Definition at line 81 of file csvtablebox.hxx.

Referenced by ScAccessibleCsvRuler::getAccessibleRelationSet().

◆ GetRuler()

ScCsvRuler & ScCsvTableBox::GetRuler ( )
inline

Definition at line 80 of file csvtablebox.hxx.

Referenced by ScAccessibleCsvGrid::getAccessibleRelationSet().

◆ GetSelColumnType()

sal_Int32 ScCsvTableBox::GetSelColumnType ( ) const
inline

Returns the data type of the selected columns.

Definition at line 113 of file csvtablebox.hxx.

◆ ImplSetLineOffset()

SAL_DLLPRIVATE void ScCsvTableBox::ImplSetLineOffset ( sal_Int32  nLine)
inlineprivate

Calculates and sets valid line offset nearest to nLine.

Definition at line 96 of file csvtablebox.hxx.

References maData.

◆ ImplSetPosOffset()

SAL_DLLPRIVATE void ScCsvTableBox::ImplSetPosOffset ( sal_Int32  nPos)
inlineprivate

Calculates and sets valid position offset nearest to nPos.

Definition at line 93 of file csvtablebox.hxx.

References maData, and nPos.

◆ Init()

void ScCsvTableBox::Init ( void  )

Finishes initialization.

Must be called after constructing a new object.

Definition at line 98 of file csvtablebox.cxx.

References mxGrid.

◆ InitControls()

void ScCsvTableBox::InitControls ( )

◆ InitHScrollBar()

void ScCsvTableBox::InitHScrollBar ( )
private

Initializes size and position data of horizontal scrollbar.

Definition at line 128 of file csvtablebox.cxx.

References AllSettings::GetLayoutRTL(), mxGrid, mxScroll, and nValue.

Referenced by InitControls().

◆ InitTypes()

void ScCsvTableBox::InitTypes ( const weld::ComboBox rListBox)

Reads UI strings for data types from the list box.

Definition at line 185 of file csvtablebox.cxx.

References weld::ComboBox::get_count(), weld::ComboBox::get_text(), mxGrid, and nIndex.

◆ InitVScrollBar()

void ScCsvTableBox::InitVScrollBar ( )
private

Initializes size and position data of vertical scrollbar.

Definition at line 144 of file csvtablebox.cxx.

References mxGrid, and mxScroll.

Referenced by InitControls().

◆ MakePosVisible()

void ScCsvTableBox::MakePosVisible ( sal_Int32  nPos)
private

Moves controls (not cursors!) so that nPos becomes visible.

Definition at line 151 of file csvtablebox.cxx.

References CSV_SCROLL_DIST, CSVCMD_SETPOSOFFSET, mxGrid, and nPos.

◆ SetColTypeHdl()

void ScCsvTableBox::SetColTypeHdl ( const Link< ScCsvTableBox &, void > &  rHdl)
inline

Sets a new handler for "column selection changed" events.

Definition at line 123 of file csvtablebox.hxx.

◆ SetFixedWidthMode()

void ScCsvTableBox::SetFixedWidthMode ( )

Sets the control to fixed width mode.

Definition at line 79 of file csvtablebox.cxx.

References CSVCMD_SETLINEOFFSET, CSVCMD_SETPOSCOUNT, InitControls(), maFixColStates, maSepColStates, mbFixedMode, mnFixedWidth, mxGrid, and mxRuler.

◆ SetSeparatorsMode()

void ScCsvTableBox::SetSeparatorsMode ( )

Sets the control to separators mode.

Definition at line 59 of file csvtablebox.cxx.

References CSVCMD_NEWCELLTEXTS, CSVCMD_SETLINEOFFSET, CSVCMD_SETPOSCOUNT, InitControls(), maFixColStates, maSepColStates, mbFixedMode, mnFixedWidth, and mxGrid.

◆ SetUniStrings()

void ScCsvTableBox::SetUniStrings ( const OUString *  pTextLines,
const OUString &  rSepChars,
sal_Unicode  cTextSep,
bool  bMergeSep,
bool  bRemoveSpace 
)

Fills all cells of all lines with the passed texts (Unicode strings).

Definition at line 164 of file csvtablebox.cxx.

References CSV_PREVIEW_LINES, mbFixedMode, and mxGrid.

◆ SetUpdateTextHdl()

void ScCsvTableBox::SetUpdateTextHdl ( const Link< ScCsvTableBox &, void > &  rHdl)
inline

Sets a new handler for "update cell texts" requests.

Definition at line 121 of file csvtablebox.hxx.

Member Data Documentation

◆ maColTypeHdl

Link<ScCsvTableBox&,void> ScCsvTableBox::maColTypeHdl
private

Updates all cell texts.

Definition at line 55 of file csvtablebox.hxx.

◆ maData

ScCsvLayoutData ScCsvTableBox::maData
private

Definition at line 46 of file csvtablebox.hxx.

Referenced by InitControls().

◆ maEndScrollIdle

Idle ScCsvTableBox::maEndScrollIdle
private

Handler for exporting the column type.

Definition at line 57 of file csvtablebox.hxx.

Referenced by ScCsvTableBox().

◆ maFixColStates

ScCsvColStateVec ScCsvTableBox::maFixColStates
private

Called when horizontal scrolling has ended.

Definition at line 59 of file csvtablebox.hxx.

Referenced by SetFixedWidthMode(), and SetSeparatorsMode().

◆ maSepColStates

ScCsvColStateVec ScCsvTableBox::maSepColStates
private

Column states in fixed width mode.

Definition at line 60 of file csvtablebox.hxx.

Referenced by SetFixedWidthMode(), and SetSeparatorsMode().

◆ maUpdateTextHdl

Link<ScCsvTableBox&,void> ScCsvTableBox::maUpdateTextHdl
private

connect the grid to its drawingarea

Definition at line 54 of file csvtablebox.hxx.

◆ mbFixedMode

bool ScCsvTableBox::mbFixedMode
private

Cached total width for fixed width mode.

Definition at line 64 of file csvtablebox.hxx.

Referenced by FillColumnData(), InitControls(), ScCsvTableBox(), SetFixedWidthMode(), SetSeparatorsMode(), and SetUniStrings().

◆ mnFixedWidth

sal_Int32 ScCsvTableBox::mnFixedWidth
private

Column states in separators mode.

Definition at line 62 of file csvtablebox.hxx.

Referenced by ScCsvTableBox(), SetFixedWidthMode(), and SetSeparatorsMode().

◆ mxGrid

std::unique_ptr<ScCsvGrid> ScCsvTableBox::mxGrid
private

◆ mxGridWeld

std::unique_ptr<weld::CustomWeld> ScCsvTableBox::mxGridWeld
private

Connect the ruler to its drawingarea.

Definition at line 52 of file csvtablebox.hxx.

◆ mxRuler

std::unique_ptr<ScCsvRuler> ScCsvTableBox::mxRuler
private

Current layout data of the controls.

Definition at line 48 of file csvtablebox.hxx.

Referenced by InitControls(), ScCsvTableBox(), and SetFixedWidthMode().

◆ mxRulerWeld

std::unique_ptr<weld::CustomWeld> ScCsvTableBox::mxRulerWeld
private

Scrolled Window.

Definition at line 51 of file csvtablebox.hxx.

◆ mxScroll

std::unique_ptr<weld::ScrolledWindow> ScCsvTableBox::mxScroll
private

Calc-like data table for fixed width mode.

Definition at line 50 of file csvtablebox.hxx.

Referenced by InitHScrollBar(), InitVScrollBar(), and ScCsvTableBox().


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