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