Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / gridctrl.hxx
blobf845c3240655bb3b998bafe4a8d36c8a0aecaf03
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gridctrl.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_GRIDCTRL_HXX
31 #define _SVX_GRIDCTRL_HXX
34 #ifndef _COM_SUN_STAR_SDBC_XROWSET_HPP_
35 #include <com/sun/star/sdbc/XRowSet.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
38 #include <com/sun/star/util/XNumberFormatter.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_UTIL_DATE_HPP_
41 #include <com/sun/star/util/Date.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
44 #include <com/sun/star/container/XIndexAccess.hpp>
45 #endif
46 #ifndef _SV_FIXED_HXX //autogen
47 #include <vcl/fixed.hxx>
48 #endif
50 #ifndef _SV_FIELD_HXX //autogen
51 #include <vcl/field.hxx>
52 #endif
57 #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
58 #include <svtools/editbrowsebox.hxx>
59 #endif
62 #ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
63 #include <comphelper/propmultiplex.hxx>
64 #endif
66 namespace binfilter {
68 extern XubString INVALIDTEXT;
69 extern XubString OBJECTTEXT;
71 class DbGridControl;
72 class CursorWrapper;
74 sal_Bool CompareBookmark(const ::com::sun::star::uno::Any& aLeft, const ::com::sun::star::uno::Any& aRight);
76 namespace svxform
78 class DataColumn;
80 DECLARE_LIST(DbDataColumns, ::binfilter::svxform::DataColumn*)//STRIP008 DECLARE_LIST(DbDataColumns, ::svxform::DataColumn*);
82 enum GridRowStatus
84 GRS_CLEAN,
85 GRS_MODIFIED,
86 GRS_DELETED,
87 GRS_INVALID
90 //==================================================================
91 // DbGridRow, Zeilenbeschreibung
92 //==================================================================
94 class DbGridRow : public SvRefBase
96 ::com::sun::star::uno::Any m_aBookmark; // ::com::sun::star::text::Bookmark der Zeile, kann gesetzt sein
97 DbDataColumns m_aVariants;
98 GridRowStatus m_eStatus;
99 sal_Bool m_bIsNew;
100 // Zeile ist nicht mehr gueltig,
101 // wird bei der naechsten positionierung entfernt
102 public:
103 DbGridRow():m_eStatus(GRS_CLEAN), m_bIsNew(sal_True) { }
104 DbGridRow(CursorWrapper* pCur, sal_Bool bPaintCursor);
105 void SetState(CursorWrapper* pCur, sal_Bool bPaintCursor);
107 ~DbGridRow();
109 // da GetField auf Geschwindigkeit getuned ist vorher immer noch hasField verwenden
110 sal_Bool HasField(sal_uInt32 nPos) const {return nPos < m_aVariants.Count();}
111 const ::binfilter::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants.GetObject(nPos); }//STRIP008 const ::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants.GetObject(nPos); }
113 void SetStatus(GridRowStatus _eStat) { m_eStatus = _eStat; }
114 GridRowStatus GetStatus() const { return m_eStatus; }
115 void SetNew(sal_Bool _bNew) { m_bIsNew = _bNew; }
116 sal_Bool IsNew() const { return m_bIsNew; }
118 const ::com::sun::star::uno::Any& GetBookmark() const { return m_aBookmark; }
120 sal_Bool IsValid() const { return m_eStatus == GRS_CLEAN || m_eStatus == GRS_MODIFIED; }
121 sal_Bool IsModified() const { return m_eStatus == GRS_MODIFIED; }
124 SV_DECL_REF(DbGridRow)//STRIP008 ;
126 //==================================================================
127 // DbGridControl
128 //==================================================================
129 class DbGridColumn;
130 DECLARE_LIST(DbGridColumns, DbGridColumn*)//STRIP008 DECLARE_LIST(DbGridColumns, DbGridColumn*);
132 //==================================================================
133 class FmGridSelectionListener
135 public:
136 virtual void selectionChanged() = 0;
139 //==================================================================
140 class FmXGridSourcePropListener;
141 class DisposeListenerGridBridge;
142 typedef EditBrowseBox DbGridControl_Base;
143 class DbGridControl : public DbGridControl_Base
145 friend class FmXGridSourcePropListener;
146 friend class GridFieldValueListener;
147 friend class DisposeListenerGridBridge;
149 public:
150 //==================================================================
151 // NavigationBar
152 //==================================================================
153 class NavigationBar: public Control
155 class AbsolutePos : public NumericField
157 public:
158 AbsolutePos(Window* pParent, WinBits nStyle = 0);
160 virtual void KeyInput(const KeyEvent& rEvt);
161 virtual void LoseFocus();
164 friend class NavigationBar::AbsolutePos;
166 // zusaetzliche Controls
167 FixedText m_aRecordText;
168 AbsolutePos m_aAbsolute; // AbsolutePositionierung
169 FixedText m_aRecordOf;
170 FixedText m_aRecordCount;
172 ImageButton m_aFirstBtn; // ImageButton fuer 'gehe zum ersten Datensatz'
173 ImageButton m_aPrevBtn; // ImageButton fuer 'gehe zum vorhergehenden Datensatz'
174 ImageButton m_aNextBtn; // ImageButton fuer 'gehe zum naechsten Datensatz'
175 ImageButton m_aLastBtn; // ImageButton fuer 'gehe zum letzten Datensatz'
176 ImageButton m_aNewBtn; // ImageButton fuer 'gehe zum neuen Datensatz'
177 sal_uInt16 m_nDefaultWidth;
178 sal_uInt32 m_nCurrentPos;
180 sal_Bool m_bPositioning; // protect PositionDataSource against recursion
182 public:
183 // StatusIds fuer Controls der Bar
184 // wichtig fuers Invalidieren
185 enum State
187 RECORD_TEXT = 1,
188 RECORD_ABSOLUTE,
189 RECORD_OF,
190 RECORD_COUNT,
191 RECORD_FIRST,
192 RECORD_NEXT,
193 RECORD_PREV,
194 RECORD_LAST,
195 RECORD_NEW
198 NavigationBar(Window* pParent, WinBits nStyle = 0);
200 // Status Methoden fuer Controls
201 void InvalidateAll(sal_uInt32 nCurrentPos = -1, sal_Bool bAll = sal_False);
202 void InvalidateState(sal_uInt16 nWhich) {SetState(nWhich);}
203 void SetState(sal_uInt16 nWhich);
204 sal_Bool GetState(sal_uInt16 nWhich) const;
205 sal_uInt16 GetDefaultWidth() const {return m_nDefaultWidth;}
207 protected:
208 virtual void Resize();
209 virtual void Paint(const Rectangle& rRect);
210 virtual void StateChanged( StateChangedType nType );
212 private:
213 DECL_LINK(OnClick, Button*);
214 sal_uInt16 ArrangeControls();
216 void PositionDataSource(sal_Int32 nRecord);
219 friend class DbGridControl::NavigationBar;
221 public:
222 // diese Optionen werden verodert und geben an, welche der einzelnen feature
223 // freigegeben werden koennen, default ist readonly also 0
224 enum Option
226 OPT_READONLY = 0x00,
227 OPT_INSERT = 0x01,
228 OPT_UPDATE = 0x02,
229 OPT_DELETE = 0x04
232 private:
233 Font m_aDefaultFont;
234 Link m_aMasterStateProvider;
235 Link m_aMasterSlotExecutor;
237 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter;
238 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
240 DbGridColumns m_aColumns; // Spaltenbeschreibung
241 NavigationBar m_aBar;
242 DbGridRowRef m_xDataRow; // Zeile die modifiziert werden kann
243 // kommt vom DatenCursor
244 DbGridRowRef m_xSeekRow, // Zeile die von Iterator gesetzt wird
245 // kommt vom DatenCursor
247 m_xEmptyRow; // Datensatz zum einfuegen
249 sal_uInt32 m_nAsynAdjustEvent;
251 // if we modify the row for the new record, we automatically insert a "new new row".
252 // But if somebody else inserts a new record into the data source, we have to do the same.
253 // For that reason we have to listen to some properties of our data source.
254 ::comphelper::OPropertyChangeMultiplexer* m_pDataSourcePropMultiplexer;
255 FmXGridSourcePropListener* m_pDataSourcePropListener;
257 void* m_pFieldListeners;
258 // property listeners for field values
260 DisposeListenerGridBridge* m_pCursorDisposeListener;
261 // need to know about the diposing of the seek cursor
262 // construct analogous to the data source proplistener/multiplexer above :
263 // DisposeListenerGridBridge is a bridge from FmXDisposeListener which I don't want to be derived from
265 FmGridSelectionListener* m_pSelectionListener;
267 protected:
268 CursorWrapper* m_pDataCursor; // Cursor fuer Updates
269 CursorWrapper* m_pSeekCursor; // Cursor zum Seeken
271 private:
272 // dieses sind Laufvariablen
273 DbGridRowRef m_xCurrentRow; // Row an der aktuellen Zeile
274 DbGridRowRef m_xPaintRow; // Row die gerade drgestellt werden soll
275 sal_Int32 m_nSeekPos; // Position des SeekCursors
276 sal_Int32 m_nTotalCount; // wird gesetzt, wenn der DatenCursor mit dem Zählen der
277 // Datensätze fertig ist
278 // initial Wert ist -1
279 osl::Mutex m_aDestructionSafety;
280 osl::Mutex m_aAdjustSafety;
282 ::com::sun::star::util::Date
283 m_aNullDate; // NullDate of the Numberformatter;
285 BrowserMode m_nMode;
286 sal_Int32 m_nCurrentPos; // Aktuelle Position;
287 sal_uInt32 m_nDeleteEvent; // EventId fuer asychrone Loeschen von Zeilen
288 sal_uInt16 m_nOptions; // Was kann das Control (Insert, Update, Delete)
289 // default readonly
290 sal_uInt16 m_nOptionMask; // the mask of options to be enabled in setDataSource
291 // (with respect to the data source capabilities)
292 // defaults to (insert | update | delete)
294 sal_Bool m_bFrozen : 1; // Anzeige ist eingefroren
295 sal_Bool m_bDesignMode : 1; // default = sal_False
296 sal_Bool m_bRecordCountFinal : 1;
297 sal_Bool m_bMultiSelection : 1;
298 sal_Bool m_bNavigationBar : 1;
300 sal_Bool m_bSynchDisplay : 1;
301 sal_Bool m_bForceROController : 1;
302 sal_Bool m_bHandle : 1;
303 sal_Bool m_bFilterMode : 1;
304 sal_Bool m_bWantDestruction : 1;
305 sal_Bool m_bInAdjustDataSource : 1;
306 sal_Bool m_bPendingAdjustRows : 1; // if an async adjust is pending, is it for AdjustRows or AdjustDataSource ?
308 protected:
309 sal_Bool m_bUpdating : 1; // werden gerade updates durchgefuehrt
311 protected:
312 virtual sal_Bool SeekRow(long nRow);
313 virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
314 virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
315 virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const;
316 virtual RowStatus GetRowStatus(long nRow) const;
317 virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
318 virtual void CursorMoved();
319 virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
320 virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
321 virtual void Command(const CommandEvent& rEvt);
322 virtual long PreNotify(NotifyEvent& rEvt);
323 virtual void KeyInput(const KeyEvent& rEvt);
324 virtual void StateChanged( StateChangedType nType );
325 virtual void DataChanged( const DataChangedEvent& rDCEvt );
326 virtual void Select();
328 virtual CellController* GetController(long nRow, sal_uInt16 nCol);
330 virtual void CellModified();
331 virtual sal_Bool SaveModified();
332 virtual sal_Bool IsModified() const;
334 virtual sal_uInt16 AppendColumn(const String& rName, sal_uInt16 nWidth = 0, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = (sal_uInt16)-1);
335 virtual void RemoveColumn(sal_uInt16 nId);
336 virtual DbGridColumn* CreateColumn(sal_uInt16 nId, const DbGridRowRef& _xRow) const;
337 virtual void ColumnMoved(sal_uInt16 nId);
338 virtual sal_Bool SaveRow();
339 virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
341 /// hide a column
342 virtual void HideColumn(sal_uInt16 nId);
343 /// show a column
344 virtual void ShowColumn(sal_uInt16 nId);
346 /** This is called before executing a context menu for a row. rMenu contains the initial entries
347 handled by this base class' method (which always has to be called).
348 Derived classes may alter the menu in any way and handle any additional entries in
349 PostExecuteColumnContextMenu.
350 All disabled entries will be removed before executing the menu, so be careful with separators
351 near entries you probably wish to disable ...
353 virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu);
354 /** After executing the context menu for a row this method is called.
356 virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& rMenu, sal_uInt16 nExecutionResult);
358 virtual void DataSourcePropertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
360 virtual void FieldValueChanged(sal_uInt16 _nId, const ::com::sun::star::beans::PropertyChangeEvent& _evt);
361 virtual void FieldListenerDisposing(sal_uInt16 _nId);
363 virtual void disposing(sal_uInt16 _nId, const ::com::sun::star::lang::EventObject& _rEvt);
365 // DragSourceHelper overridables
366 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
368 void executeRowContextMenu( long _nRow, const Point& _rPreferredPos );
370 public:
371 DbGridControl(
372 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >,
373 Window* pParent,
374 WinBits nBits = WB_BORDER);
375 DbGridControl(
376 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >,
377 Window* pParent,
378 const ResId& rId);
380 virtual ~DbGridControl();
382 virtual void Init();
383 virtual void InitColumnsByFields(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xFields) = 0;
384 virtual void RemoveRows();
386 /** GetCellText returns the text at the given position
387 @param _nRow
388 the number of the row
389 @param _nColId
390 the ID of the column
391 @return
392 the text out of the cell
394 virtual String GetCellText(long _nRow, USHORT _nColId) const;
396 void RemoveRows(sal_Bool bNewCursor);
398 void InvalidateStatus();
400 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& getNumberFormatter() const {return m_xFormatter;}
402 // die Datenquelle
403 // die Optionen koennen die Updatefaehigkeiten noch einschraenken, nicht erweitern
404 virtual void setDataSource(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& rCursor,
405 sal_uInt16 nOpts = OPT_INSERT | OPT_UPDATE | OPT_DELETE);
406 virtual void Dispatch(sal_uInt16 nId);
408 CursorWrapper* getDataSource() const {return m_pDataCursor;}
409 const DbGridColumns& GetColumns() const {return m_aColumns;}
411 void EnableHandle(sal_Bool bEnable);
412 sal_Bool HasHandle() const {return m_bHandle;}
413 void InsertHandleColumn();
415 /// welche Position hat die Spalte mit der Id in der ::com::sun::star::sdbcx::View, die Handle-Column zahelt nicht mit
416 sal_uInt16 GetViewColumnPos( sal_uInt16 nId ) const { sal_uInt16 nPos = GetColumnPos(nId); return (nPos==(sal_uInt16)-1) ? -1 : nPos-1; }
417 /** welche Position hat die Spalte mit der Id in m_aColumns, also dem von GetColumns gelieferten ::com::sun::star::sdbcx::Container ?
418 (unterscheidet sich u.U. von der von GetViewColumnPos gelieferten, wenn es versteckt Spalten gibt)
420 sal_uInt16 GetModelColumnPos( sal_uInt16 nId ) const;
422 /// Anzahl der Spalten im Model
423 sal_uInt16 GetViewColCount() const { return ColCount() - 1; }
424 sal_uInt16 GetModelColCount() const { return (sal_uInt16)m_aColumns.Count(); }
425 /// umgekehrt zu GetViewColumnPos : Id zu Position, die erste Nicht-Handle-Column hat die Position 0
426 sal_uInt16 GetColumnIdFromViewPos( sal_uInt16 nPos ) const { return GetColumnId(nPos + 1); }
427 sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos ) const;
429 virtual void SetDesignMode(sal_Bool bMode);
430 sal_Bool IsDesignMode() const {return m_bDesignMode;}
431 sal_Bool IsOpen() const {return m_pSeekCursor != NULL;}
433 virtual void SetFilterMode(sal_Bool bMode);
434 sal_Bool IsFilterMode() const {return m_bFilterMode;}
435 sal_Bool IsFilterRow(long nRow) const {return m_bFilterMode && nRow == 0;}
437 void EnableNavigationBar(sal_Bool bEnable);
438 sal_Bool HasNavigationBar() const {return m_bNavigationBar;}
440 sal_uInt16 GetOptions() const {return m_nOptions;}
441 NavigationBar& GetNavigationBar() {return m_aBar;}
442 sal_uInt16 SetOptions(sal_uInt16 nOpt);
443 // The new options are interpreted with respect to the current data source. If it is unable
444 // to update, to insert or to restore, the according options are ignored. If the grid isn't
445 // connected to a data source, all options except OPT_READONLY are ignored.
447 void SetMultiSelection(sal_Bool bMulti);
448 sal_Bool GetMultiSelection() const {return m_bMultiSelection;}
450 const ::com::sun::star::util::Date& getNullDate() const {return m_aNullDate;}
452 // Positionierung
453 void MoveToPosition(sal_uInt32 nPos);
454 void MoveToFirst();
455 void MoveToNext();
456 void MoveToPrev();
457 void MoveToLast();
458 void AppendNew();
460 // Abgleich der Cursor falls von außen der DatenCursor verschoben wurde
461 // Flag bedeutet ob ein Abgleich es Rowcounts vorgenommen werden soll
462 void AdjustDataSource(sal_Bool bFull = sal_False);
463 void Undo();
465 virtual void BeginCursorAction();
466 virtual void EndCursorAction();
468 // wird die aktuelle Zeile neu gesetzt
469 sal_Bool IsUpdating() const {return m_bUpdating;}
471 virtual void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
472 virtual void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
473 virtual void RowModified( long nRow, sal_uInt16 nColId = USHRT_MAX );
475 void resetCurrentRow();
477 sal_Bool getDisplaySynchron() const { return m_bSynchDisplay; }
478 void setDisplaySynchron(sal_Bool bSync);
479 void forceSyncDisplay();
480 // wenn das auf sal_False gesetzt wird, laeuft die Anzeige nicht mehr mit der aktuellen Cursor-Position synchron
481 // (soll heissen, in AdjustDataSource wird nicht in die zur CursorPosition gehoerenden Zeile gesprungen)
482 // wer das benutzt, sollte bitte wissen, was er tut, da zum Beispiel die Eingabe von Daten in einer Zeile auf der Anzeige,
483 // die gar nicht mit der Position des Cursors synchron ist, ziemlich kritisch sein koennte
485 sal_Bool isForcedROController() const { return m_bForceROController; }
486 void forceROController(sal_Bool bForce);
487 // Setzt man das auf sal_True, hat das GridControl immer einen ::com::sun::star::frame::Controller, der allerdings read-only ist. Ausserdem
488 // wird die Edit-Zeile des Controllers so eingestellt, dass sie ihre Selektion bei Fokus-Verlust weiterhin anzeigt.
490 const DbGridRowRef& GetCurrentRow() const {return m_xCurrentRow;}
492 void SetStateProvider(const Link& rProvider) { m_aMasterStateProvider = rProvider; }
493 // if this link is set the given provider will be asked for the state of my items.
494 // the return values are interpreted as follows :
495 // <0 -> not specified (use default mechanism to determine the state)
496 // ==0 -> the item is disabled
497 // >0 -> the item is enabled
498 void SetSlotExecutor(const Link& rExecutor) { m_aMasterSlotExecutor = rExecutor; }
499 // analogous : if this link is set, all nav-bar slots will be routed through it when executed
500 // if the handler returns nonzero, no further handling of the slot occurs
502 void EnablePermanentCursor(sal_Bool bEnable);
503 sal_Bool IsPermanentCursorEnabled() const;
505 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
506 getServiceManager() const { return m_xServiceFactory; }
508 /// returns <TRUE/> if the text of the given cell can be copied into the clipboard
509 sal_Bool canCopyCellText(sal_Int32 _nRow, sal_Int16 _nColId);
510 /// copies the text of the given cell into the clipboard
511 void copyCellText(sal_Int32 _nRow, sal_Int16 _nColId);
513 // selectin listener handling
514 FmGridSelectionListener* getSelectionListener() const { return m_pSelectionListener; }
515 void setSelectionListener(FmGridSelectionListener* _pListener) { m_pSelectionListener = _pListener; }
517 // helper class to grant access to selected methods from within the DbCellControl class
518 struct GrantCellControlAccess
520 friend class DbCellControl;
521 protected:
522 GrantCellControlAccess() { }
525 /// called when a controller needs to be re-initialized
526 void refreshController(sal_uInt16 _nColId, GrantCellControlAccess _aAccess);
528 /**
529 @return
530 The count of additional controls of the control area.
532 virtual sal_Int32 GetAccessibleControlCount() const;
534 /** Creates the accessible object of an additional control.
535 @param _nIndex
536 The 0-based index of the control.
537 @return
538 The XAccessible interface of the specified control.
540 virtual ::com::sun::star::uno::Reference<
541 ::com::sun::star::accessibility::XAccessible >
542 CreateAccessibleControl( sal_Int32 _nIndex );
544 // IAccessibleTableProvider
545 /** Creates the accessible object of a data table cell.
546 @param nRow The row index of the cell.
547 @param nColumnId The column ID of the cell.
548 @return The XAccessible interface of the specified cell. */
549 virtual ::com::sun::star::uno::Reference<
550 ::com::sun::star::accessibility::XAccessible >
551 CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId );
553 protected:
554 void RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, sal_Bool bUpdateCursor);
555 sal_Bool SeekCursor(long nRow, sal_Bool bAbsolute = sal_False);
556 void RemoveColumns(); // aufraeumen eigener strukturen
557 void AdjustRows();
558 sal_Int32 AlignSeekCursor();
559 sal_Bool SetCurrent(long nNewRow, sal_Bool bCancelInsert);
561 String GetCurrentRowCellText(DbGridColumn* pCol,const DbGridRowRef& _rRow) const;
562 virtual void DeleteSelectedRows();
563 sal_Bool IsValid(const DbGridRowRef& _xRow) const {return _xRow && _xRow->IsValid();}
565 // Zeile an der gerade eingefuegt wird
566 sal_Bool IsCurrentAppending() const;
568 // Leerzeile zum Einfuegen
569 sal_Bool IsEmptyRow(long nRow) const;
571 void SetSeekPos(sal_Int32 nPos) {m_nSeekPos = nPos;}
572 sal_Int32 GetCurrentPos() const {return m_nCurrentPos;}
573 sal_Int32 GetSeekPos() const {return m_nSeekPos;}
574 sal_Int32 GetTotalCount() const {return m_nTotalCount;}
576 const DbGridRowRef& GetEmptyRow() const {return m_xEmptyRow;}
577 const DbGridRowRef& GetSeekRow() const {return m_xSeekRow;}
578 CursorWrapper* GetSeekCursor() const {return m_pSeekCursor;}
580 void ConnectToFields();
581 void DisconnectFromFields();
583 void implAdjustInSolarThread(sal_Bool _bRows);
584 // calls AdjustRows or AdjustDataSource, synchron if the caller is running in the solar thread, else asynchron
586 protected:
587 virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol);
588 void Construct();
589 void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
590 DECL_LINK(OnDelete, void*);
592 DECL_LINK(OnAsyncAdjust, void*);
593 // if the param is != NULL, AdjustRows will be called, else AdjustDataSource
596 SV_IMPL_REF(DbGridRow);
598 }//end of namespace binfilter
599 #endif // _SVX_GRIDCTRL_HXX