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 &, voidmaUpdateTextHdl
 connect the grid to its drawingarea More...
 
Link< ScCsvTableBox &, voidmaColTypeHdl
 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 44 of file csvtablebox.hxx.

Constructor & Destructor Documentation

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

false = Separators, true = Fixed width.

Definition at line 25 of file csvtablebox.cxx.

References InitControls(), LINK, maData, maEndScrollIdle, mbFixedMode, mnFixedWidth, mxGrid, mxRuler, mxScroll, Timer::SetInvokeHandler(), and Task::SetPriority().

ScCsvTableBox::~ScCsvTableBox ( )

Definition at line 55 of file csvtablebox.cxx.

Member Function Documentation

ScCsvTableBox::DECL_DLLPRIVATE_LINK ( CsvCmdHdl  ,
ScCsvControl ,
void   
)
private
ScCsvTableBox::DECL_DLLPRIVATE_LINK ( HScrollHdl  ,
weld::ScrolledWindow ,
void   
)
private
ScCsvTableBox::DECL_DLLPRIVATE_LINK ( VScrollHdl  ,
weld::ScrolledWindow ,
void   
)
private
ScCsvTableBox::DECL_DLLPRIVATE_LINK ( ScrollEndHdl  ,
Timer ,
void   
)
private
void ScCsvTableBox::FillColumnData ( ScAsciiOptions rOptions) const

Fills the options object with current column data.

Definition at line 196 of file csvtablebox.cxx.

References mbFixedMode, and mxGrid.

ScCsvGrid& ScCsvTableBox::GetGrid ( )
inline

Definition at line 82 of file csvtablebox.hxx.

Referenced by ScAccessibleCsvRuler::getAccessibleRelationSet().

ScCsvRuler& ScCsvTableBox::GetRuler ( )
inline

Definition at line 81 of file csvtablebox.hxx.

Referenced by ScAccessibleCsvGrid::getAccessibleRelationSet().

sal_Int32 ScCsvTableBox::GetSelColumnType ( ) const
inline

Returns the data type of the selected columns.

Definition at line 114 of file csvtablebox.hxx.

SAL_DLLPRIVATE void ScCsvTableBox::ImplSetLineOffset ( sal_Int32  nLine)
inlineprivate

Calculates and sets valid line offset nearest to nLine.

Definition at line 97 of file csvtablebox.hxx.

References ScCsvLayoutData::mnLineOffset.

SAL_DLLPRIVATE void ScCsvTableBox::ImplSetPosOffset ( sal_Int32  nPos)
inlineprivate

Calculates and sets valid position offset nearest to nPos.

Definition at line 94 of file csvtablebox.hxx.

References ScCsvLayoutData::mnPosOffset.

void ScCsvTableBox::Init ( void  )

Finishes initialization.

Must be called after constructing a new object.

Definition at line 100 of file csvtablebox.cxx.

References mxGrid.

void ScCsvTableBox::InitControls ( )
void ScCsvTableBox::InitHScrollBar ( )
private

Initializes size and position data of horizontal scrollbar.

Definition at line 130 of file csvtablebox.cxx.

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

Referenced by InitControls().

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

Reads UI strings for data types from the list box.

Definition at line 187 of file csvtablebox.cxx.

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

void ScCsvTableBox::InitVScrollBar ( )
private

Initializes size and position data of vertical scrollbar.

Definition at line 146 of file csvtablebox.cxx.

References mxGrid, and mxScroll.

Referenced by InitControls().

void ScCsvTableBox::MakePosVisible ( sal_Int32  nPos)
private

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

Definition at line 153 of file csvtablebox.cxx.

References CSV_SCROLL_DIST, CSVCMD_SETPOSOFFSET, and mxGrid.

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

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

Definition at line 124 of file csvtablebox.hxx.

void ScCsvTableBox::SetFixedWidthMode ( )

Sets the control to fixed width mode.

Definition at line 81 of file csvtablebox.cxx.

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

void ScCsvTableBox::SetSeparatorsMode ( )

Sets the control to separators mode.

Definition at line 61 of file csvtablebox.cxx.

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

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 166 of file csvtablebox.cxx.

References CSV_PREVIEW_LINES, mbFixedMode, and mxGrid.

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

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

Definition at line 122 of file csvtablebox.hxx.

Member Data Documentation

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

Updates all cell texts.

Definition at line 56 of file csvtablebox.hxx.

ScCsvLayoutData ScCsvTableBox::maData
private

Definition at line 47 of file csvtablebox.hxx.

Referenced by InitControls().

Idle ScCsvTableBox::maEndScrollIdle
private

Handler for exporting the column type.

Definition at line 58 of file csvtablebox.hxx.

Referenced by ScCsvTableBox().

ScCsvColStateVec ScCsvTableBox::maFixColStates
private

Called when horizontal scrolling has ended.

Definition at line 60 of file csvtablebox.hxx.

Referenced by SetFixedWidthMode(), and SetSeparatorsMode().

ScCsvColStateVec ScCsvTableBox::maSepColStates
private

Column states in fixed width mode.

Definition at line 61 of file csvtablebox.hxx.

Referenced by SetFixedWidthMode(), and SetSeparatorsMode().

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

connect the grid to its drawingarea

Definition at line 55 of file csvtablebox.hxx.

bool ScCsvTableBox::mbFixedMode
private

Cached total width for fixed width mode.

Definition at line 65 of file csvtablebox.hxx.

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

sal_Int32 ScCsvTableBox::mnFixedWidth
private

Column states in separators mode.

Definition at line 63 of file csvtablebox.hxx.

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

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

Connect the ruler to its drawingarea.

Definition at line 53 of file csvtablebox.hxx.

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

Current layout data of the controls.

Definition at line 49 of file csvtablebox.hxx.

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

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

Scrolled Window.

Definition at line 52 of file csvtablebox.hxx.

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

Calc-like data table for fixed width mode.

Definition at line 51 of file csvtablebox.hxx.

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


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