xref: /aoo41x/main/sc/source/ui/inc/csvgrid.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // ============================================================================
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #ifndef _SC_CSVGRID_HXX
31*cdf0e10cSrcweir #define _SC_CSVGRID_HXX
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <vcl/virdev.hxx>
34*cdf0e10cSrcweir #include <vcl/menu.hxx>
35*cdf0e10cSrcweir #include <unotools/options.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <vector>
38*cdf0e10cSrcweir #include <memory>
39*cdf0e10cSrcweir #include "scdllapi.h"
40*cdf0e10cSrcweir #include "csvcontrol.hxx"
41*cdf0e10cSrcweir #include "csvsplits.hxx"
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir // ----------------------------------------------------------------------------
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir namespace svtools { class ColorConfig; }
47*cdf0e10cSrcweir class EditEngine;
48*cdf0e10cSrcweir class ScEditEngineDefaulter;
49*cdf0e10cSrcweir class ScAsciiOptions;
50*cdf0e10cSrcweir class ScAccessibleCsvControl;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir // ============================================================================
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir const sal_uInt8 CSV_COLFLAG_NONE    = 0x00;         /// Nothing set.
56*cdf0e10cSrcweir const sal_uInt8 CSV_COLFLAG_SELECT  = 0x01;         /// Column is selected.
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir const sal_uInt32 CSV_COLUMN_INVALID = CSV_VEC_NOTFOUND;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir // ----------------------------------------------------------------------------
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir /** This struct contains the state of one table column. */
64*cdf0e10cSrcweir struct ScCsvColState
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir     sal_Int32                   mnType;             /// Data type.
67*cdf0e10cSrcweir     sal_uInt8                   mnFlags;            /// Flags (i.e. selection state).
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir     inline explicit             ScCsvColState(
70*cdf0e10cSrcweir                                         sal_Int32 nType = CSV_TYPE_DEFAULT,
71*cdf0e10cSrcweir                                         sal_uInt8 nFlags = CSV_COLFLAG_NONE ) :
72*cdf0e10cSrcweir                                     mnType( nType ), mnFlags( nFlags ) {}
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir     inline bool                 IsSelected() const;
75*cdf0e10cSrcweir     inline void                 Select( bool bSel );
76*cdf0e10cSrcweir };
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir inline bool ScCsvColState::IsSelected() const
79*cdf0e10cSrcweir {
80*cdf0e10cSrcweir     return (mnFlags & CSV_COLFLAG_SELECT) != 0;
81*cdf0e10cSrcweir }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir inline void ScCsvColState::Select( bool bSel )
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     if( bSel ) mnFlags |= CSV_COLFLAG_SELECT; else mnFlags &= ~CSV_COLFLAG_SELECT;
86*cdf0e10cSrcweir }
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir // ----------------------------------------------------------------------------
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir typedef ::std::vector< ScCsvColState > ScCsvColStateVec;
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir // ============================================================================
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir /** A data grid control for the CSV import dialog. The design of this control
97*cdf0e10cSrcweir     simulates a Calc spreadsheet with row and column headers. */
98*cdf0e10cSrcweir class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public utl::ConfigurationListener
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir private:
101*cdf0e10cSrcweir     typedef ::std::auto_ptr< ScEditEngineDefaulter > ScEditEnginePtr;
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     VirtualDevice               maBackgrDev;        /// Grid background, headers, cell texts.
104*cdf0e10cSrcweir     VirtualDevice               maGridDev;          /// Data grid with selection and cursor.
105*cdf0e10cSrcweir     PopupMenu                   maPopup;            /// Popup menu for column types.
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     ::svtools::ColorConfig&     mrColorConfig;      /// Application color configuration.
108*cdf0e10cSrcweir     Color                       maBackColor;        /// Cell background color.
109*cdf0e10cSrcweir     Color                       maGridColor;        /// Table grid color.
110*cdf0e10cSrcweir     Color                       maGridPBColor;      /// Grid color for "first imported line" delimiter.
111*cdf0e10cSrcweir     Color                       maAppBackColor;     /// Background color for unused area.
112*cdf0e10cSrcweir     Color                       maTextColor;        /// Text color for data area.
113*cdf0e10cSrcweir     Color                       maHeaderBackColor;  /// Background color for headers.
114*cdf0e10cSrcweir     Color                       maHeaderGridColor;  /// Grid color for headers.
115*cdf0e10cSrcweir     Color                       maHeaderTextColor;  /// Text color for headers.
116*cdf0e10cSrcweir     Color                       maSelectColor;      /// Header color of selected columns.
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     ScEditEnginePtr             mpEditEngine;       /// For drawing cell texts.
119*cdf0e10cSrcweir     Font                        maHeaderFont;       /// Font for column and row headers.
120*cdf0e10cSrcweir     Font                        maMonoFont;         /// Monospace font for data cells.
121*cdf0e10cSrcweir     Size                        maWinSize;          /// Size of the control.
122*cdf0e10cSrcweir     Size                        maEdEngSize;        /// Paper size for edit engine.
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     ScCsvSplits                 maSplits;           /// Vector with split positions.
125*cdf0e10cSrcweir     ScCsvColStateVec            maColStates;        /// State of each column.
126*cdf0e10cSrcweir     StringVec                   maTypeNames;        /// UI names of data types.
127*cdf0e10cSrcweir     StringVecVec                maTexts;            /// 2D-vector for cell texts.
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir     sal_Int32                   mnFirstImpLine;     /// First imported line (0-based).
130*cdf0e10cSrcweir     sal_uInt32                  mnRecentSelCol;     /// Index of most recently selected column.
131*cdf0e10cSrcweir     sal_uInt32                  mnMTCurrCol;        /// Current column of mouse tracking.
132*cdf0e10cSrcweir     bool                        mbMTSelecting;      /// Mouse tracking: true = select, false = deselect.
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir     // ------------------------------------------------------------------------
135*cdf0e10cSrcweir public:
136*cdf0e10cSrcweir     explicit                    ScCsvGrid( ScCsvControl& rParent );
137*cdf0e10cSrcweir     virtual                     ~ScCsvGrid();
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     // common grid handling ---------------------------------------------------
140*cdf0e10cSrcweir public:
141*cdf0e10cSrcweir     /** Updates layout data dependent from the control's state. */
142*cdf0e10cSrcweir     void                        UpdateLayoutData();
143*cdf0e10cSrcweir     /** Updates X coordinate of first visible position dependent from line numbers. */
144*cdf0e10cSrcweir     void                        UpdateOffsetX();
145*cdf0e10cSrcweir     /** Apply current layout data to the grid control. */
146*cdf0e10cSrcweir     void                        ApplyLayout( const ScCsvLayoutData& rOldData );
147*cdf0e10cSrcweir     /** Sets the number of the first imported line (for visual feedback). nLine is 0-based! */
148*cdf0e10cSrcweir     void                        SetFirstImportedLine( sal_Int32 nLine );
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir     /** Finds a column position nearest to nPos which does not cause scrolling the visible area. */
151*cdf0e10cSrcweir     sal_Int32                   GetNoScrollCol( sal_Int32 nPos ) const;
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir private:
154*cdf0e10cSrcweir     /** Reads colors from system settings. */
155*cdf0e10cSrcweir     SC_DLLPRIVATE void                        InitColors();
156*cdf0e10cSrcweir     /** Initializes all font settings. */
157*cdf0e10cSrcweir     SC_DLLPRIVATE void                        InitFonts();
158*cdf0e10cSrcweir     /** Initializes all data dependent from the control's size. */
159*cdf0e10cSrcweir     SC_DLLPRIVATE void                        InitSizeData();
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir     // split handling ---------------------------------------------------------
162*cdf0e10cSrcweir public:
163*cdf0e10cSrcweir     /** Inserts a split. */
164*cdf0e10cSrcweir     void                        InsertSplit( sal_Int32 nPos );
165*cdf0e10cSrcweir     /** Removes a split. */
166*cdf0e10cSrcweir     void                        RemoveSplit( sal_Int32 nPos );
167*cdf0e10cSrcweir     /** Inserts a new or removes an existing split. */
168*cdf0e10cSrcweir     void                        MoveSplit( sal_Int32 nPos, sal_Int32 nNewPos );
169*cdf0e10cSrcweir     /** Removes all splits. */
170*cdf0e10cSrcweir     void                        RemoveAllSplits();
171*cdf0e10cSrcweir     /** Removes all splits and inserts the splits from rSplits. */
172*cdf0e10cSrcweir     void                        SetSplits( const ScCsvSplits& rSplits );
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir private:
175*cdf0e10cSrcweir     /** Inserts a split and adjusts column data. */
176*cdf0e10cSrcweir     SC_DLLPRIVATE bool                        ImplInsertSplit( sal_Int32 nPos );
177*cdf0e10cSrcweir     /** Removes a split and adjusts column data. */
178*cdf0e10cSrcweir     SC_DLLPRIVATE bool                        ImplRemoveSplit( sal_Int32 nPos );
179*cdf0e10cSrcweir     /** Clears the split array and re-inserts boundary splits. */
180*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplClearSplits();
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     // columns/column types ---------------------------------------------------
183*cdf0e10cSrcweir public:
184*cdf0e10cSrcweir     /** Returns the number of columns. */
185*cdf0e10cSrcweir     inline sal_uInt32           GetColumnCount() const { return maColStates.size(); }
186*cdf0e10cSrcweir     /** Returns the index of the first visible column. */
187*cdf0e10cSrcweir     sal_uInt32                  GetFirstVisColumn() const;
188*cdf0e10cSrcweir     /** Returns the index of the last visible column. */
189*cdf0e10cSrcweir     sal_uInt32                  GetLastVisColumn() const;
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     /** Returns true, if nColIndex points to an existing column. */
192*cdf0e10cSrcweir     bool                        IsValidColumn( sal_uInt32 nColIndex ) const;
193*cdf0e10cSrcweir     /** Returns true, if column with index nColIndex is (at least partly) visible. */
194*cdf0e10cSrcweir     bool                        IsVisibleColumn( sal_uInt32 nColIndex ) const;
195*cdf0e10cSrcweir 
196*cdf0e10cSrcweir     /** Returns X coordinate of the specified column. */
197*cdf0e10cSrcweir     sal_Int32                   GetColumnX( sal_uInt32 nColIndex ) const;
198*cdf0e10cSrcweir     /** Returns column index from output coordinate. */
199*cdf0e10cSrcweir     sal_uInt32                  GetColumnFromX( sal_Int32 nX ) const;
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir     /** Returns start position of the column with the specified index. */
202*cdf0e10cSrcweir     inline sal_Int32            GetColumnPos( sal_uInt32 nColIndex ) const { return maSplits[ nColIndex ]; }
203*cdf0e10cSrcweir     /** Returns column index from position. A split counts to its following column. */
204*cdf0e10cSrcweir     sal_uInt32                  GetColumnFromPos( sal_Int32 nPos ) const;
205*cdf0e10cSrcweir     /** Returns the character width of the column with the specified index. */
206*cdf0e10cSrcweir     sal_Int32                   GetColumnWidth( sal_uInt32 nColIndex ) const;
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir     /** Returns the vector with the states of all columns. */
209*cdf0e10cSrcweir     inline const ScCsvColStateVec& GetColumnStates() const { return maColStates; }
210*cdf0e10cSrcweir     /** Sets all column states to the values in the passed vector. */
211*cdf0e10cSrcweir     void                        SetColumnStates( const ScCsvColStateVec& rColStates );
212*cdf0e10cSrcweir     /** Returns the data type of the selected columns. */
213*cdf0e10cSrcweir     sal_Int32                   GetSelColumnType() const;
214*cdf0e10cSrcweir     /** Changes the data type of all selected columns. */
215*cdf0e10cSrcweir     void                        SetSelColumnType( sal_Int32 nType );
216*cdf0e10cSrcweir     /** Sets new UI data type names. */
217*cdf0e10cSrcweir     void                        SetTypeNames( const StringVec& rTypeNames );
218*cdf0e10cSrcweir     /** Returns the UI type name of the specified column. */
219*cdf0e10cSrcweir     const String&               GetColumnTypeName( sal_uInt32 nColIndex ) const;
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir     /** Fills the options object with column data for separators mode. */
222*cdf0e10cSrcweir     void                        FillColumnDataSep( ScAsciiOptions& rOptions ) const;
223*cdf0e10cSrcweir     /** Fills the options object with column data for fixed width mode. */
224*cdf0e10cSrcweir     void                        FillColumnDataFix( ScAsciiOptions& rOptions ) const;
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir private:
227*cdf0e10cSrcweir     /** Returns the data type of the specified column. */
228*cdf0e10cSrcweir     SC_DLLPRIVATE sal_Int32                   GetColumnType( sal_uInt32 nColIndex ) const;
229*cdf0e10cSrcweir     /** Returns the data type of the specified column. */
230*cdf0e10cSrcweir     SC_DLLPRIVATE void                        SetColumnType( sal_uInt32 nColIndex, sal_Int32 nColType );
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir     /** Scrolls data grid vertically. */
233*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ScrollVertRel( ScMoveMode eDir );
234*cdf0e10cSrcweir     /** Executes the data type popup menu. */
235*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ExecutePopup( const Point& rPos );
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     // selection handling -----------------------------------------------------
238*cdf0e10cSrcweir public:
239*cdf0e10cSrcweir     /** Returns true, if the specified column is selected. */
240*cdf0e10cSrcweir     bool                        IsSelected( sal_uInt32 nColIndex ) const;
241*cdf0e10cSrcweir     /** Returns index of the first selected column. */
242*cdf0e10cSrcweir     sal_uInt32                  GetFirstSelected() const;
243*cdf0e10cSrcweir     /** Returns index of the first selected column really after nFromIndex. */
244*cdf0e10cSrcweir     sal_uInt32                  GetNextSelected( sal_uInt32 nFromIndex ) const;
245*cdf0e10cSrcweir     /** Returns true, if at least one column is selected. */
246*cdf0e10cSrcweir     inline bool                 HasSelection() const { return GetFirstSelected() != CSV_COLUMN_INVALID; }
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir     /** Selects or deselects the specified column. */
249*cdf0e10cSrcweir     void                        Select( sal_uInt32 nColIndex, bool bSelect = true );
250*cdf0e10cSrcweir     /** Toggles selection of the specified column. */
251*cdf0e10cSrcweir     void                        ToggleSelect( sal_uInt32 nColIndex );
252*cdf0e10cSrcweir     /** Selects or deselects the specified column range. */
253*cdf0e10cSrcweir     void                        SelectRange( sal_uInt32 nColIndex1, sal_uInt32 nColIndex2, bool bSelect = true );
254*cdf0e10cSrcweir     /** Selects or deselects all columns. */
255*cdf0e10cSrcweir     void                        SelectAll( bool bSelect = true );
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir     /** Returns index of the focused column. */
258*cdf0e10cSrcweir     inline sal_uInt32           GetFocusColumn() const { return GetColumnFromPos( GetGridCursorPos() ); }
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir private:
261*cdf0e10cSrcweir     /** Moves column cursor to a new position. */
262*cdf0e10cSrcweir     SC_DLLPRIVATE void                        MoveCursor( sal_uInt32 nColIndex );
263*cdf0e10cSrcweir     /** Moves column cursor to the given direction. */
264*cdf0e10cSrcweir     SC_DLLPRIVATE void                        MoveCursorRel( ScMoveMode eDir );
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir     /** Clears the entire selection without notify. */
267*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplClearSelection();
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     /** Executes selection action for a specific column. */
270*cdf0e10cSrcweir     SC_DLLPRIVATE void                        DoSelectAction( sal_uInt32 nColIndex, sal_uInt16 nModifier );
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir     // cell contents ----------------------------------------------------------
273*cdf0e10cSrcweir public:
274*cdf0e10cSrcweir     /** Fills all cells of a line with the passed text (separators mode). */
275*cdf0e10cSrcweir     void                        ImplSetTextLineSep(
276*cdf0e10cSrcweir                                     sal_Int32 nLine, const String& rTextLine,
277*cdf0e10cSrcweir                                     const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
278*cdf0e10cSrcweir     /** Fills all cells of a line with the passed text (fixed width mode). */
279*cdf0e10cSrcweir     void                        ImplSetTextLineFix( sal_Int32 nLine, const String& rTextLine );
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir     /** Returns the text of the specified cell. */
282*cdf0e10cSrcweir     const String&               GetCellText( sal_uInt32 nColIndex, sal_Int32 nLine ) const;
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir     // event handling ---------------------------------------------------------
285*cdf0e10cSrcweir protected:
286*cdf0e10cSrcweir     virtual void                Resize();
287*cdf0e10cSrcweir     virtual void                GetFocus();
288*cdf0e10cSrcweir     virtual void                LoseFocus();
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir     virtual void                MouseButtonDown( const MouseEvent& rMEvt );
291*cdf0e10cSrcweir     virtual void                Tracking( const TrackingEvent& rTEvt );
292*cdf0e10cSrcweir     virtual void                KeyInput( const KeyEvent& rKEvt );
293*cdf0e10cSrcweir     virtual void                Command( const CommandEvent& rCEvt );
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir     virtual void                DataChanged( const DataChangedEvent& rDCEvt );
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir     virtual void                ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 );
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir     // painting ---------------------------------------------------------------
300*cdf0e10cSrcweir protected:
301*cdf0e10cSrcweir     virtual void                Paint( const Rectangle& );
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir public:
304*cdf0e10cSrcweir     /** Redraws the entire data grid. */
305*cdf0e10cSrcweir     void                        ImplRedraw();
306*cdf0e10cSrcweir     /** Returns a pointer to the used edit engine. */
307*cdf0e10cSrcweir     EditEngine*                 GetEditEngine();
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir private:
310*cdf0e10cSrcweir     /** Returns the width of the control. */
311*cdf0e10cSrcweir     inline sal_Int32            GetWidth() const { return maWinSize.Width(); }
312*cdf0e10cSrcweir     /** Returns the height of the control. */
313*cdf0e10cSrcweir     inline sal_Int32            GetHeight() const { return maWinSize.Height(); }
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir     /** Sets a clip region in the specified output device for the specified column. */
316*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplSetColumnClipRegion( OutputDevice& rOutDev, sal_uInt32 nColIndex );
317*cdf0e10cSrcweir     /** Draws the header of the specified column to the specified output device. */
318*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawColumnHeader( OutputDevice& rOutDev, sal_uInt32 nColIndex, Color aFillColor );
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir     /** Draws the text at the specified position to maBackgrDev. */
321*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawCellText( const Point& rPos, const String& rText );
322*cdf0e10cSrcweir     /** Draws the "first imported line" separator to maBackgrDev (or erases, if bSet is false). */
323*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawFirstLineSep( bool bSet );
324*cdf0e10cSrcweir     /** Draws the column with index nColIndex to maBackgrDev. */
325*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawColumnBackgr( sal_uInt32 nColIndex );
326*cdf0e10cSrcweir     /** Draws the row headers column to maBackgrDev. */
327*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawRowHeaders();
328*cdf0e10cSrcweir     /** Draws all columns and the row headers column to maBackgrDev. */
329*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawBackgrDev();
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir     /** Draws the column with index nColIndex with its selection state to maGridDev. */
332*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawColumnSelection( sal_uInt32 nColIndex );
333*cdf0e10cSrcweir     /** Draws all columns with selection and cursor to maGridDev. */
334*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawGridDev();
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir     /** Redraws the entire column (background and selection). */
337*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawColumn( sal_uInt32 nColIndex );
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir     /** Optimized drawing: Scrolls horizontally and redraws only missing parts. */
340*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawHorzScrolled( sal_Int32 nOldPos );
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir     /** Inverts the cursor bar at the specified position in maGridDev. */
343*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplInvertCursor( sal_Int32 nPos );
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir     /** Draws directly tracking rectangle to the column with the specified index. */
346*cdf0e10cSrcweir     SC_DLLPRIVATE void                        ImplDrawTrackingRect( sal_uInt32 nColIndex );
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir     // accessibility ----------------------------------------------------------
349*cdf0e10cSrcweir protected:
350*cdf0e10cSrcweir     /** Creates a new accessible object. */
351*cdf0e10cSrcweir     virtual ScAccessibleCsvControl* ImplCreateAccessible();
352*cdf0e10cSrcweir };
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir // ============================================================================
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir #endif
358*cdf0e10cSrcweir 
359