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