57 explicit Func_SetType( sal_Int32
nType ) : mnType( nType ) {}
65 explicit Func_Select(
bool bSelect ) : mbSelect( bSelect ) {}
67 { rState.
Select( mbSelect ); }
74 , mpTableBox(pTableBox)
77 , mxPopup(
std::move(xPopup))
78 , mpColorConfig( nullptr )
86 , mbMTSelecting( false )
111 Size aInitialSize(10, 10);
124 OSL_ENSURE(
mpColorConfig,
"the object hasn't been initialized properly");
134 OSL_PRECOND(!
mpColorConfig,
"the object has already been initialized");
158 sal_Int32 nDigits = 2;
166 nDigits = std::max( nDigits, sal_Int32( 3 ) );
225 sal_Int32 nNewPos = nPos;
244 OSL_PRECOND(
mpColorConfig,
"the object hasn't been initialized properly");
274 ::GetDefaultFonts( aLatinItem, aAsianItem, aComplexItem );
279 aDefSet.Put( aAsianItem );
280 aDefSet.Put( aComplexItem );
289 std::unique_ptr<SfxPoolItem> pNewItem(rWeightItem.
Clone());
291 aDefSet.Put( *pNewItem );
293 aDefSet.Put( *pNewItem );
295 pNewItem.reset(rItalicItem.
Clone());
297 aDefSet.Put( *pNewItem );
299 aDefSet.Put( *pNewItem );
301 pNewItem.reset(rLangItem.
Clone());
303 aDefSet.Put( *pNewItem );
305 aDefSet.Put( *pNewItem );
391 for( sal_uInt32 nIx = 0; nIx < nCount; ++nIx )
539 OSL_ENSURE( !rTypeNames.empty(),
"ScCsvGrid::SetTypeNames - vector is empty" );
544 sal_uInt32
nCount = maTypeNames.size();
545 for (sal_uInt32 nIx = 0; nIx < nCount; ++nIx)
546 mxPopup->append(OUString::number(nIx), maTypeNames[nIx]);
553 sal_uInt32 nTypeIx =
static_cast< sal_uInt32
>(
GetColumnType( nColIndex ) );
562 return pExtTypes[ ((0 <= nIntType) && (nIntType < nExtTypeCount)) ? nIntType : 0 ];
570 for( sal_uInt32 nColIx = 0; nColIx < nCount; ++nColIx )
574 aDataVec.emplace_back(
575 static_cast< sal_Int32 >( nColIx + 1 ),
586 for( sal_uInt32 nColIx = 0; nColIx < nCount; ++nColIx )
619 if (!sItemId.isEmpty())
638 for( sal_uInt32 nColIx = nFromIndex + 1; nColIx < nColCount; ++nColIx )
669 else if( nColIndex1 > nColIndex2 )
677 for( sal_uInt32 nColIx = nColIndex1; nColIx <= nColIndex2; ++nColIx )
702 sal_Int32 nMinPos = std::max( nPosBeg -
CSV_SCROLL_DIST, sal_Int32( 0 ) );
753 else if( !(nModifier & KEY_MOD1) )
765 sal_Int32 nLine,
const OUString& rTextLine,
766 const OUString& rSepChars,
sal_Unicode cTextSep,
bool bMergeSep,
bool bRemoveSpace )
771 while(
maTexts.size() <= nLineIx )
773 std::vector<OUString>& rStrVec =
maTexts[ nLineIx ];
780 sal_uInt32 nColIx = 0;
782 while( *pChar && (nColIx < sal::static_int_cast<sal_uInt32>(
CSV_MAXCOLCOUNT)) )
785 bool bIsQuoted =
false;
786 bool bOverflowCell =
false;
788 cTextSep, pSepChars, bMergeSep, bIsQuoted, bOverflowCell, bRemoveSpace );
800 for( sal_uInt32 nSplitIx =
GetColumnCount() - 1; nSplitIx > nColIx; --nSplitIx )
817 rStrVec.push_back( aCellText );
834 while(
maTexts.size() <= nLineIx )
837 std::vector<OUString>& rStrVec =
maTexts[ nLineIx ];
840 sal_Int32 nStrLen = rTextLine.getLength();
841 sal_Int32 nStrIx = 0;
842 for( sal_uInt32 nColIx = 0; (nColIx < nColCount) && (nStrIx < nStrLen); ++nColIx )
845 sal_Int32 nLastIx = nStrIx;
847 sal_Int32 nLen = std::min(
CSV_MAXSTRLEN, nLastIx - nStrIx );
848 rStrVec.push_back( rTextLine.copy( nStrIx, nLen ) );
849 nStrIx = nStrIx + nLen;
861 const std::vector<OUString>& rStrVec =
maTexts[ nLineIx ];
864 return rStrVec[ nColIndex ];
934 nPos = std::clamp( nPos, sal_Int32(0),
GetPosCount() - 1 );
952 bool bShift = rKCode.
IsShift();
953 bool bMod1 = rKCode.
IsMod1();
985 else if( !bShift && bMod1 )
989 else if( (
KEY_1 <= nCode) && (nCode <=
KEY_9) )
1003 bool bConsumed =
true;
1006 case CommandEventId::ContextMenu:
1030 case CommandEventId::Wheel:
1036 if( pData && (pData->
GetMode() == CommandWheelMode::SCROLL) && !pData->
IsHorz() )
1119 OUString aPlainText = rText.replaceAll(
"\t",
" " );
1120 aPlainText = aPlainText.replaceAll(
"\n",
" " );
1126 sal_Int32 nCharIxInt {aPlainText.isEmpty() ? -1 : 0};
1127 while (nCharIxInt>=0)
1129 sal_Int32 nBeginIx = nCharIxInt;
1130 const OUString aToken = aPlainText.getToken( 0,
' ', nCharIxInt );
1131 if( !aToken.isEmpty() )
1139 sal_Int32 nCharIx = 0;
1140 while( (nCharIx = rText.indexOf(
'\t', nCharIx )) != -1 )
1153 while( (nCharIx = rText.indexOf(
'\n', nCharIx )) != -1 )
1206 sal_Int32 nStrPos = nFirstVisPos -
GetColumnPos( nColIndex );
1207 sal_Int32 nStrLen = nLastVisPos - nFirstVisPos + 1;
1208 sal_Int32 nStrX =
GetX( nFirstVisPos );
1209 for(
size_t nLine = 0; nLine < nLineCount; ++nLine )
1211 std::vector<OUString>& rStrVec =
maTexts[ nLine ];
1212 if( (nColIndex < rStrVec.size()) && (rStrVec[ nColIndex ].
getLength() > nStrPos) )
1214 const OUString& rStr = rStrVec[ nColIndex ];
1215 OUString aText = rStr.copy( nStrPos, ::std::min( nStrLen, rStr.getLength() - nStrPos) );
1243 for( sal_Int32 nLine =
GetFirstVisLine(); nLine <= nLastLine; ++nLine )
1245 OUString aText( OUString::number( nLine + 1 ) );
1341 sal_uInt32 nFirstColIx, nLastColIx;
1342 if( nPos < nOldPos )
1368 for( sal_uInt32 nColIx = nFirstColIx; nColIx <= nLastColIx; ++nColIx )
1388 sal_Int32 nX =
GetX( nPos ) - 1;
1403 sal_Int32 nX2 = std::min(
GetColumnX( nColIndex + 1 ) - sal_Int32( 1 ),
GetLastX() );
1416 return css::uno::Reference<css::accessibility::XAccessible>(xRef.get());
ScCsvDiff GetDiff(const ScCsvLayoutData &rData) const
Returns differences to rData.
Color maGridPBColor
Table grid color.
static sal_uInt8 lcl_GetExtColumnType(sal_Int32 nIntType)
const Color & GetActiveColor() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
vcl::Font maMonoFont
Font for column and row headers.
bool mbTracking
Current column of mouse tracking.
static void ImplInvertRect(OutputDevice &rOutDev, const tools::Rectangle &rRect)
Inverts a rectangle in the specified output device.
sal_uInt32 UpperBound(sal_Int32 nPos) const
Returns index of the last split less than or equal to nPos.
Repaint all controls. [-].
sal_Int32 mnPosOffset
Number of positions.
void RemoveSplit(sal_Int32 nPos)
Removes a split.
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool Command(const CommandEvent &rCEvt) override
void SetFontSize(const Size &)
SAL_DLLPRIVATE void ImplDrawGridDev()
Draws all columns with selection and cursor to maGridDev.
ScCsvSplits maSplits
Paper size for edit engine.
SAL_DLLPRIVATE void ImplDrawCellText(const Point &rPos, const OUString &rText)
Draws the text at the specified position to maBackgrDev.
::svtools::ColorConfig * mpColorConfig
Popup menu for column types.
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.
const sal_uInt8 SC_COL_STANDARD
Color maGridColor
Cell background color.
void EnableRepaint()
Decreases no-repaint counter and repaints if counter reaches 0.
const sal_uInt8 SC_COL_TEXT
sal_uInt32 GetFirstVisColumn() const
Returns the index of the first visible column.
constexpr sal_uInt16 KEY_MOD1
bool IsValidColumn(sal_uInt32 nColIndex) const
Returns true, if nColIndex points to an existing column.
const sal_Int32 CSV_POS_INVALID
Constant for an invalid ruler position.
SAL_DLLPRIVATE sal_Int32 GetColumnType(sal_uInt32 nColIndex) const
Returns the data type of the specified column.
#define LANGUAGE_ENGLISH_US
sal_Int32 GetPosCount() const
Returns the number of available positions.
void UpdateLayoutData()
Updates layout data dependent from the control's state.
const ScCsvLayoutData & GetLayoutData() const
Returns a reference to the current layout data.
std::unique_ptr< ContentProperties > pData
sal_uInt8 mnType
Index of a column.
ScMoveMode
Specifies which element should be used to perform an action.
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
sal_Int32 GetLineHeight() const
Returns the height of one line.
sal_Int32 GetX(sal_Int32 nPos) const
Returns output X coordinate of the specified position.
void AccSendVisibleEvent()
Sends a visible area changed event to the accessibility object.
sal_uInt32 GetColumnFromPos(sal_Int32 nPos) const
Returns column index from position.
sal_uInt32 GetLastVisColumn() const
Returns the index of the last visible column.
Change position/column count. [character count].
SAL_DLLPRIVATE void InitSizeData()
Initializes all data dependent from the control's size.
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
constexpr sal_uInt16 KEY_A
Update cell texts with current split settings. [-].
const Color & GetFaceColor() const
static ScMoveMode GetHorzDirection(sal_uInt16 nCode, bool bHomeEnd)
Returns direction code for the keys LEFT, RIGHT, HOME, END.
void SetColumnInfo(const ScCsvExpDataVec &rDataVec)
SAL_DLLPRIVATE void MoveCursorRel(ScMoveMode eDir)
Moves column cursor to the given direction.
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Accessible class representing the CSV grid control.
void ApplyLayout(const ScCsvLayoutData &rOldData)
Apply current layout data to the grid control.
void AccSendRemoveColumnEvent(sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn)
Sends a table model changed event for a removed column to the accessibility object.
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
const ContentProperties & rData
sal_uInt16 GetGroup() const
sal_uInt16 GetCode() const
bool IsValidGfx() const
Returns true, if cached graphic is valid.
Color maHeaderBackColor
Text color for data area.
virtual tools::Rectangle GetFocusRect() override
void MoveSplit(sal_Int32 nPos, sal_Int32 nNewPos)
Inserts a new or removes an existing split.
vcl::Font maHeaderFont
For drawing cell texts.
sal_Int32 GetHdrHeight() const
Returns the height of the header line.
void SetFirstImportedLine(sal_Int32 nLine)
Sets the number of the first imported line (for visual feedback).
SAL_DLLPRIVATE void ImplDrawColumnHeader(OutputDevice &rOutDev, sal_uInt32 nColIndex, Color aFillColor)
Draws the header of the specified column to the specified output device.
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
void RemoveAllSplits()
Removes all splits.
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
const CommandWheelData * GetWheelData() const
constexpr sal_uInt16 KEY_SPACE
Change width of the header column. [width in pixel].
VclPtr< VirtualDevice > mpGridDev
Grid background, headers, cell texts.
SAL_DLLPRIVATE void ImplDrawHorzScrolled(sal_Int32 nOldPos)
Optimized drawing: Scrolls horizontally and redraws only missing parts.
Change height of top header line. [height in pixel].
void FillColumnDataFix(ScAsciiOptions &rOptions) const
Fills the options object with column data for fixed width mode.
Base class for the CSV ruler and the data grid control.
SAL_DLLPRIVATE void ImplDrawColumn(sal_uInt32 nColIndex)
Redraws the entire column (background and selection).
const sal_Int32 CSV_MAXSTRLEN
Maximum length of a cell string.
Move ruler cursor to new position. [position].
void SetColumnStates(const ScCsvColStateVec &rColStates)
Sets all column states to the values in the passed vector.
SAL_DLLPRIVATE void ImplDrawColumnBackgr(sal_uInt32 nColIndex)
Draws the column with index nColIndex to maBackgrDev.
static OutputDevice * GetDefaultDevice()
constexpr sal_uInt16 KEY_9
void ToggleSelect(sal_uInt32 nColIndex)
Toggles selection of the specified column.
bool mbMTSelecting
True if Mouse tracking.
Predecessor of current element in current context.
Color maTextColor
Background color for unused area.
void SelectAll(bool bSelect=true)
Selects or deselects all columns.
SAL_DLLPRIVATE bool ImplInsertSplit(sal_Int32 nPos)
Inserts a split and adjusts column data.
virtual void GetFocus() override
sal_Int32 GetLastX() const
Returns the X position of the last pixel of the data area.
SAL_DLLPRIVATE void ImplDrawFirstLineSep(bool bSet)
Draws the "first imported line" separator to maBackgrDev (or erases, if bSet is false).
sal_Int32 GetY(sal_Int32 nLine) const
Returns output Y coordinate of the specified line.
const sal_Int32 CSV_SCROLL_DIST
Minimum distance to border for auto scroll.
sal_Int32 GetCharWidth() const
Returns the width of one character column.
bool IsVisibleLine(sal_Int32 nLine) const
Returns true, if nLine is a valid and visible line index.
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
const vcl::Font & GetFont() const
Exported data of a column (data used in the dialog).
void UpdateOffsetX()
Updates X coordinate of first visible position dependent from line numbers.
bool Remove(sal_Int32 nPos)
Removes a split by position.
constexpr sal_uInt16 KEY_1
bool IsMouseEvent() const
std::vector< std::vector< OUString > > maTexts
UI names of data types.
SAL_DLLPRIVATE void ImplSetColumnClipRegion(OutputDevice &rOutDev, sal_uInt32 nColIndex)
Sets a clip region in the specified output device for the specified column.
EditEngine * GetEditEngine()
Returns a pointer to the used edit engine.
VclPtr< VirtualDevice > mpBackgrDev
Grid Parent.
SAL_DLLPRIVATE bool ImplRemoveSplit(sal_Int32 nPos)
Removes a split and adjusts column data.
void Select(sal_uInt32 nColIndex, bool bSelect=true)
Selects or deselects the specified column.
bool IsRTL() const
Returns true, if the Right-to-Left layout mode is active.
SAL_DLLPRIVATE void InitColors()
Reads colors from system settings.
void InsertSplit(sal_Int32 nPos)
Inserts a split.
constexpr sal_uInt16 KEYGROUP_CURSOR
virtual void GetFocus() override
const sal_Int32 CSV_TYPE_NOSELECTION
No column selected.
virtual OutputDevice & get_ref_device()=0
const sal_Int32 CSV_MINCOLWIDTH
Minimum character count for a column in separators mode.
sal_Int32 GetFirstX() const
Returns the X position of the first pixel of the data area.
void DrawLine(const Point &rStartPt, const Point &rEndPt)
ScCsvTableBox * mpTableBox
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
Change number of data lines. [line count].
SAL_DLLPRIVATE void ExecutePopup(const Point &rPos)
Executes the data type popup menu.
void DrawRect(const tools::Rectangle &rRect)
#define SAL_N_ELEMENTS(arr)
sal_uInt32 mnMTCurrCol
Index of most recently selected column.
const OUString & GetCellText(sal_uInt32 nColIndex, sal_Int32 nLine) const
Returns the text of the specified cell.
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).
virtual void ConfigurationChanged(::utl::ConfigurationBroadcaster *, ConfigurationHints) override
void Repaint(bool bInvalidate=false)
Repaints all controls.
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false)
void SetSelColumnType(sal_Int32 nType)
Changes the data type of all selected columns.
const Color & GetDarkShadowColor() const
sal_Int32 GetLastVisPos() const
Returns the last visible position.
SAL_DLLPRIVATE void ScrollVertRel(ScMoveMode eDir)
Scrolls data grid vertically.
const OUString & GetColumnTypeName(sal_uInt32 nColIndex) const
Returns the UI type name of the specified column.
ScCsvGrid(const ScCsvLayoutData &rData, std::unique_ptr< weld::Menu > xPopup, ScCsvTableBox *pTableBox)
Mouse tracking mode: true = select, false = deselect.
Last element in current context.
Successor of current element in current context.
std::vector< OUString > maTypeNames
State of each column.
virtual void StyleUpdated() override
virtual ~ScCsvGrid() override
SAL_DLLPRIVATE void InitControls()
Initializes the children controls (pos/size, scroll bars, ...).
bool IsVisibleColumn(sal_uInt32 nColIndex) const
Returns true, if column with index nColIndex is (at least partly) visible.
Color maAppBackColor
Grid color for "first imported line" delimiter.
const sal_uInt32 CSV_COLUMN_INVALID
tools::Long GetNotchDelta() const
void Clear()
Removes all elements from the vector.
static ScMoveMode GetVertDirection(sal_uInt16 nCode, bool bHomeEnd)
Returns direction code for the keys UP, DOWN, HOME, END, PAGE UP, PAGE DOWN.
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
CommandWheelMode GetMode() const
Move data grid cursor to new column. [position].
virtual bool KeyInput(const KeyEvent &rKEvt) override
tools::Long Width() const
void AccSendInsertColumnEvent(sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn)
Sends a table model changed event for an inserted column to the accessibility object.
CommandEventId GetCommand() const
A vector of column splits that supports inserting, removing and moving splits.
void SetTextColor(const Color &rColor)
void FillColumnDataSep(ScAsciiOptions &rOptions) const
Fills the options object with column data for separators mode.
sal_Int32 GetFirstVisLine() const
Returns index of first visible line.
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
sal_Int32 GetVisLineCount() const
Returns the number of visible lines (including partly visible bottom line).
SAL_DLLPRIVATE void ImplInvertCursor(sal_Int32 nPos)
Inverts the cursor bar at the specified position in maGridDev.
rtl::Reference< ScAccessibleCsvControl > mxAccessible
Content of virtual devices valid?
const Size & GetFontSize() const
sal_uInt32 GetFocusColumn() const
Returns index of the focused column.
bool IsVisibleSplitPos(sal_Int32 nPos) const
Returns true, if nPos is an allowed AND visible split position.
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
sal_uInt32 GetColumnFromX(sal_Int32 nX) const
Returns column index from output coordinate.
Change data type of selected columns. [column type].
SAL_DLLPRIVATE void ImplDrawColumnSelection(sal_uInt32 nColIndex)
Draws the column with index nColIndex with its selection state to maGridDev.
void ValidateGfx()
Sets the graphic valid (next Redraw() will use cached graphic).
sal_uInt16 GetModifier() const
void ImplSetTextLineFix(sal_Int32 nLine, const OUString &rTextLine)
Fills all cells of a line with the passed text (fixed width mode).
sal_Int32 GetColumnWidth(sal_uInt32 nColIndex) const
Returns the character width of the column with the specified index.
sal_Int32 mnFirstImpLine
2D-vector for cell texts.
First element in current context.
sal_uInt32 GetColumnCount() const
Returns the number of columns.
const sal_Int32 CSV_TYPE_DEFAULT
Default column data type.
::std::vector< ScCsvColState > ScCsvColStateVec
sal_Int32 GetMaxPosOffset() const
Returns highest possible position for first visible character.
virtual void Resize() override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
sal_Int32 GetMaxLineOffset() const
Returns highest possible index for first line.
sal_Int32 mnPosCursor
Height of a data line.
void SetTypeNames(const std::vector< OUString > &rTypeNames)
Sets new UI data type names.
The control in the CSV import dialog that contains a ruler and a data grid to visualize and modify th...
void SelectRange(sal_uInt32 nColIndex1, sal_uInt32 nColIndex2, bool bSelect=true)
Selects or deselects the specified column range.
const Point & GetMousePosPixel() const
Change position offset (scroll pos). [position].
const sal_uInt16 CSV_HDR_TRANSPARENCY
Transparency for header color of selected columns.
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
const vcl::KeyCode & GetKeyCode() const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Creates a new accessible object.
sal_uInt32 GetNextSelected(sal_uInt32 nFromIndex) const
Returns index of the first selected column really after nFromIndex.
void Init()
Finishes initialization.
SAL_DLLPRIVATE void ImplDrawRowHeaders()
Draws the row headers column to maBackgrDev.
Change first visible line. [line index].
virtual void LoseFocus() override
sal_Int32 GetRulerCursorPos() const
Returns the ruler cursor position.
ScEditEnginePtr mpEditEngine
Header color of selected columns.
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
const Color & GetButtonTextColor() const
void Execute(ScCsvCmdType eType, sal_Int32 nParam1=CSV_POS_INVALID, sal_Int32 nParam2=CSV_POS_INVALID)
Executes a command by calling command handler.
SAL_DLLPRIVATE void DoSelectAction(sal_uInt32 nColIndex, sal_uInt16 nModifier)
Executes selection action for a specific column.
virtual void LoseFocus() override
sal_Int32 GetLastVisLine() const
Returns index of last visible line.
const sal_Int32 CSV_TYPE_MULTI
Multi selection with different types.
ScCsvColStateVec maColStates
Vector with split positions.
void SetFont(const vcl::Font &rNewFont)
tools::Long GetTextHeight() const
void SetWhich(sal_uInt16 nId)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
sal_Int32 GetVisPosCount() const
Returns the number of visible positions.
Color maHeaderGridColor
Background color for headers.
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
Color maBackColor
Application color configuration.
void DrawGrid(const tools::Rectangle &rRect, const Size &rDist, DrawGridFlags nFlags)
const sal_uInt8 SC_COL_MDY
const sal_uInt8 SC_COL_ENGLISH
virtual bool MouseMove(const MouseEvent &rMEvt) override
sal_Int32 GetHeight() const
Returns the height of the control.
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
sal_Int32 GetSelColumnType() const
Returns the data type of the selected columns.
sal_Int32 GetHdrWidth() const
Returns the width of the header column.
sal_Int32 GetColumnX(sal_uInt32 nColIndex) const
Returns X coordinate of the specified column.
void AccSendSelectionEvent()
Sends a selection changed event to the accessibility object.
tools::Long Height() const
sal_Int32 GetNoScrollCol(sal_Int32 nPos) const
Finds a column position nearest to nPos which does not cause scrolling the visible area...
Size maWinSize
Monospace font for data cells.
ScCsvDiff
Flags for comparison of old and new control layout data.
sal_uInt32 mnRecentSelCol
First imported line (0-based).
void RemoveRange(sal_Int32 nPosStart, sal_Int32 nPosEnd)
Removes a range of splits in the given position range.
SAL_DLLPRIVATE void ImplDrawBackgrDev()
Draws all columns and the row headers column to maBackgrDev.
SAL_DLLPRIVATE void ImplClearSelection()
Clears the entire selection without notify.
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
const Point & GetPosPixel() const
Previous page relative to current context.
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
double getLength(const B2DPolygon &rCandidate)
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
sal_uInt32 GetFirstSelected() const
Returns index of the first selected column.
Size maEdEngSize
Size of the control.
static void SetFontInfoInItemSet(SfxItemSet &rItemSet, const vcl::Font &rFont)
void DisableRepaint()
Increases no-repaint counter (controls do not repaint until the last EnableRepaint()).
const vcl::Font & GetAppFont() const
void InvalidateGfx()
Sets the graphic invalid (next Redraw() will not use cached graphic).
SAL_DLLPRIVATE void MoveCursor(sal_uInt32 nColIndex)
Moves column cursor to a new position.
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
VirtualDevice * get() const
const sal_Int32 CSV_MAXCOLCOUNT
Maximum count of columns.
bool Insert(sal_Int32 nPos)
The split container.
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
SAL_DLLPRIVATE void SetColumnType(sal_uInt32 nColIndex, sal_Int32 nColType)
Sets the data type of the specified column.
const sal_uInt8 SC_COL_DMY
SAL_DLLPRIVATE void ImplClearSplits()
Clears the split array and re-inserts boundary splits.
sal_Int32 GetHdrX() const
Returns the start position of the header column.
constexpr sal_uInt16 KEY_SHIFT
bool IsSelected(sal_uInt32 nColIndex) const
Returns true, if the specified column is selected.
static const sal_Unicode * ScanNextFieldFromString(const sal_Unicode *p, OUString &rField, sal_Unicode cStr, const sal_Unicode *pSeps, bool bMergeSeps, bool &rbIsQuoted, bool &rbOverflowCell, bool bRemoveSpace)
::std::vector< ScCsvExpData > ScCsvExpDataVec
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
const sal_uInt8 SC_COL_SKIP
Color maHeaderTextColor
Grid color for headers.
Recalculate splits and cell texts. [-].
sal_Int32 GetFirstVisPos() const
Returns the first visible position.
sal_uInt32 Count() const
Returns the number of splits.
void ImplRedraw(vcl::RenderContext &rRenderContext)
Redraws the entire data grid.
sal_Int32 GetWidth() const
Returns the width of the control.
sal_Int32 GetGridCursorPos() const
Returns the data grid cursor position (not column index!).
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
sal_Int32 GetColumnPos(sal_uInt32 nColIndex) const
Returns start position of the column with the specified index.
static sal_Int32 CountVisualWidth(const OUString &rStr, sal_Int32 &nIdx, sal_Int32 nMaxWidth)
ScImportExport::CountVisualWidth Count the width of string visually ( in multiple of western characte...
SAL_DLLPRIVATE void InitFonts()
Initializes all font settings.
Color maSelectColor
Text color for headers.
void SetSplits(const ScCsvSplits &rSplits)
Removes all splits and inserts the splits from rSplits.
const sal_uInt8 SC_COL_YMD
std::unique_ptr< weld::Menu > mxPopup
Data grid with selection and cursor.
A structure containing all layout data valid for both ruler and data grid (i.e.
This struct contains the state of one table column.