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