LibreOffice Module svx (master)  1
gridctrl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SVX_GRIDCTRL_HXX
20 #define INCLUDED_SVX_GRIDCTRL_HXX
21 
22 #include <com/sun/star/util/Date.hpp>
23 #include <vcl/field.hxx>
24 
25 #include <tools/ref.hxx>
27 #include <osl/mutex.hxx>
28 #include <svx/svxdllapi.h>
29 #include <o3tl/typed_flags_set.hxx>
30 #include <memory>
31 #include <vector>
32 
33 namespace comphelper { class OPropertyChangeMultiplexer; }
34 namespace com::sun::star::beans { struct PropertyChangeEvent; }
35 namespace com::sun::star::container { class XIndexAccess; }
36 namespace com::sun::star::sdbc { class XRowSet; }
37 namespace com::sun::star::sdb { class XRowsChangeListener; }
38 namespace com::sun::star::uno { class XComponentContext; }
39 namespace com::sun::star::util { class XNumberFormatter; }
40 
41 class Button;
42 class ImageButton;
43 class FixedText;
44 
45 class CursorWrapper;
46 
47 bool CompareBookmark(const css::uno::Any& aLeft, const css::uno::Any& aRight);
48 
49 namespace svxform
50 {
51  class DataColumn;
52 }
53 
54 enum class GridRowStatus
55 {
56  Clean,
57  Modified,
58  Deleted,
59  Invalid
60 };
61 
62 
63 // DbGridRow, description of rows
64 
65 
66 class SAL_DLLPUBLIC_RTTI DbGridRow final : public SvRefBase
67 {
68  css::uno::Any m_aBookmark; // Bookmark of the row, can be set
69  ::std::vector< std::unique_ptr<::svxform::DataColumn> >
72  bool m_bIsNew;
73  // row is no longer valid
74  // is removed on the next positioning
75 public:
76  DbGridRow();
77  DbGridRow(CursorWrapper* pCur, bool bPaintCursor);
78  void SetState(CursorWrapper* pCur, bool bPaintCursor);
79 
80  virtual ~DbGridRow() override;
81 
82  bool HasField(sal_uInt32 nPos) const { return nPos < m_aVariants.size(); }
83  const ::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants[ nPos ]; }
84 
85  void SetStatus(GridRowStatus _eStat) { m_eStatus = _eStat; }
86  GridRowStatus GetStatus() const { return m_eStatus; }
87  void SetNew(bool _bNew) { m_bIsNew = _bNew; }
88  bool IsNew() const { return m_bIsNew; }
89 
90  const css::uno::Any& GetBookmark() const { return m_aBookmark; }
91 
92  bool IsValid() const { return m_eStatus == GridRowStatus::Clean || m_eStatus == GridRowStatus::Modified; }
93  bool IsModified() const { return m_eStatus == GridRowStatus::Modified; }
94 };
95 
97 
98 
99 // DbGridControl
100 
101 class DbGridColumn;
102 
104 {
105 public:
106  virtual void selectionChanged() = 0;
107  virtual void columnChanged() = 0;
108 
109 protected:
111 };
112 
113 #define GRID_COLUMN_NOT_FOUND SAL_MAX_UINT16
114 
115 
116 // InitWindowFacet, describing which aspect of a column's Window to (re-)initialize
117 
118 enum class InitWindowFacet
119 {
120  Font = 0x01,
121  Foreground = 0x02,
122  Background = 0x04,
123  WritingMode = 0x08,
124  All = 0x0F
125 };
126 namespace o3tl
127 {
128  template<> struct typed_flags<InitWindowFacet> : is_typed_flags<InitWindowFacet, 0x0f> {};
129 }
130 
131 
132 // these options are or'ed and indicate, which of the single
133 // features can be released, default is readonly which means 0
135 {
136  Readonly = 0x00,
137  Insert = 0x01,
138  Update = 0x02,
139  Delete = 0x04
140 };
141 namespace o3tl
142 {
143  template<> struct typed_flags<DbGridControlOptions> : is_typed_flags<DbGridControlOptions, 0x07> {};
144 }
145 
146 // StatusIds for Controls of the Bar
147 // important for invalidation
149 {
150  NONE,
151  Text,
152  Absolute,
153  Of,
154  Count,
155  First,
156  Next,
157  Prev,
158  Last,
159  New,
160  Undo // related to SID_FM_RECORD_UNDO
161 };
162 
166 {
170 
171 public:
172 
173  // NavigationBar
174 
175  class SAL_DLLPRIVATE NavigationBar final : public Control
176  {
177  class AbsolutePos : public NumericField
178  {
179  public:
180  AbsolutePos(vcl::Window* pParent, WinBits nStyle);
181 
182  virtual void KeyInput(const KeyEvent& rEvt) override;
183  virtual void LoseFocus() override;
184  };
185 
187 
188  // additional controls
190  VclPtr<AbsolutePos> m_aAbsolute; // absolute positioning
193 
194  VclPtr<ImageButton> m_aFirstBtn; // ImageButton for 'go to the first record'
195  VclPtr<ImageButton> m_aPrevBtn; // ImageButton for 'go to the previous record'
196  VclPtr<ImageButton> m_aNextBtn; // ImageButton for 'go to the next record'
197  VclPtr<ImageButton> m_aLastBtn; // ImageButton for 'go to the last record'
198  VclPtr<ImageButton> m_aNewBtn; // ImageButton for 'go to a new record'
199  sal_Int32 m_nCurrentPos;
200 
201  bool m_bPositioning; // protect PositionDataSource against recursion
202 
203  public:
204  NavigationBar(vcl::Window* pParent);
205  virtual ~NavigationBar() override;
206  virtual void dispose() override;
207 
208  // Status methods for Controls
209  void InvalidateAll(sal_Int32 nCurrentPos, bool bAll = false);
210  void InvalidateState(DbGridControlNavigationBarState nWhich) {SetState(nWhich);}
211  void SetState(DbGridControlNavigationBarState nWhich);
212  bool GetState(DbGridControlNavigationBarState nWhich) const;
213  sal_uInt16 ArrangeControls();
214 
215  private:
216  virtual void Resize() override;
217  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
218  virtual void StateChanged( StateChangedType nType ) override;
219 
220  DECL_LINK(OnClick, Button*, void);
221 
222  void PositionDataSource(sal_Int32 nRecord);
223  };
224 
226 
227 private:
230 
231  css::uno::Reference< css::util::XNumberFormatter > m_xFormatter;
232  css::uno::Reference< css::uno::XComponentContext > m_xContext;
233 
234  std::vector< std::unique_ptr<DbGridColumn> > m_aColumns; // Column description
236  DbGridRowRef m_xDataRow; // Row which can be modified
237  // comes from the data cursor
238  DbGridRowRef m_xSeekRow, // Row to which the iterator can set
239  // comes from the data cursor
240 
241  m_xEmptyRow; // record set to insert
242 
244 
245  // if we modify the row for the new record, we automatically insert a "new new row".
246  // But if somebody else inserts a new record into the data source, we have to do the same.
247  // For that reason we have to listen to some properties of our data source.
250  css::uno::Reference< css::sdb::XRowsChangeListener>
251  m_xRowSetListener; // get notification when rows were changed
252 
254  // property listeners for field values
255 
256  std::unique_ptr<DisposeListenerGridBridge> m_pCursorDisposeListener;
257  // need to know about the disposing of the seek cursor
258  // construct analogous to the data source proplistener/multiplexer above :
259  // DisposeListenerGridBridge is a bridge from FmXDisposeListener which I don't want to be derived from
260 
262 
263 protected:
264  std::unique_ptr<CursorWrapper> m_pDataCursor; // Cursor for Updates
265  std::unique_ptr<CursorWrapper> m_pSeekCursor; // Cursor for Seeking
266 
267 private:
268  // iteration variables
270  DbGridRowRef m_xPaintRow; // Row to be displayed
271  sal_Int32 m_nSeekPos; // Position of the SeekCursor
272  sal_Int32 m_nTotalCount; // is set when the data cursor finished counting the
273  // records. Initial value is -1
275  osl::Mutex m_aAdjustSafety;
276 
277  css::util::Date
278  m_aNullDate; // NullDate of the Numberformatter;
279 
281  sal_Int32 m_nCurrentPos; // Current position;
282  ImplSVEvent * m_nDeleteEvent; // EventId for asynchronous deletion of rows
283  DbGridControlOptions m_nOptions; // What is the able to do (Insert, Update, Delete)
284  // default readonly
285  DbGridControlOptions m_nOptionMask; // the mask of options to be enabled in setDataSource
286  // (with respect to the data source capabilities)
287  // defaults to (insert | update | delete)
288  sal_uInt16 m_nLastColId;
290 
291  bool m_bDesignMode : 1; // default = sal_False
294 
295  bool m_bSynchDisplay : 1;
296  bool m_bHandle : 1;
297  bool m_bFilterMode : 1;
299  bool m_bPendingAdjustRows : 1; // if an async adjust is pending, is it for AdjustRows or AdjustDataSource ?
301 
302 protected:
303  bool m_bUpdating : 1; // are any updates being executed right now?
304 
305 protected:
306  virtual bool SeekRow(long nRow) override;
307  virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows) override;
308  virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId) const override;
309  virtual RowStatus GetRowStatus(long nRow) const override;
310  virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) override;
311  virtual void CursorMoved() override;
312  virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY) override;
313  virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override;
314  virtual void Command(const CommandEvent& rEvt) override;
315  virtual bool PreNotify(NotifyEvent& rEvt) override;
316  virtual void KeyInput(const KeyEvent& rEvt) override;
317  virtual void StateChanged( StateChangedType nType ) override;
318  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
319  virtual void Select() override;
320 
321  virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override;
322 
323  virtual void CellModified() override;
324  virtual bool SaveModified() override;
325  virtual bool IsModified() const override;
326 
327  virtual sal_uInt16 AppendColumn(const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = sal_uInt16(-1)) override;
328  void RemoveColumn(sal_uInt16 nId);
329  std::unique_ptr<DbGridColumn> CreateColumn(sal_uInt16 nId) const;
330  virtual void ColumnMoved(sal_uInt16 nId) override;
331  virtual bool SaveRow() override;
332  virtual bool IsTabAllowed(bool bForward) const override;
333 
335  virtual void HideColumn(sal_uInt16 nId);
337  virtual void ShowColumn(sal_uInt16 nId);
338 
346  virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu);
349  virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& rMenu, sal_uInt16 nExecutionResult);
350 
352  void DataSourcePropertyChanged(const css::beans::PropertyChangeEvent& evt);
353 
354  void FieldValueChanged(sal_uInt16 _nId);
355  void FieldListenerDisposing(sal_uInt16 _nId);
356 
357  void disposing(sal_uInt16 _nId);
358 
359  // own overridables
361  virtual void onRowChange();
363  virtual void onColumnChange();
364 
365  // DragSourceHelper overridables
366  virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
367 
368  void executeRowContextMenu( long _nRow, const Point& _rPreferredPos );
369 
370 public:
372  css::uno::Reference< css::uno::XComponentContext > const & _rxContext,
373  vcl::Window* pParent,
374  WinBits nBits);
375 
376  virtual ~DbGridControl() override;
377  virtual void dispose() override;
378 
379  virtual void Init() override;
380  virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess >& xFields) = 0;
381  virtual void RemoveRows() override;
382 
391  virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const override;
392 
393  void RemoveRows(bool bNewCursor);
394 
395  const css::uno::Reference< css::util::XNumberFormatter >& getNumberFormatter() const {return m_xFormatter;}
396 
397  // the data source
398  // the options can restrict but not extend the update abilities
399  void setDataSource(const css::uno::Reference< css::sdbc::XRowSet >& rCursor,
401  virtual void Dispatch(sal_uInt16 nId) override;
402 
403  CursorWrapper* getDataSource() const {return m_pDataCursor.get();}
404  const std::vector< std::unique_ptr<DbGridColumn> >& GetColumns() const {return m_aColumns;}
405 
406  void EnableHandle(bool bEnable);
407  bool HasHandle() const {return m_bHandle;}
408  void InsertHandleColumn();
409 
410  // which position does the column with the id in the View have, the handle column doesn't count
411  sal_uInt16 GetViewColumnPos( sal_uInt16 nId ) const { sal_uInt16 nPos = GetColumnPos(nId); return (nPos==BROWSER_INVALIDID) ? GRID_COLUMN_NOT_FOUND : nPos-1; }
412 
413  // which position does the column with the id in m_aColumns have, that means the css::sdbcx::Container
414  // returned from the GetColumns (may be different from the position returned by GetViewColumnPos
415  // if there are hidden columns)
416  sal_uInt16 GetModelColumnPos( sal_uInt16 nId ) const;
417 
418  // the number of columns in the model
419  sal_uInt16 GetViewColCount() const { return ColCount() - 1; }
420  sal_uInt16 GetModelColCount() const { return static_cast<sal_uInt16>(m_aColumns.size()); }
421  // reverse to GetViewColumnPos: Id of position, the first non-handle column has position 0
422  sal_uInt16 GetColumnIdFromViewPos( sal_uInt16 nPos ) const { return GetColumnId(nPos + 1); }
423  sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos ) const;
424 
425  virtual void SetDesignMode(bool bMode);
426  bool IsDesignMode() const {return m_bDesignMode;}
427  bool IsOpen() const {return m_pSeekCursor != nullptr;}
428 
429  void SetFilterMode(bool bMode);
430  bool IsFilterMode() const {return m_bFilterMode;}
431  bool IsFilterRow(long nRow) const {return m_bFilterMode && nRow == 0;}
432 
433  void EnableNavigationBar(bool bEnable);
434  bool HasNavigationBar() const {return m_bNavigationBar;}
435 
439  // The new options are interpreted with respect to the current data source. If it is unable
440  // to update, to insert or to restore, the according options are ignored. If the grid isn't
441  // connected to a data source, all options except OPT_READONLY are ignored.
442 
443  const css::util::Date& getNullDate() const {return m_aNullDate;}
444 
445  // positioning
446  void MoveToPosition(sal_uInt32 nPos);
447  void MoveToFirst();
448  void MoveToNext();
449  void MoveToPrev();
450  void MoveToLast();
451  void AppendNew();
452 
453  // adjustment of the cursors in case the data cursor has been
454  // moved from the outside.
455  // the flag indicates if an adjustment of the row count should be
456  // done as well
457  void AdjustDataSource(bool bFull = false);
458  void Undo();
459 
460  virtual void BeginCursorAction();
461  virtual void EndCursorAction();
462 
463  // is the current line being updated
464  bool IsUpdating() const {return m_bUpdating;}
465 
466  void RowRemoved( long nRow, long nNumRows = 1, bool bDoPaint = true );
467  void RowInserted( long nRow, long nNumRows = 1, bool bDoPaint = true );
468  void RowModified( long nRow );
469 
470  void resetCurrentRow();
471 
472  bool getDisplaySynchron() const { return m_bSynchDisplay; }
473  void setDisplaySynchron(bool bSync);
474  // when set to sal_False, the display is no longer in sync with the current cursor position
475  // (means that in AdjustDataSource we are jumping to a row not belonging to CursorPosition)
476  // when using this, you should know what you are doing, because for example entering data
477  // in a row in the display that is not in sync with the position of the cursor can be very critical
478 
479  const DbGridRowRef& GetCurrentRow() const {return m_xCurrentRow;}
480 
481  void SetStateProvider(const Link<DbGridControlNavigationBarState,int>& rProvider) { m_aMasterStateProvider = rProvider; }
482  // if this link is set the given provider will be asked for the state of my items.
483  // the return values are interpreted as follows :
484  // <0 -> not specified (use default mechanism to determine the state)
485  // ==0 -> the item is disabled
486  // >0 -> the item is enabled
487  void SetSlotExecutor(const Link<DbGridControlNavigationBarState,bool>& rExecutor) { m_aMasterSlotExecutor = rExecutor; }
488  // analogous : if this link is set, all nav-bar slots will be routed through it when executed
489  // if the handler returns nonzero, no further handling of the slot occurs
490 
491  void EnablePermanentCursor(bool bEnable);
492  bool IsPermanentCursorEnabled() const;
493 
500  void ForceHideScrollbars();
501 
502  const css::uno::Reference< css::uno::XComponentContext >&
503  getContext() const { return m_xContext; }
504 
506  bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
508  void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
509 
510  // select in listener handling
511  void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; }
512 
513  // helper class to grant access to selected methods from within the DbCellControl class
514  struct GrantControlAccess final
515  {
516  friend class DbCellControl;
517  friend class RowSetEventListener;
519  };
520 
522  void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
523 
524  CursorWrapper* GetSeekCursor(GrantControlAccess /*_aAccess*/) const { return m_pSeekCursor.get(); }
525  const DbGridRowRef& GetSeekRow(GrantControlAccess /*_aAccess*/) const { return m_xSeekRow; }
526  void SetSeekPos(sal_Int32 nPos,GrantControlAccess /*_aAccess*/) {m_nSeekPos = nPos;}
527 
532  virtual sal_Int32 GetAccessibleControlCount() const override;
533 
540  virtual css::uno::Reference<
541  css::accessibility::XAccessible >
542  CreateAccessibleControl( sal_Int32 _nIndex ) override;
543 
544  // IAccessibleTableProvider
549  virtual css::uno::Reference<
550  css::accessibility::XAccessible >
551  CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override;
552 
553 protected:
554  void RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor);
555  bool SeekCursor(long nRow, bool bAbsolute = false);
556  void RemoveColumns(); // cleaning of own structures
557  void AdjustRows();
558  sal_Int32 AlignSeekCursor();
559  bool SetCurrent(long nNewRow);
560 
561  OUString GetCurrentRowCellText(DbGridColumn const * pCol,const DbGridRowRef& _rRow) const;
562  virtual void DeleteSelectedRows();
563  static bool IsValid(const DbGridRowRef& _xRow) { return _xRow.is() && _xRow->IsValid(); }
564 
565  // row which is currently being appended
566  bool IsCurrentAppending() const;
567 
568  // empty row for insertion
569  bool IsInsertionRow(long nRow) const;
570 
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;}
575 
576  const DbGridRowRef& GetEmptyRow() const { return m_xEmptyRow; }
577  const DbGridRowRef& GetSeekRow() const { return m_xSeekRow; }
578  const DbGridRowRef& GetPaintRow() const { return m_xPaintRow; }
579 
580  void ConnectToFields();
581  void DisconnectFromFields();
582 
583  void implAdjustInSolarThread(bool _bRows);
584  // calls AdjustRows or AdjustDataSource, synchron if the caller is running in the solar thread, else asynchron
585 
586 protected:
587  void ImplInitWindow( const InitWindowFacet _eInitWhat );
588  DECL_LINK(OnDelete, void*, void);
589 
590  DECL_LINK(OnAsyncAdjust, void*, void);
591  // if the param is != NULL, AdjustRows will be called, else AdjustDataSource
592 
593 private:
595 };
596 
597 #endif // INCLUDED_SVX_GRIDCTRL_HXX
598 
599 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void InsertHandleColumn(sal_uLong nWidth)
std::unique_ptr< DbGridColumn > CreateColumn(sal_uInt16 nId) const
Definition: gridctrl.cxx:1637
bool is() const
virtual bool IsModified() const
#define GRID_COLUMN_NOT_FOUND
Definition: gridctrl.hxx:113
void setDataSource(const css::uno::Reference< css::sdbc::XRowSet > &rCursor, DbGridControlOptions nOpts=DbGridControlOptions::Insert|DbGridControlOptions::Update|DbGridControlOptions::Delete)
Definition: gridctrl.cxx:1397
osl::Mutex m_aDestructionSafety
Definition: gridctrl.hxx:274
void RowRemoved(long nRow, long nNumRows=1, bool bDoPaint=true)
virtual void StartDrag(sal_Int8 _nAction, const Point &_rPosPixel) override
const std::vector< std::unique_ptr< DbGridColumn > > & GetColumns() const
Definition: gridctrl.hxx:404
GridRowStatus GetStatus() const
Definition: gridctrl.hxx:86
void setGridListener(FmGridListener *_pListener)
Definition: gridctrl.hxx:511
VclPtr< NavigationBar > m_aBar
Definition: gridctrl.hxx:235
DbGridControlNavigationBarState
Definition: gridctrl.hxx:148
VclPtr< ImageButton > m_aLastBtn
Definition: gridctrl.hxx:197
void MoveToFirst()
Definition: gridctrl.cxx:2419
virtual void VisibleRowsChanged(long nNewTopRow, sal_uInt16 nNumRows)
virtual CellController * GetController(long nRow, sal_uInt16 nCol)
virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol)
const DbGridRowRef & GetEmptyRow() const
Definition: gridctrl.hxx:576
FmXGridSourcePropListener * m_pDataSourcePropListener
Definition: gridctrl.hxx:249
bool IsModified() const
Definition: gridctrl.hxx:93
DbGridControlOptions m_nOptionMask
Definition: gridctrl.hxx:285
void MoveToPosition(sal_uInt32 nPos)
Definition: gridctrl.cxx:2506
signed char sal_Int8
bool m_bDesignMode
Definition: gridctrl.hxx:291
virtual void Select()
virtual sal_uInt16 AppendColumn(const OUString &rName, sal_uInt16 nWidth, sal_uInt16 nPos=HEADERBAR_APPEND, sal_uInt16 nId=sal_uInt16(-1))
const css::uno::Any & GetBookmark() const
Definition: gridctrl.hxx:90
bool IsNew() const
Definition: gridctrl.hxx:88
void RemoveColumns()
void EnablePermanentCursor(bool bEnable)
Definition: gridctrl.cxx:1356
void SetStateProvider(const Link< DbGridControlNavigationBarState, int > &rProvider)
Definition: gridctrl.hxx:481
VclPtr< FixedText > m_aRecordOf
Definition: gridctrl.hxx:191
virtual void StateChanged(StateChangedType nType) override
bool IsOpen() const
Definition: gridctrl.hxx:427
void MoveToLast()
Definition: gridctrl.cxx:2425
const DbGridRowRef & GetSeekRow(GrantControlAccess) const
Definition: gridctrl.hxx:525
virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId)
virtual sal_Int32 GetAccessibleControlCount() const override
virtual void ColumnMoved(sal_uInt16 nId) override
DbGridControlOptions
Definition: gridctrl.hxx:134
void MoveToPrev()
Definition: gridctrl.cxx:2457
virtual void dispose() override
sal_uInt16 GetColumnPos(sal_uInt16 nColumnId) const
bool CompareBookmark(const css::uno::Any &aLeft, const css::uno::Any &aRight)
void SetFilterMode(bool bMode)
Definition: gridctrl.cxx:2591
void FieldListenerDisposing(sal_uInt16 _nId)
Definition: gridctrl.cxx:3562
sal_uInt16 GetModelColumnPos(sal_uInt16 nId) const
Definition: gridctrl.cxx:3402
sal_uInt16 GetModelColCount() const
Definition: gridctrl.hxx:420
virtual void Command(const CommandEvent &rEvt) override
bool IsDesignMode() const
Definition: gridctrl.hxx:426
void disposing(sal_uInt16 _nId)
Definition: gridctrl.cxx:3583
bool IsFilterMode() const
Definition: gridctrl.hxx:430
StateChangedType
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const =0
BrowserMode m_nMode
Definition: gridctrl.hxx:280
sal_Int64 WinBits
sal_Int32 m_nSeekPos
Definition: gridctrl.hxx:271
virtual void BeginCursorAction()
Definition: gridctrl.cxx:3454
bool HasField(sal_uInt32 nPos) const
Definition: gridctrl.hxx:82
const DbGridRowRef & GetPaintRow() const
Definition: gridctrl.hxx:578
sal_uInt16 m_nLastColId
Definition: gridctrl.hxx:288
bool m_bUpdating
Definition: gridctrl.hxx:303
bool IsUpdating() const
Definition: gridctrl.hxx:464
DbGridControl(css::uno::Reference< css::uno::XComponentContext > const &_rxContext, vcl::Window *pParent, WinBits nBits)
Definition: gridctrl.cxx:931
CursorWrapper * getDataSource() const
Definition: gridctrl.hxx:403
void RemoveColumn(sal_uInt16 nColumnId)
void DataSourcePropertyChanged(const css::beans::PropertyChangeEvent &evt)
Definition: gridctrl.cxx:2689
void EnableNavigationBar(bool bEnable)
Definition: gridctrl.cxx:1231
sal_uInt16 GetViewColCount() const
Definition: gridctrl.hxx:419
virtual void ArrangeControls(sal_uInt16 &nX, sal_uInt16 nY)
const css::uno::Reference< css::util::XNumberFormatter > & getNumberFormatter() const
Definition: gridctrl.hxx:395
virtual void KeyInput(const KeyEvent &rEvt) override
virtual void SetDesignMode(bool bMode)
Definition: gridctrl.cxx:2563
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
Definition: gridctrl.hxx:231
std::vector< std::unique_ptr< DbGridColumn > > m_aColumns
Definition: gridctrl.hxx:234
css::uno::Any m_aBookmark
Definition: gridctrl.hxx:68
void AppendNew()
Definition: gridctrl.cxx:2535
virtual void CursorMoved() override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const
bool IsPermanentCursorEnabled() const
Definition: gridctrl.cxx:1383
virtual bool SaveRow()
sal_uInt16 GetColumnIdFromViewPos(sal_uInt16 nPos) const
Definition: gridctrl.hxx:422
virtual void onColumnChange()
called when the current column changed
Definition: gridctrl.cxx:2156
void SetNew(bool _bNew)
Definition: gridctrl.hxx:87
sal_Int32 m_nCurrentPos
Definition: gridctrl.hxx:281
sal_Int32 GetCurrentPos() const
Definition: gridctrl.hxx:572
bool m_bPendingAdjustRows
Definition: gridctrl.hxx:299
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pDataSourcePropMultiplexer
Definition: gridctrl.hxx:248
bool m_bRecordCountFinal
Definition: gridctrl.hxx:292
bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
returns if the text of the given cell can be copied into the clipboard
Definition: gridctrl.cxx:2760
virtual bool IsTabAllowed(bool bForward) const
virtual void columnChanged()=0
bool getDisplaySynchron() const
Definition: gridctrl.hxx:472
DbGridControlOptions m_nOptions
Definition: gridctrl.hxx:283
bool m_bNavigationBar
Definition: gridctrl.hxx:293
void SetSlotExecutor(const Link< DbGridControlNavigationBarState, bool > &rExecutor)
Definition: gridctrl.hxx:487
virtual bool SaveModified()
void AdjustDataSource(bool bFull=false)
Definition: gridctrl.cxx:2172
DbGridControlOptions GetOptions() const
Definition: gridctrl.hxx:436
virtual void ShowColumn(sal_uInt16 nId)
show a column
Definition: gridctrl.cxx:3310
std::unique_ptr< CursorWrapper > m_pSeekCursor
Definition: gridctrl.hxx:265
css::uno::Reference< css::sdb::XRowsChangeListener > m_xRowSetListener
Definition: gridctrl.hxx:251
bool HasHandle() const
Definition: gridctrl.hxx:407
CursorWrapper * GetSeekCursor(GrantControlAccess) const
Definition: gridctrl.hxx:524
ImplSVEvent * m_nAsynAdjustEvent
Definition: gridctrl.hxx:243
virtual void EndCursorAction()
Definition: gridctrl.cxx:3471
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: gridctrl.hxx:232
const DbGridRowRef & GetCurrentRow() const
Definition: gridctrl.hxx:479
void FieldValueChanged(sal_uInt16 _nId)
Definition: gridctrl.cxx:3533
BrowserMode
Link< DbGridControlNavigationBarState, int > m_aMasterStateProvider
Definition: gridctrl.hxx:228
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
Definition: gridctrl.hxx:503
sal_uInt16 GetColumnIdFromModelPos(sal_uInt16 nPos) const
Definition: gridctrl.cxx:3375
::std::vector< std::unique_ptr<::svxform::DataColumn > > m_aVariants
Definition: gridctrl.hxx:70
VclPtr< ImageButton > m_aNextBtn
Definition: gridctrl.hxx:196
DbGridRowRef m_xPaintRow
Definition: gridctrl.hxx:270
bool HasNavigationBar() const
Definition: gridctrl.hxx:434
FmGridListener * m_pGridListener
Definition: gridctrl.hxx:261
sal_Int32 m_nTotalCount
Definition: gridctrl.hxx:272
void InvalidateState(DbGridControlNavigationBarState nWhich)
Definition: gridctrl.hxx:210
DbGridRowRef m_xDataRow
Definition: gridctrl.hxx:236
VclPtr< FixedText > m_aRecordCount
Definition: gridctrl.hxx:192
virtual void RemoveRows()
sal_uInt16 GetColumnId(sal_uInt16 nPos) const
long m_nLastRowId
Definition: gridctrl.hxx:289
virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu &rMenu)
This is called before executing a context menu for a row.
Definition: gridctrl.cxx:2655
css::util::Date m_aNullDate
Definition: gridctrl.hxx:278
void MoveToNext()
Definition: gridctrl.cxx:2464
const css::util::Date & getNullDate() const
Definition: gridctrl.hxx:443
virtual void Init()
NavigationBar & GetNavigationBar()
Definition: gridctrl.hxx:437
bool m_bWantDestruction
Definition: gridctrl.hxx:298
virtual bool SeekRow(long nRow) override
void SetSeekPos(sal_Int32 nPos, GrantControlAccess)
Definition: gridctrl.hxx:526
virtual void CellModified()
bool m_bSynchDisplay
Definition: gridctrl.hxx:295
DbGridRowRef m_xEmptyRow
Definition: gridctrl.hxx:238
VclPtr< ImageButton > m_aPrevBtn
Definition: gridctrl.hxx:195
DbGridRowRef m_xCurrentRow
Definition: gridctrl.hxx:269
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 nIndex) override
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void onRowChange()
called when the current row changed
Definition: gridctrl.cxx:2151
VclPtr< FixedText > m_aRecordText
Definition: gridctrl.hxx:189
VclPtr< AbsolutePos > m_aAbsolute
Definition: gridctrl.hxx:190
sal_Int32 GetTotalCount() const
Definition: gridctrl.hxx:574
void EnableHandle(bool bEnable)
Definition: gridctrl.cxx:1186
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
sal_uInt16 GetViewColumnPos(sal_uInt16 nId) const
Definition: gridctrl.hxx:411
void setDisplaySynchron(bool bSync)
Definition: gridctrl.cxx:2162
void * m_pFieldListeners
Definition: gridctrl.hxx:253
std::unique_ptr< CursorWrapper > m_pDataCursor
Definition: gridctrl.hxx:264
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 nRow, sal_uInt16 nColumnPos) override
osl::Mutex m_aAdjustSafety
Definition: gridctrl.hxx:275
void SetStatus(GridRowStatus _eStat)
Definition: gridctrl.hxx:85
VclPtr< ImageButton > m_aFirstBtn
Definition: gridctrl.hxx:194
static bool IsValid(const DbGridRowRef &_xRow)
Definition: gridctrl.hxx:563
virtual ~DbGridControl() override
Definition: gridctrl.cxx:991
sal_Int32 GetSeekPos() const
Definition: gridctrl.hxx:573
void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
copies the text of the given cell into the clipboard
Definition: gridctrl.cxx:2768
virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu &rMenu, sal_uInt16 nExecutionResult)
After executing the context menu for a row this method is called.
Definition: gridctrl.cxx:2674
virtual void HideColumn(sal_uInt16 nId)
hide a column
Definition: gridctrl.cxx:3281
ImplSVEvent * m_nDeleteEvent
Definition: gridctrl.hxx:282
DbGridControlOptions SetOptions(DbGridControlOptions nOpt)
Definition: gridctrl.cxx:1266
bool m_bFilterMode
Definition: gridctrl.hxx:297
const ::svxform::DataColumn & GetField(sal_uInt32 nPos) const
Definition: gridctrl.hxx:83
const DbGridRowRef & GetSeekRow() const
Definition: gridctrl.hxx:577
class FmSearchEngine - Impl class for FmSearchDialog
void ForceHideScrollbars()
forces both scrollbars to be hidden
Definition: gridctrl.cxx:1345
tools::SvRef< DbGridRow > DbGridRowRef
Definition: gridctrl.hxx:96
virtual void selectionChanged()=0
GridRowStatus
Definition: gridctrl.hxx:54
InitWindowFacet
Definition: gridctrl.hxx:118
virtual RowStatus GetRowStatus(long nRow) const
void resetCurrentRow()
Definition: gridctrl.cxx:3010
void dispose()
void RowModified(long nRow, sal_uInt16 nColId=BROWSER_INVALIDID)
bool m_bIsNew
Definition: gridctrl.hxx:72
virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess > &xFields)=0
bool IsFilterRow(long nRow) const
Definition: gridctrl.hxx:431
GridRowStatus m_eStatus
Definition: gridctrl.hxx:71
#define BROWSER_INVALIDID
bool IsValid() const
Definition: gridctrl.hxx:92
void RowInserted(long nRow, long nNumRows=1, bool bDoPaint=true, bool bKeepSelection=false)
virtual void Dispatch(sal_uInt16 nId)
VclPtr< ImageButton > m_aNewBtn
Definition: gridctrl.hxx:198
Link< DbGridControlNavigationBarState, bool > m_aMasterSlotExecutor
Definition: gridctrl.hxx:229
DbGridRowRef m_xSeekRow
Definition: gridctrl.hxx:238
sal_uInt16 nPos
sal_uInt16 ColCount() const
void executeRowContextMenu(long _nRow, const Point &_rPreferredPos)
Definition: gridctrl.cxx:2776
std::unique_ptr< DisposeListenerGridBridge > m_pCursorDisposeListener
Definition: gridctrl.hxx:256
void SetSeekPos(sal_Int32 nPos)
Definition: gridctrl.hxx:571
bool m_bHideScrollbars
Definition: gridctrl.hxx:300