/** The control in the CSV import dialog that contains a ruler and a data grid
to visualize and modify the current import settings. */ class SC_DLLPUBLIC ScCsvTableBox
{ private:
ScCsvLayoutData maData; /// Current layout data of the controls.
std::unique_ptr<ScCsvRuler> mxRuler; /// The ruler for fixed width mode.
std::unique_ptr<ScCsvGrid> mxGrid; /// Calc-like data table for fixed width mode.
std::unique_ptr<weld::ScrolledWindow> mxScroll; /// Scrolled Window
std::unique_ptr<weld::CustomWeld> mxRulerWeld; /// Connect the ruler to its drawingarea
std::unique_ptr<weld::CustomWeld> mxGridWeld; /// connect the grid to its drawingarea
Link<ScCsvTableBox&,void> maUpdateTextHdl; /// Updates all cell texts.
Link<ScCsvTableBox&,void> maColTypeHdl; /// Handler for exporting the column type.
Idle maEndScrollIdle; /// Called when horizontal scrolling has ended
ScCsvColStateVec maFixColStates; /// Column states in fixed width mode.
ScCsvColStateVec maSepColStates; /// Column states in separators mode.
sal_Int32 mnFixedWidth; /// Cached total width for fixed width mode.
/** Finishes initialization. Must be called after constructing a new object. */ void Init();
// common table box handling ---------------------------------------------- public: void Refresh(); /** Sets the control to separators mode. */ void SetSeparatorsMode(); /** Sets the control to fixed width mode. */ void SetFixedWidthMode(); bool IsFixedWidthMode(){ return mbFixedMode; }
/** Initializes the children controls (pos/size, scroll bars, ...). */
SAL_DLLPRIVATE void InitControls();
private: /** Initializes size and position data of horizontal scrollbar. */
SAL_DLLPRIVATE void InitHScrollBar(); /** Initializes size and position data of vertical scrollbar. */
SAL_DLLPRIVATE void InitVScrollBar();
/** Calculates and sets valid position offset nearest to nPos. */
SAL_DLLPRIVATE void ImplSetPosOffset( sal_Int32 nPos )
{ maData.mnPosOffset = std::clamp( nPos, sal_Int32(0), mxGrid->GetMaxPosOffset() ); } /** Calculates and sets valid line offset nearest to nLine. */
SAL_DLLPRIVATE void ImplSetLineOffset( sal_Int32 nLine )
{ maData.mnLineOffset = std::clamp( nLine, sal_Int32(0), mxGrid->GetMaxLineOffset() ); } /** Moves controls (not cursors!) so that nPos becomes visible. */
SAL_DLLPRIVATE void MakePosVisible( sal_Int32 nPos );
// cell contents ---------------------------------------------------------- public: /** Fills all cells of all lines with the passed texts (Unicode strings). */ void SetUniStrings( const OUString* pTextLines, const OUString& rSepChars,
sal_Unicode cTextSep, bool bMergeSep, bool bRemoveSpace );
// column settings -------------------------------------------------------- public: /** Reads UI strings for data types from the list box. */ void InitTypes(const weld::ComboBox& rListBox); /** Returns the data type of the selected columns. */
sal_Int32 GetSelColumnType() const { return mxGrid->GetSelColumnType(); }
/** Fills the options object with current column data. */ void FillColumnData( ScAsciiOptions& rOptions ) const;
// event handling --------------------------------------------------------- public: /** Sets a new handler for "update cell texts" requests. */ void SetUpdateTextHdl( const Link<ScCsvTableBox&,void>& rHdl ) { maUpdateTextHdl = rHdl; } /** Sets a new handler for "column selection changed" events. */ void SetColTypeHdl( const Link<ScCsvTableBox&,void>& rHdl ) { maColTypeHdl = rHdl; }
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.