19 #ifndef INCLUDED_SVX_GRIDCTRL_HXX
20 #define INCLUDED_SVX_GRIDCTRL_HXX
22 #include <com/sun/star/util/Date.hpp>
27 #include <osl/mutex.hxx>
33 namespace comphelper {
class OPropertyChangeMultiplexer; }
44 bool CompareBookmark(
const css::uno::Any& aLeft,
const css::uno::Any& aRight);
66 ::std::vector< std::unique_ptr<::svxform::DataColumn> >
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 ]; }
84 void SetNew(
bool _bNew) { m_bIsNew = _bNew; }
85 bool IsNew()
const {
return m_bIsNew; }
87 const css::uno::Any&
GetBookmark()
const {
return m_aBookmark; }
110 #define GRID_COLUMN_NOT_FOUND SAL_MAX_UINT16
203 virtual void dispose()
override;
206 void InvalidateAll(sal_Int32 nCurrentPos,
bool bAll =
false);
234 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
252 css::uno::Reference< css::sdb::XRowsChangeListener>
293 bool m_bDesignMode : 1;
294 bool m_bRecordCountFinal : 1;
295 bool m_bNavigationBar : 1;
297 bool m_bSynchDisplay : 1;
299 bool m_bFilterMode : 1;
300 bool m_bWantDestruction : 1;
301 bool m_bPendingAdjustRows : 1;
302 bool m_bHideScrollbars : 1;
305 bool m_bUpdating : 1;
308 virtual bool SeekRow(sal_Int32 nRow)
override;
312 virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol)
override;
315 virtual sal_uInt32
GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId)
override;
321 virtual void Select()
override;
323 virtual ::svt::CellController*
GetController(sal_Int32 nRow, sal_uInt16 nCol)
override;
329 virtual sal_uInt16
AppendColumn(
const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = sal_uInt16(-1))
override;
331 std::unique_ptr<DbGridColumn> CreateColumn(sal_uInt16 nId);
333 virtual bool SaveRow()
override;
334 virtual bool IsTabAllowed(
bool bForward)
const override;
337 virtual void HideColumn(sal_uInt16 nId);
339 virtual void ShowColumn(sal_uInt16 nId);
348 virtual void PreExecuteRowContextMenu(sal_uInt16 nRow,
PopupMenu& rMenu);
351 virtual void PostExecuteRowContextMenu(sal_uInt16 nRow,
const PopupMenu& rMenu, sal_uInt16 nExecutionResult);
354 void DataSourcePropertyChanged(
const css::beans::PropertyChangeEvent& evt);
356 void FieldValueChanged(sal_uInt16 _nId);
357 void FieldListenerDisposing(sal_uInt16 _nId);
359 void disposing(sal_uInt16 _nId);
363 virtual void onRowChange();
365 virtual void onColumnChange();
370 void executeRowContextMenu( sal_Int32 _nRow,
const Point& _rPreferredPos );
374 css::uno::Reference< css::uno::XComponentContext >
const & _rxContext,
379 virtual void dispose()
override;
381 virtual void Init()
override;
382 virtual void InitColumnsByFields(
const css::uno::Reference< css::container::XIndexAccess >& xFields) = 0;
393 virtual OUString
GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
const override;
397 const css::uno::Reference< css::util::XNumberFormatter >&
getNumberFormatter()
const {
return m_xFormatter;}
401 void setDataSource(
const css::uno::Reference< css::sdbc::XRowSet >& rCursor,
403 virtual void Dispatch(sal_uInt16 nId)
override;
406 const std::vector< std::unique_ptr<DbGridColumn> >&
GetColumns()
const {
return m_aColumns;}
408 void EnableHandle(
bool bEnable);
418 sal_uInt16 GetModelColumnPos( sal_uInt16 nId )
const;
425 sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos )
const;
427 virtual void SetDesignMode(
bool bMode);
429 bool IsOpen()
const {
return m_pSeekCursor !=
nullptr;}
431 void SetFilterMode(
bool bMode);
433 bool IsFilterRow(sal_Int32 nRow)
const {
return m_bFilterMode && nRow == 0;}
435 void EnableNavigationBar(
bool bEnable);
448 void MoveToPosition(sal_uInt32 nPos);
459 void AdjustDataSource(
bool bFull =
false);
462 virtual void BeginCursorAction();
463 virtual void EndCursorAction();
468 void RowRemoved( sal_Int32 nRow, sal_Int32 nNumRows = 1,
bool bDoPaint =
true );
469 void RowInserted( sal_Int32 nRow, sal_Int32 nNumRows = 1,
bool bDoPaint =
true );
472 void resetCurrentRow();
475 void setDisplaySynchron(
bool bSync);
493 void EnablePermanentCursor(
bool bEnable);
494 bool IsPermanentCursorEnabled()
const;
502 void ForceHideScrollbars();
504 const css::uno::Reference< css::uno::XComponentContext >&
508 bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
510 void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
524 void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
542 virtual css::uno::Reference<
543 css::accessibility::XAccessible >
551 virtual css::uno::Reference<
552 css::accessibility::XAccessible >
556 void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen,
bool bUpdateCursor);
557 bool SeekCursor(sal_Int32 nRow,
bool bAbsolute =
false);
560 sal_Int32 AlignSeekCursor();
561 bool SetCurrent(sal_Int32 nNewRow);
564 virtual void DeleteSelectedRows();
568 bool IsCurrentAppending()
const;
571 bool IsInsertionRow(sal_Int32 nRow)
const;
582 void ConnectToFields();
583 void DisconnectFromFields();
585 void implAdjustInSolarThread(
bool _bRows);
599 #endif // INCLUDED_SVX_GRIDCTRL_HXX
void InsertHandleColumn(sal_uLong nWidth)
std::unique_ptr< weld::Button > m_xFirstBtn
virtual bool IsModified() const
#define GRID_COLUMN_NOT_FOUND
osl::Mutex m_aDestructionSafety
virtual void StartDrag(sal_Int8 _nAction, const Point &_rPosPixel) override
const std::vector< std::unique_ptr< DbGridColumn > > & GetColumns() const
GridRowStatus GetStatus() const
void setGridListener(FmGridListener *_pListener)
NavigationBar(vcl::Window *pParent)
VclPtr< NavigationBar > m_aBar
DbGridControlNavigationBarState
virtual bool DoKeyInput(const KeyEvent &rEvt) override
const DbGridRowRef & GetEmptyRow() const
FmXGridSourcePropListener * m_pDataSourcePropListener
DbGridControlOptions m_nOptionMask
std::unique_ptr< AbsolutePos > m_xAbsolute
#define DECL_LINK(Member, ArgType, RetType)
void PositionDataSource(sal_Int32 nRecord)
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
void SetStateProvider(const Link< DbGridControlNavigationBarState, int > &rProvider)
std::unique_ptr< weld::Button > m_xNextBtn
virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol)
virtual void StateChanged(StateChangedType nType) override
const DbGridRowRef & GetSeekRow(GrantControlAccess) const
virtual sal_Int32 GetAccessibleControlCount() const override
virtual void ColumnMoved(sal_uInt16 nId) override
void SetState(DbGridControlNavigationBarState nWhich)
virtual void dispose() override
sal_uInt16 GetColumnPos(sal_uInt16 nColumnId) const
bool CompareBookmark(const css::uno::Any &aLeft, const css::uno::Any &aRight)
void RowInserted(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true, bool bKeepSelection=false)
sal_uInt16 GetModelColCount() const
virtual void Command(const CommandEvent &rEvt) override
bool IsDesignMode() const
bool IsFilterMode() const
std::unique_ptr< weld::Label > m_xRecordOf
bool IsFilterRow(sal_Int32 nRow) const
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const =0
bool HasField(sal_uInt32 nPos) const
const DbGridRowRef & GetPaintRow() const
std::unique_ptr< weld::Button > m_xPrevBtn
CursorWrapper * getDataSource() const
void RemoveColumn(sal_uInt16 nColumnId)
sal_uInt16 GetViewColCount() const
virtual void ArrangeControls(sal_uInt16 &nX, sal_uInt16 nY)
const css::uno::Reference< css::util::XNumberFormatter > & getNumberFormatter() const
virtual void KeyInput(const KeyEvent &rEvt) override
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
std::vector< std::unique_ptr< DbGridColumn > > m_aColumns
css::uno::Any m_aBookmark
virtual void CursorMoved() override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
sal_uInt16 GetColumnIdFromViewPos(sal_uInt16 nPos) const
void InvalidateState(DbGridControlNavigationBarState nWhich)
virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId)
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const
sal_Int32 GetCurrentPos() const
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pDataSourcePropMultiplexer
virtual bool IsTabAllowed(bool bForward) const
virtual void columnChanged()=0
bool getDisplaySynchron() const
DbGridControlOptions m_nOptions
std::unique_ptr< weld::Button > m_xLastBtn
void SetSlotExecutor(const Link< DbGridControlNavigationBarState, bool > &rExecutor)
virtual bool SaveModified()
DbGridControlOptions GetOptions() const
sal_uInt16 ArrangeControls()
std::unique_ptr< CursorWrapper > m_pSeekCursor
css::uno::Reference< css::sdb::XRowsChangeListener > m_xRowSetListener
virtual void PositionFired(sal_Int64 nRecord) override
CursorWrapper * GetSeekCursor(GrantControlAccess) const
ImplSVEvent * m_nAsynAdjustEvent
css::uno::Reference< css::uno::XComponentContext > m_xContext
const DbGridRowRef & GetCurrentRow() const
bool GetState(DbGridControlNavigationBarState nWhich) const
Link< DbGridControlNavigationBarState, int > m_aMasterStateProvider
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
::std::vector< std::unique_ptr<::svxform::DataColumn > > m_aVariants
std::unique_ptr< weld::Button > m_xNewBtn
bool HasNavigationBar() const
FmGridListener * m_pGridListener
virtual void RemoveRows()
sal_uInt16 GetColumnId(sal_uInt16 nPos) const
css::util::Date m_aNullDate
const css::util::Date & getNullDate() const
weld::Entry * GetWidget()
virtual CellController * GetController(sal_Int32 nRow, sal_uInt16 nCol)
NavigationBar & GetNavigationBar()
void SetSeekPos(sal_Int32 nPos, GrantControlAccess)
void InvalidateAll(sal_Int32 nCurrentPos, bool bAll=false)
std::unique_ptr< weld::Entry > m_xWidget
std::shared_ptr< weld::ButtonPressRepeater > m_xPrevRepeater
virtual void CellModified()
std::shared_ptr< weld::ButtonPressRepeater > m_xNextRepeater
VclPtr< NavigationBar > m_xParent
DbGridRowRef m_xCurrentRow
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 nIndex) override
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual RowStatus GetRowStatus(sal_Int32 nRow) const
sal_Int32 GetTotalCount() const
#define SVXCORE_DLLPUBLIC
sal_uInt16 GetViewColumnPos(sal_uInt16 nId) const
std::unique_ptr< CursorWrapper > m_pDataCursor
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 nRow, sal_uInt16 nColumnPos) override
osl::Mutex m_aAdjustSafety
void SetStatus(GridRowStatus _eStat)
static bool IsValid(const DbGridRowRef &_xRow)
sal_Int32 GetSeekPos() const
void RowRemoved(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true)
ImplSVEvent * m_nDeleteEvent
std::unique_ptr< weld::Label > m_xRecordCount
const ::svxform::DataColumn & GetField(sal_uInt32 nPos) const
const DbGridRowRef & GetSeekRow() const
DECL_LINK(OnClick, weld::Button &, void)
tools::SvRef< DbGridRow > DbGridRowRef
std::unique_ptr< weld::Label > m_xRecordText
virtual void selectionChanged()=0
virtual void VisibleRowsChanged(sal_Int32 nNewTopRow, sal_uInt16 nNumRows)
#define BROWSER_INVALIDID
virtual ~NavigationBar() override
virtual void Dispatch(sal_uInt16 nId)
AbsolutePos(std::unique_ptr< weld::Entry > xEntry, NavigationBar *pBar)
Link< DbGridControlNavigationBarState, bool > m_aMasterSlotExecutor
void RowModified(sal_Int32 nRow, sal_uInt16 nColId=BROWSER_INVALIDID)
sal_uInt16 ColCount() const
virtual void dispose() override
virtual bool SeekRow(sal_Int32 nRow) override
std::unique_ptr< DisposeListenerGridBridge > m_pCursorDisposeListener
void SetSeekPos(sal_Int32 nPos)