LibreOffice Module sc (master)
1
|
A data grid control for the CSV import dialog. More...
#include <csvgrid.hxx>
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 |
ScCsvTableBox * | GetTableBox () |
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 ScCsvColStateVec & | GetColumnStates () 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... | |
EditEngine * | GetEditEngine () |
Returns a pointer to the used edit engine. More... | |
![]() | |
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... | |
ScAccessibleCsvControl * | GetAccessible () |
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 ScCsvCmd & | GetCmd () 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 ScCsvLayoutData & | GetLayoutData () 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... | |
![]() | |
virtual FactoryFunction | GetUITestFactory () const |
virtual OUString | RequestHelp (tools::Rectangle &) |
virtual OUString | GetHelpText () const |
Size const & | GetOutputSizePixel () const |
void | SetOutputSizePixel (const Size &rSize) |
weld::DrawingArea * | GetDrawingArea () 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 | |
CustomWidgetController & | operator= (CustomWidgetController const &)=default |
CustomWidgetController & | operator= (CustomWidgetController &&)=default |
![]() | |
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< ScEditEngineDefaulter > | ScEditEnginePtr |
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 | |
ScCsvTableBox * | mpTableBox |
VclPtr< VirtualDevice > | mpBackgrDev |
Grid Parent. More... | |
VclPtr< VirtualDevice > | mpGridDev |
Grid background, headers, cell texts. More... | |
std::unique_ptr< weld::Menu > | mxPopup |
Data grid with selection and cursor. More... | |
::svtools::ColorConfig * | mpColorConfig |
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 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 bool | IsUpdateMode () |
![]() | |
rtl::Reference< ScAccessibleCsvControl > | mxAccessible |
Content of virtual devices valid? More... | |
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.
|
private |
Definition at line 61 of file csvgrid.hxx.
|
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.
|
overridevirtual |
Definition at line 122 of file csvgrid.cxx.
References VclPtr< VirtualDevice >::disposeAndClear(), mpBackgrDev, mpColorConfig, and mpGridDev.
void ScCsvGrid::ApplyLayout | ( | const ScCsvLayoutData & | rOldData | ) |
Apply current layout data to the grid control.
Definition at line 170 of file csvgrid.cxx.
References ScCsvControl::AccSendVisibleEvent(), ScCsvSplits::Count(), CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), Equal, ScCsvControl::Execute(), ScCsvLayoutData::GetDiff(), ScCsvControl::GetLayoutData(), ScCsvControl::GetPosCount(), ScCsvControl::GetRulerCursorPos(), HorizontalMask, ImplDrawHorzScrolled(), ImplInvertCursor(), ScCsvSplits::Insert(), ScCsvControl::InvalidateGfx(), LineOffset, maColStates, maSplits, ScCsvLayoutData::mnPosCount, ScCsvLayoutData::mnPosCursor, ScCsvLayoutData::mnPosOffset, PosCount, PosOffset, ScCsvSplits::Remove(), ScCsvSplits::RemoveRange(), RulerCursor, SelectAll(), UpdateOffsetX(), and VerticalMask.
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 1001 of file csvgrid.cxx.
References CSVCMD_SETLINEOFFSET, DoSelectAction(), ScCsvControl::Execute(), ExecutePopup(), GetColumnFromX(), GetColumnX(), CommandEvent::GetCommand(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetFirstX(), GetFocusColumn(), GetHeight(), ScCsvControl::GetLastX(), CommandWheelData::GetMode(), CommandEvent::GetMousePosPixel(), CommandWheelData::GetNotchDelta(), CommandEvent::GetWheelData(), GetWidth(), CommandWheelData::IsHorz(), tools::Rectangle::IsInside(), CommandEvent::IsMouseEvent(), IsSelected(), IsValidColumn(), maWinSize, pData, Point, and Select().
|
overrideprotectedvirtual |
Definition at line 1058 of file csvgrid.cxx.
References InitColors(), and ScCsvControl::Repaint().
|
overrideprotectedvirtual |
Creates a new accessible object.
Reimplemented from weld::CustomWidgetController.
Definition at line 1412 of file csvgrid.cxx.
References ScCsvControl::mxAccessible.
|
private |
Executes selection action for a specific column.
Definition at line 747 of file csvgrid.cxx.
References CSVCMD_MOVEGRIDCURSOR, ScCsvControl::Execute(), GetColumnPos(), ImplClearSelection(), KEY_MOD1, KEY_SHIFT, mbMTSelecting, mbTracking, mnRecentSelCol, Select(), SelectRange(), and ToggleSelect().
Referenced by Command(), MouseButtonDown(), and MouseMove().
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 854 of file csvgrid.cxx.
References EMPTY_OUSTRING, ScCsvControl::GetFirstVisLine(), and maTexts.
Referenced by ScAccessibleCsvGrid::implGetCellText().
|
inline |
Returns the number of columns.
Definition at line 151 of file csvgrid.hxx.
Referenced by FillColumnDataFix(), FillColumnDataSep(), GetNextSelected(), ImplClearSplits(), ScAccessibleCsvGrid::implGetColumnCount(), ImplInsertSplit(), ImplSetTextLineFix(), ImplSetTextLineSep(), IsValidColumn(), MoveCursorRel(), SelectAll(), and SetColumnStates().
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 |
Returns column index from output coordinate.
Definition at line 470 of file csvgrid.cxx.
References CSV_COLUMN_INVALID, ScCsvControl::GetCharWidth(), GetColumnFromPos(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetFirstX(), ScCsvControl::GetLastVisPos(), and nPos.
Referenced by Command(), ScAccessibleCsvGrid::getAccessibleAtPoint(), and MouseButtonDown().
|
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().
|
inline |
Returns the vector with the states of all columns.
Definition at line 175 of file csvgrid.hxx.
|
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 |
Returns X coordinate of the specified column.
Definition at line 465 of file csvgrid.cxx.
References GetColumnPos(), and ScCsvControl::GetX().
Referenced by Command(), GetFocusRect(), ImplDrawColumnBackgr(), ImplDrawColumnHeader(), ImplDrawColumnSelection(), ImplDrawFirstLineSep(), ScAccessibleCsvCell::implGetRealPos(), and ImplSetColumnClipRegion().
EditEngine * ScCsvGrid::GetEditEngine | ( | ) |
Returns a pointer to the used edit engine.
Definition at line 1085 of file csvgrid.cxx.
References mpEditEngine.
Referenced by ScAccessibleCsvCell::implCreateEditSource().
sal_uInt32 ScCsvGrid::GetFirstSelected | ( | ) | const |
Returns index of the first selected column.
Definition at line 630 of file csvgrid.cxx.
References GetNextSelected(), and IsSelected().
Referenced by GetSelColumnType(), ScAccessibleCsvGrid::getSelectedAccessibleColumns(), ScAccessibleCsvGrid::implGetSelColumn(), ScAccessibleCsvGrid::implGetSelColumnCount(), and SetSelColumnType().
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().
|
overrideprotectedvirtual |
Reimplemented from ScCsvControl.
Definition at line 878 of file csvgrid.cxx.
References CSVCMD_MOVEGRIDCURSOR, ScCsvControl::Execute(), ScCsvControl::GetFocus(), ScCsvControl::GetGridCursorPos(), GetNoScrollCol(), and ScCsvControl::Repaint().
|
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().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 1397 of file csvgrid.cxx.
References GetColumnX(), ScCsvControl::GetFirstX(), GetFocusColumn(), weld::CustomWidgetController::GetFocusRect(), GetHeight(), ScCsvControl::GetLastVisLine(), ScCsvControl::GetLastX(), ScCsvControl::GetY(), weld::CustomWidgetController::HasFocus(), and IsVisibleColumn().
|
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 |
Returns index of the first selected column really after nFromIndex.
Definition at line 635 of file csvgrid.cxx.
References CSV_COLUMN_INVALID, GetColumnCount(), and IsSelected().
Referenced by GetFirstSelected(), GetSelColumnType(), ScAccessibleCsvGrid::getSelectedAccessibleColumns(), ScAccessibleCsvGrid::implGetSelColumn(), ScAccessibleCsvGrid::implGetSelColumnCount(), and SetSelColumnType().
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.
|
inline |
Definition at line 99 of file csvgrid.hxx.
Referenced by ScAccessibleCsvGrid::getAccessibleRelationSet().
|
inlineprivate |
Returns the width of the control.
Definition at line 277 of file csvgrid.hxx.
References Size::Width().
Referenced by Command(), and ImplDrawBackgrDev().
|
private |
Clears the entire selection without notify.
Definition at line 741 of file csvgrid.cxx.
References ImplDrawGridDev(), and maColStates.
Referenced by DoSelectAction(), and KeyInput().
|
private |
Clears the split array and re-inserts boundary splits.
Definition at line 430 of file csvgrid.cxx.
References ScCsvControl::AccSendRemoveColumnEvent(), ScCsvSplits::Clear(), GetColumnCount(), ScCsvControl::GetPosCount(), ScCsvSplits::Insert(), ScCsvControl::InvalidateGfx(), maColStates, and maSplits.
Referenced by RemoveAllSplits(), SetDrawingArea(), and SetSplits().
|
private |
Draws all columns and the row headers column to maBackgrDev.
Definition at line 1263 of file csvgrid.cxx.
References CSV_COLUMN_INVALID, OutputDevice::DrawRect(), GetFirstVisColumn(), ScCsvControl::GetFirstX(), ScCsvControl::GetHdrWidth(), GetHeight(), GetLastVisColumn(), GetWidth(), ImplDrawColumnBackgr(), ImplDrawRowHeaders(), maAppBackColor, mpBackgrDev, Point, OutputDevice::SetFillColor(), and OutputDevice::SetLineColor().
Referenced by ImplDrawHorzScrolled(), and ImplRedraw().
Draws the text at the specified position to maBackgrDev.
Definition at line 1117 of file csvgrid.cxx.
References OutputDevice::DrawLine(), VclPtr< VirtualDevice >::get(), ScCsvControl::GetCharWidth(), ScCsvControl::GetLineHeight(), maEdEngSize, maTextColor, mpBackgrDev, mpEditEngine, Point, and OutputDevice::SetLineColor().
Referenced by ImplDrawColumnBackgr().
|
private |
Redraws the entire column (background and selection).
Definition at line 1322 of file csvgrid.cxx.
References ImplDrawColumnBackgr(), and ImplDrawColumnSelection().
Referenced by ImplDrawHorzScrolled(), InsertSplit(), MoveSplit(), and RemoveSplit().
|
private |
Draws the column with index nColIndex to maBackgrDev.
Definition at line 1179 of file csvgrid.cxx.
References OutputDevice::DrawGrid(), OutputDevice::DrawLine(), OutputDevice::DrawRect(), EE_CHAR_COLOR(), GetColumnPos(), GetColumnX(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetHdrHeight(), ScCsvControl::GetLastVisLine(), ScCsvControl::GetLastVisPos(), getLength(), ScCsvControl::GetLineHeight(), ScCsvControl::GetX(), ScCsvControl::GetY(), ImplDrawCellText(), ImplDrawColumnHeader(), ImplDrawFirstLineSep(), ImplSetColumnClipRegion(), IsVisibleColumn(), maBackColor, maGridColor, maHeaderBackColor, maTextColor, maTexts, mpBackgrDev, mpEditEngine, Point, OutputDevice::SetClipRegion(), OutputDevice::SetFillColor(), and OutputDevice::SetLineColor().
Referenced by ImplDrawBackgrDev(), and ImplDrawColumn().
|
private |
Draws the header of the specified column to the specified output device.
Definition at line 1097 of file csvgrid.cxx.
References OutputDevice::DrawLine(), OutputDevice::DrawRect(), OutputDevice::DrawText(), GetColumnTypeName(), GetColumnX(), ScCsvControl::GetHdrHeight(), maHeaderFont, maHeaderGridColor, maHeaderTextColor, Point, OutputDevice::SetFillColor(), OutputDevice::SetFont(), OutputDevice::SetLineColor(), OutputDevice::SetTextColor(), and OutputDevice::SetTextFillColor().
Referenced by ImplDrawColumnBackgr(), and ImplDrawColumnSelection().
|
private |
Draws the column with index nColIndex with its selection state to maGridDev.
Definition at line 1279 of file csvgrid.cxx.
References COL_LIGHTGRAY(), CSV_HDR_TRANSPARENCY, OutputDevice::DrawOutDev(), OutputDevice::DrawTransparent(), GetColumnX(), ScCsvControl::GetHdrHeight(), ScCsvControl::GetLastVisLine(), ScCsvControl::GetRulerCursorPos(), ScCsvControl::GetY(), ImplDrawColumnHeader(), ImplInvertCursor(), ScCsvControl::ImplInvertRect(), ImplSetColumnClipRegion(), Color::IsDark(), IsSelected(), maHeaderBackColor, maSelectColor, maWinSize, mpBackgrDev, mpGridDev, Point, OutputDevice::SetClipRegion(), OutputDevice::SetFillColor(), and OutputDevice::SetLineColor().
Referenced by ImplDrawColumn(), ImplDrawGridDev(), Select(), and SelectRange().
|
private |
Draws the "first imported line" separator to maBackgrDev (or erases, if bSet is false).
Definition at line 1168 of file csvgrid.cxx.
References OutputDevice::DrawLine(), GetColumnX(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetFirstX(), GetLastVisColumn(), ScCsvControl::GetLastX(), ScCsvControl::GetY(), ScCsvControl::IsVisibleLine(), maGridColor, maGridPBColor, mnFirstImpLine, mpBackgrDev, Point, and OutputDevice::SetLineColor().
Referenced by ImplDrawColumnBackgr(), and SetFirstImportedLine().
|
private |
Draws all columns with selection and cursor to maGridDev.
Definition at line 1312 of file csvgrid.cxx.
References CSV_COLUMN_INVALID, OutputDevice::DrawOutDev(), GetFirstVisColumn(), GetLastVisColumn(), ImplDrawColumnSelection(), maWinSize, mpBackgrDev, mpGridDev, and Point.
Referenced by ImplClearSelection(), ImplDrawHorzScrolled(), ImplRedraw(), and SetFirstImportedLine().
|
private |
Optimized drawing: Scrolls horizontally and redraws only missing parts.
Definition at line 1328 of file csvgrid.cxx.
References OutputDevice::CopyArea(), OutputDevice::DrawRect(), ScCsvControl::GetCharWidth(), GetColumnFromPos(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetFirstX(), GetHeight(), ScCsvControl::GetLastX(), ScCsvControl::GetPosCount(), ScCsvControl::GetRulerCursorPos(), ScCsvControl::GetVisPosCount(), ScCsvControl::GetX(), ImplDrawBackgrDev(), ImplDrawColumn(), ImplDrawGridDev(), ImplInvertCursor(), ScCsvControl::IsValidGfx(), maAppBackColor, maWinSize, mpBackgrDev, mpGridDev, nPos, Point, OutputDevice::SetClipRegion(), OutputDevice::SetFillColor(), and OutputDevice::SetLineColor().
Referenced by ApplyLayout().
|
private |
Draws the row headers column to maBackgrDev.
Definition at line 1226 of file csvgrid.cxx.
References tools::Rectangle::BottomLeft(), tools::Rectangle::BottomRight(), OutputDevice::DrawGrid(), OutputDevice::DrawLine(), OutputDevice::DrawRect(), OutputDevice::DrawText(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetHdrHeight(), ScCsvControl::GetHdrWidth(), ScCsvControl::GetHdrX(), GetHeight(), ScCsvControl::GetLastVisLine(), ScCsvControl::GetLineHeight(), OutputDevice::GetTextWidth(), ScCsvControl::GetY(), ScCsvControl::IsRTL(), maAppBackColor, maHeaderBackColor, maHeaderFont, maHeaderGridColor, maHeaderTextColor, mpBackgrDev, Point, tools::Rectangle::SetBottom(), OutputDevice::SetFillColor(), OutputDevice::SetFont(), OutputDevice::SetLineColor(), OutputDevice::SetTextColor(), OutputDevice::SetTextFillColor(), tools::Rectangle::SetTop(), tools::Rectangle::TopLeft(), and tools::Rectangle::TopRight().
Referenced by ImplDrawBackgrDev().
|
private |
Inserts a split and adjusts column data.
Definition at line 400 of file csvgrid.cxx.
References ScCsvControl::AccSendInsertColumnEvent(), ScCsvControl::AccSendTableUpdateEvent(), GetColumnCount(), GetColumnFromPos(), GetColumnType(), ScCsvSplits::Insert(), IsSelected(), maColStates, maSplits, and ScCsvColState::Select().
Referenced by ImplSetTextLineSep(), InsertSplit(), and MoveSplit().
|
private |
Inverts the cursor bar at the specified position in maGridDev.
Definition at line 1384 of file csvgrid.cxx.
References ScCsvControl::GetHdrHeight(), ScCsvControl::GetLastVisLine(), ScCsvControl::GetX(), ScCsvControl::GetY(), ScCsvControl::ImplInvertRect(), ScCsvControl::IsVisibleSplitPos(), mpGridDev, Point, tools::Rectangle::SetBottom(), and tools::Rectangle::SetTop().
Referenced by ApplyLayout(), ImplDrawColumnSelection(), and ImplDrawHorzScrolled().
void ScCsvGrid::ImplRedraw | ( | vcl::RenderContext & | rRenderContext | ) |
Redraws the entire data grid.
Definition at line 1071 of file csvgrid.cxx.
References OutputDevice::DrawOutDev(), ImplDrawBackgrDev(), ImplDrawGridDev(), ScCsvControl::IsValidGfx(), weld::CustomWidgetController::IsVisible(), maWinSize, mpGridDev, Point, and ScCsvControl::ValidateGfx().
Referenced by Paint().
|
private |
Removes a split and adjusts column data.
Definition at line 415 of file csvgrid.cxx.
References ScCsvControl::AccSendRemoveColumnEvent(), ScCsvControl::AccSendTableUpdateEvent(), GetColumnFromPos(), IsSelected(), maColStates, maSplits, and ScCsvSplits::Remove().
Referenced by MoveSplit(), and RemoveSplit().
|
private |
Sets a clip region in the specified output device for the specified column.
Definition at line 1090 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 | ||
) |
Fills all cells of a line with the passed text (fixed width mode).
Definition at line 825 of file csvgrid.cxx.
References ScImportExport::CountVisualWidth(), CSV_MAXSTRLEN, CSVCMD_SETPOSCOUNT, ScCsvControl::Execute(), GetColumnCount(), GetColumnWidth(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetPosCount(), ScCsvControl::InvalidateGfx(), and maTexts.
void ScCsvGrid::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).
Definition at line 764 of file csvgrid.cxx.
References ScImportExport::CountVisualWidth(), CSV_MAXCOLCOUNT, CSV_MAXSTRLEN, CSV_MINCOLWIDTH, CSVCMD_SETPOSCOUNT, ScCsvControl::Execute(), GetColumnCount(), GetColumnWidth(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetPosCount(), ImplInsertSplit(), ScCsvSplits::Insert(), ScCsvControl::InvalidateGfx(), IsValidColumn(), maSplits, maTexts, nPos, pChar, ScCsvSplits::Remove(), and ScImportExport::ScanNextFieldFromString().
Finishes initialization.
Must be called after constructing a new object.
Definition at line 132 of file csvgrid.cxx.
References InitColors(), mpColorConfig, and SC_MOD.
|
private |
Reads colors from system settings.
Definition at line 242 of file csvgrid.cxx.
References svtools::APPBACKGROUND, svtools::CALCGRID, svtools::CALCPAGEBREAK, svtools::DOCCOLOR, svtools::FONTCOLOR, StyleSettings::GetActiveColor(), StyleSettings::GetButtonTextColor(), svtools::ColorConfig::GetColorValue(), StyleSettings::GetDarkShadowColor(), StyleSettings::GetFaceColor(), Application::GetSettings(), AllSettings::GetStyleSettings(), ScCsvControl::InvalidateGfx(), maAppBackColor, maBackColor, maGridColor, maGridPBColor, maHeaderBackColor, maHeaderGridColor, maHeaderTextColor, maSelectColor, maTextColor, mpColorConfig, and svtools::ColorConfigValue::nColor.
Referenced by ConfigurationChanged(), Init(), and StyleUpdated().
|
private |
Initializes all font settings.
Definition at line 262 of file csvgrid.cxx.
References SfxPoolItem::Clone(), EE_CHAR_FONTHEIGHT_CJK(), EE_CHAR_FONTHEIGHT_CTL(), EE_CHAR_FONTINFO(), EE_CHAR_FONTINFO_CJK(), EE_CHAR_FONTINFO_CTL(), EE_CHAR_ITALIC(), EE_CHAR_ITALIC_CJK(), EE_CHAR_ITALIC_CTL(), EE_CHAR_LANGUAGE(), EE_CHAR_LANGUAGE_CJK(), EE_CHAR_LANGUAGE_CTL(), EE_CHAR_WEIGHT(), EE_CHAR_WEIGHT_CJK(), EE_CHAR_WEIGHT_CTL(), OutputDevice::GetDefaultFont(), vcl::Font::GetFontSize(), Size::Height(), ScCsvControl::InvalidateGfx(), LANGUAGE_ENGLISH_US, maHeaderFont, maMonoFont, mpEditEngine, EditEngine::SetFontInfoInItemSet(), vcl::Font::SetFontSize(), SfxPoolItem::SetWhich(), and Size::Width().
Referenced by SetDrawingArea(), and StyleUpdated().
|
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 | ) |
Inserts a split.
Definition at line 321 of file csvgrid.cxx.
References CSVCMD_EXPORTCOLUMNTYPE, CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), GetColumnFromPos(), ImplDrawColumn(), ImplInsertSplit(), and ScCsvControl::ValidateGfx().
bool ScCsvGrid::IsSelected | ( | sal_uInt32 | nColIndex | ) | const |
Returns true, if the specified column is selected.
Definition at line 625 of file csvgrid.cxx.
References IsValidColumn(), and maColStates.
Referenced by Command(), ScAccessibleCsvCell::getAccessibleStateSet(), GetFirstSelected(), GetNextSelected(), ImplDrawColumnSelection(), ImplInsertSplit(), ScAccessibleCsvGrid::implIsColumnSelected(), ImplRemoveSplit(), MouseButtonDown(), and ToggleSelect().
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().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 948 of file csvgrid.cxx.
References CSVCMD_SETCOLUMNTYPE, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), vcl::KeyCode::GetCode(), GetFocusColumn(), vcl::KeyCode::GetGroup(), ScCsvControl::GetHorzDirection(), KeyEvent::GetKeyCode(), ScCsvControl::GetVertDirection(), ImplClearSelection(), vcl::KeyCode::IsMod1(), vcl::KeyCode::IsMod2(), vcl::KeyCode::IsShift(), KEY_1, KEY_9, KEY_A, KEY_SPACE, KEYGROUP_CURSOR, maTypeNames, mnRecentSelCol, MOVE_NONE, MoveCursorRel(), nCode, nType, ScrollVertRel(), Select(), SelectAll(), SelectRange(), and ToggleSelect().
|
overrideprotectedvirtual |
Reimplemented from ScCsvControl.
Definition at line 885 of file csvgrid.cxx.
References ScCsvControl::LoseFocus(), and ScCsvControl::Repaint().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 891 of file csvgrid.cxx.
References ScCsvControl::DisableRepaint(), DoSelectAction(), ScCsvControl::EnableRepaint(), GetColumnFromX(), ScCsvControl::GetFirstX(), ScCsvControl::GetHdrHeight(), ScCsvControl::GetLastX(), MouseEvent::GetModifier(), MouseEvent::GetPosPixel(), weld::CustomWidgetController::GrabFocus(), weld::CustomWidgetController::HasFocus(), MouseEvent::IsLeft(), IsSelected(), IsValidColumn(), mbMTSelecting, mbTracking, mnMTCurrCol, Point, and SelectAll().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 919 of file csvgrid.cxx.
References mbTracking.
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 925 of file csvgrid.cxx.
References CSVCMD_MAKEPOSVISIBLE, ScCsvControl::DisableRepaint(), DoSelectAction(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), ScCsvControl::GetCharWidth(), GetColumnFromPos(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetFirstX(), MouseEvent::GetModifier(), ScCsvControl::GetPosCount(), MouseEvent::GetPosPixel(), mbTracking, mnMTCurrCol, and nPos.
|
private |
Moves column cursor to a new position.
Definition at line 695 of file csvgrid.cxx.
References CSV_SCROLL_DIST, CSVCMD_MOVEGRIDCURSOR, CSVCMD_SETPOSOFFSET, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), GetColumnPos(), ScCsvControl::GetFirstVisPos(), ScCsvControl::GetLastVisPos(), ScCsvControl::GetVisPosCount(), and IsValidColumn().
Referenced by MoveCursorRel().
|
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 | ||
) |
Inserts a new or removes an existing split.
Definition at line 349 of file csvgrid.cxx.
References ScCsvControl::AccSendTableUpdateEvent(), CSV_COLUMN_INVALID, CSVCMD_EXPORTCOLUMNTYPE, CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), GetColumnFromPos(), GetColumnPos(), ImplDrawColumn(), ImplInsertSplit(), ImplRemoveSplit(), ScCsvSplits::Insert(), maSplits, ScCsvSplits::Remove(), and ScCsvControl::ValidateGfx().
|
overrideprotectedvirtual |
Implements weld::CustomWidgetController.
Definition at line 1066 of file csvgrid.cxx.
References ImplRedraw().
void ScCsvGrid::RemoveAllSplits | ( | ) |
Removes all splits.
Definition at line 377 of file csvgrid.cxx.
References CSVCMD_EXPORTCOLUMNTYPE, CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), and ImplClearSplits().
void ScCsvGrid::RemoveSplit | ( | sal_Int32 | nPos | ) |
Removes a split.
Definition at line 336 of file csvgrid.cxx.
References CSVCMD_EXPORTCOLUMNTYPE, CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), GetColumnFromPos(), ImplDrawColumn(), ImplRemoveSplit(), and ScCsvControl::ValidateGfx().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 869 of file csvgrid.cxx.
References CSVCMD_UPDATECELLTEXTS, ScCsvControl::Execute(), ScCsvTableBox::InitControls(), InitSizeData(), mpTableBox, and weld::CustomWidgetController::Resize().
|
private |
Scrolls data grid vertically.
Definition at line 597 of file csvgrid.cxx.
References CSVCMD_SETLINEOFFSET, ScCsvControl::Execute(), ScCsvControl::GetFirstVisLine(), ScCsvControl::GetMaxLineOffset(), ScCsvControl::GetVisLineCount(), MOVE_FIRST, MOVE_LAST, MOVE_NEXT, MOVE_NEXTPAGE, MOVE_PREV, and MOVE_PREVPAGE.
Referenced by KeyInput().
void ScCsvGrid::Select | ( | sal_uInt32 | nColIndex, |
bool | bSelect = true |
||
) |
Selects or deselects the specified column.
Definition at line 644 of file csvgrid.cxx.
References ScCsvControl::AccSendSelectionEvent(), CSVCMD_EXPORTCOLUMNTYPE, ScCsvControl::Execute(), ImplDrawColumnSelection(), IsValidColumn(), maColStates, mnRecentSelCol, and ScCsvControl::Repaint().
Referenced by Command(), DoSelectAction(), ScAccessibleCsvGrid::implSelectColumn(), KeyInput(), SelectRange(), and ToggleSelect().
void ScCsvGrid::SelectAll | ( | bool | bSelect = true | ) |
Selects or deselects all columns.
Definition at line 690 of file csvgrid.cxx.
References GetColumnCount(), and SelectRange().
Referenced by ApplyLayout(), ScAccessibleCsvGrid::clearAccessibleSelection(), KeyInput(), MouseButtonDown(), and ScAccessibleCsvGrid::selectAccessibleChild().
void ScCsvGrid::SelectRange | ( | sal_uInt32 | nColIndex1, |
sal_uInt32 | nColIndex2, | ||
bool | bSelect = true |
||
) |
Selects or deselects the specified column range.
Definition at line 663 of file csvgrid.cxx.
References ScCsvControl::AccSendSelectionEvent(), CSV_COLUMN_INVALID, CSVCMD_EXPORTCOLUMNTYPE, ScCsvControl::Execute(), ImplDrawColumnSelection(), IsValidColumn(), maColStates, mnRecentSelCol, ScCsvControl::Repaint(), and Select().
Referenced by DoSelectAction(), KeyInput(), and SelectAll().
void ScCsvGrid::SetColumnStates | ( | const ScCsvColStateVec & | rColStates | ) |
Sets all column states to the values in the passed vector.
Definition at line 487 of file csvgrid.cxx.
References ScCsvControl::AccSendSelectionEvent(), ScCsvControl::AccSendTableUpdateEvent(), ScCsvSplits::Count(), CSVCMD_EXPORTCOLUMNTYPE, ScCsvControl::Execute(), GetColumnCount(), maColStates, and maSplits.
|
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().
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 93 of file csvgrid.cxx.
References weld::CustomWidgetController::EnableRTL(), weld::DrawingArea::get_ref_device(), StyleSettings::GetAppFont(), Application::GetDefaultDevice(), OutputDevice::GetFont(), Application::GetSettings(), AllSettings::GetStyleSettings(), Size::Height(), ImplClearSplits(), InitFonts(), maHeaderFont, weld::Widget::set_size_request(), weld::CustomWidgetController::SetDrawingArea(), weld::CustomWidgetController::SetOutputSizePixel(), and Size::Width().
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 | ) |
Changes the data type of all selected columns.
Definition at line 526 of file csvgrid.cxx.
References CSV_COLUMN_INVALID, CSV_TYPE_MULTI, CSV_TYPE_NOSELECTION, CSVCMD_EXPORTCOLUMNTYPE, ScCsvControl::Execute(), GetFirstSelected(), GetNextSelected(), ScCsvControl::Repaint(), and SetColumnType().
void ScCsvGrid::SetSplits | ( | const ScCsvSplits & | rSplits | ) |
Removes all splits and inserts the splits from rSplits.
Definition at line 386 of file csvgrid.cxx.
References ScCsvSplits::Count(), CSVCMD_EXPORTCOLUMNTYPE, CSVCMD_UPDATECELLTEXTS, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), ImplClearSplits(), ScCsvSplits::Insert(), maColStates, maSplits, and nCount.
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().
|
overrideprotectedvirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 1048 of file csvgrid.cxx.
References CSVCMD_UPDATECELLTEXTS, ScCsvControl::Execute(), InitColors(), InitFonts(), weld::CustomWidgetController::StyleUpdated(), and UpdateLayoutData().
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 | ( | ) |
Updates layout data dependent from the control's state.
Definition at line 142 of file csvgrid.cxx.
References CSVCMD_SETCHARWIDTH, CSVCMD_SETHDRHEIGHT, CSVCMD_SETLINEHEIGHT, ScCsvControl::DisableRepaint(), ScCsvControl::EnableRepaint(), ScCsvControl::Execute(), weld::DrawingArea::get_ref_device(), weld::CustomWidgetController::GetDrawingArea(), OutputDevice::GetTextHeight(), OutputDevice::GetTextWidth(), maHeaderFont, maMonoFont, OutputDevice::SetFont(), and UpdateOffsetX().
Referenced by StyleUpdated().
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().
|
private |
Grid color for "first imported line" delimiter.
Definition at line 72 of file csvgrid.hxx.
Referenced by ImplDrawBackgrDev(), ImplDrawHorzScrolled(), ImplDrawRowHeaders(), and InitColors().
|
private |
Application color configuration.
Definition at line 69 of file csvgrid.hxx.
Referenced by ImplDrawColumnBackgr(), and InitColors().
|
private |
Vector with split positions.
Definition at line 86 of file csvgrid.hxx.
Referenced by ApplyLayout(), GetColumnType(), ImplClearSelection(), ImplClearSplits(), ImplInsertSplit(), ImplRemoveSplit(), IsSelected(), Select(), SelectRange(), SetColumnStates(), SetColumnType(), SetSplits(), and SetTypeNames().
|
private |
Size of the control.
Definition at line 83 of file csvgrid.hxx.
Referenced by ImplDrawCellText(), and ScCsvGrid().
|
private |
Cell background color.
Definition at line 70 of file csvgrid.hxx.
Referenced by ImplDrawColumnBackgr(), ImplDrawFirstLineSep(), and InitColors().
|
private |
Table grid color.
Definition at line 71 of file csvgrid.hxx.
Referenced by ImplDrawFirstLineSep(), and InitColors().
|
private |
Text color for data area.
Definition at line 74 of file csvgrid.hxx.
Referenced by ImplDrawColumnBackgr(), ImplDrawColumnSelection(), ImplDrawRowHeaders(), and InitColors().
|
private |
For drawing cell texts.
Definition at line 80 of file csvgrid.hxx.
Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), InitFonts(), SetDrawingArea(), and UpdateLayoutData().
|
private |
Background color for headers.
Definition at line 75 of file csvgrid.hxx.
Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), and InitColors().
|
private |
Grid color for headers.
Definition at line 76 of file csvgrid.hxx.
Referenced by ImplDrawColumnHeader(), ImplDrawRowHeaders(), and InitColors().
|
private |
Font for column and row headers.
Definition at line 81 of file csvgrid.hxx.
Referenced by InitFonts(), and UpdateLayoutData().
|
private |
Text color for headers.
Definition at line 77 of file csvgrid.hxx.
Referenced by ImplDrawColumnSelection(), and InitColors().
|
private |
Paper size for edit engine.
Definition at line 85 of file csvgrid.hxx.
Referenced by ApplyLayout(), GetColumnFromPos(), ImplClearSplits(), ImplInsertSplit(), ImplRemoveSplit(), ImplSetTextLineSep(), MoveSplit(), SetColumnStates(), and SetSplits().
|
private |
Background color for unused area.
Definition at line 73 of file csvgrid.hxx.
Referenced by ImplDrawCellText(), ImplDrawColumnBackgr(), and InitColors().
|
private |
UI names of data types.
Definition at line 88 of file csvgrid.hxx.
Referenced by GetCellText(), ImplDrawColumnBackgr(), ImplSetTextLineFix(), and ImplSetTextLineSep().
|
private |
State of each column.
Definition at line 87 of file csvgrid.hxx.
Referenced by GetColumnTypeName(), KeyInput(), and SetTypeNames().
|
private |
Monospace font for data cells.
Definition at line 82 of file csvgrid.hxx.
Referenced by Command(), ImplDrawColumnSelection(), ImplDrawGridDev(), ImplDrawHorzScrolled(), ImplRedraw(), and InitSizeData().
|
private |
True if Mouse tracking.
Definition at line 94 of file csvgrid.hxx.
Referenced by DoSelectAction(), and MouseButtonDown().
|
private |
Current column of mouse tracking.
Definition at line 93 of file csvgrid.hxx.
Referenced by DoSelectAction(), MouseButtonDown(), MouseButtonUp(), and MouseMove().
|
private |
2D-vector for cell texts.
Definition at line 90 of file csvgrid.hxx.
Referenced by ImplDrawFirstLineSep(), and SetFirstImportedLine().
|
private |
Index of most recently selected column.
Definition at line 92 of file csvgrid.hxx.
Referenced by MouseButtonDown(), and MouseMove().
|
private |
First imported line (0-based).
Definition at line 91 of file csvgrid.hxx.
Referenced by DoSelectAction(), KeyInput(), Select(), and SelectRange().
|
private |
Grid Parent.
Definition at line 64 of file csvgrid.hxx.
Referenced by ImplDrawBackgrDev(), ImplDrawCellText(), ImplDrawColumnBackgr(), ImplDrawColumnSelection(), ImplDrawFirstLineSep(), ImplDrawGridDev(), ImplDrawHorzScrolled(), ImplDrawRowHeaders(), InitSizeData(), ScCsvGrid(), and ~ScCsvGrid().
|
private |
Popup menu for column types.
Definition at line 68 of file csvgrid.hxx.
Referenced by Init(), InitColors(), and ~ScCsvGrid().
|
private |
Header color of selected columns.
Definition at line 79 of file csvgrid.hxx.
Referenced by GetEditEngine(), ImplDrawCellText(), ImplDrawColumnBackgr(), InitFonts(), and ScCsvGrid().
|
private |
Grid background, headers, cell texts.
Definition at line 65 of file csvgrid.hxx.
Referenced by ImplDrawColumnSelection(), ImplDrawGridDev(), ImplDrawHorzScrolled(), ImplInvertCursor(), ImplRedraw(), InitSizeData(), and ~ScCsvGrid().
|
private |
Definition at line 63 of file csvgrid.hxx.
Referenced by Resize().
|
private |
Data grid with selection and cursor.
Definition at line 66 of file csvgrid.hxx.
Referenced by ExecutePopup(), and SetTypeNames().