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>
33namespace comphelper {
class OPropertyChangeMultiplexer; }
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>
307 virtual bool SeekRow(sal_Int32 nRow)
override;
311 virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol)
override;
314 virtual sal_uInt32
GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId)
override;
320 virtual void Select()
override;
322 virtual ::svt::CellController*
GetController(sal_Int32 nRow, sal_uInt16 nCol)
override;
328 virtual sal_uInt16
AppendColumn(
const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = sal_uInt16(-1))
override;
330 std::unique_ptr<DbGridColumn> CreateColumn(sal_uInt16 nId);
332 virtual bool SaveRow()
override;
333 virtual bool IsTabAllowed(
bool bForward)
const override;
336 virtual void HideColumn(sal_uInt16 nId);
338 virtual void ShowColumn(sal_uInt16 nId);
347 virtual void PreExecuteRowContextMenu(
weld::Menu& rMenu);
350 virtual void PostExecuteRowContextMenu(
const OUString& rExecutionResult);
353 void DataSourcePropertyChanged(
const css::beans::PropertyChangeEvent& evt);
355 void FieldValueChanged(sal_uInt16 _nId);
356 void FieldListenerDisposing(sal_uInt16 _nId);
358 void disposing(sal_uInt16 _nId);
362 virtual void onRowChange();
364 virtual void onColumnChange();
369 void executeRowContextMenu(
const Point& _rPreferredPos);
373 css::uno::Reference< css::uno::XComponentContext >
const & _rxContext,
378 virtual void dispose()
override;
380 virtual void Init()
override;
392 virtual OUString
GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
const override;
396 const css::uno::Reference< css::util::XNumberFormatter >&
getNumberFormatter()
const {
return m_xFormatter;}
400 void setDataSource(
const css::uno::Reference< css::sdbc::XRowSet >& rCursor,
402 virtual void Dispatch(sal_uInt16 nId)
override;
405 const std::vector< std::unique_ptr<DbGridColumn> >&
GetColumns()
const {
return m_aColumns;}
407 void EnableHandle(
bool bEnable);
417 sal_uInt16 GetModelColumnPos( sal_uInt16 nId )
const;
424 sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos )
const;
426 virtual void SetDesignMode(
bool bMode);
428 bool IsOpen()
const {
return m_pSeekCursor !=
nullptr;}
430 void SetFilterMode(
bool bMode);
432 bool IsFilterRow(sal_Int32 nRow)
const {
return m_bFilterMode && nRow == 0;}
434 void EnableNavigationBar(
bool bEnable);
447 void MoveToPosition(sal_uInt32 nPos);
458 void AdjustDataSource(
bool bFull =
false);
461 virtual void BeginCursorAction();
462 virtual void EndCursorAction();
467 void RowRemoved( sal_Int32 nRow, sal_Int32 nNumRows = 1,
bool bDoPaint =
true );
468 void RowInserted( sal_Int32 nRow, sal_Int32 nNumRows = 1,
bool bDoPaint =
true );
471 void resetCurrentRow();
474 void setDisplaySynchron(
bool bSync);
492 void EnablePermanentCursor(
bool bEnable);
493 bool IsPermanentCursorEnabled()
const;
501 void ForceHideScrollbars();
503 const css::uno::Reference< css::uno::XComponentContext >&
507 bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
509 void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId);
540 virtual css::uno::Reference<
541 css::accessibility::XAccessible >
549 virtual css::uno::Reference<
550 css::accessibility::XAccessible >
554 void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen,
bool bUpdateCursor);
555 bool SeekCursor(sal_Int32 nRow,
bool bAbsolute =
false);
558 sal_Int32 AlignSeekCursor();
559 bool SetCurrent(sal_Int32 nNewRow);
562 virtual void DeleteSelectedRows();
566 bool IsCurrentAppending()
const;
569 bool IsInsertionRow(sal_Int32 nRow)
const;
580 void ConnectToFields();
581 void DisconnectFromFields();
583 void implAdjustInSolarThread(
bool _bRows);
Reference< XComponentContext > m_xContext
#define BROWSER_INVALIDID
void RowRemoved(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true)
sal_uInt16 GetColumnId(sal_uInt16 nPos) const
virtual void Command(const CommandEvent &rEvt) override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 nRow, sal_uInt16 nColumnPos) override
sal_uInt16 ColCount() const
void InsertHandleColumn(sal_uLong nWidth)
void RowModified(sal_Int32 nRow, sal_uInt16 nColId=BROWSER_INVALIDID)
sal_uInt16 GetColumnPos(sal_uInt16 nColumnId) const
void RemoveColumn(sal_uInt16 nColumnId)
virtual void StartDrag(sal_Int8 _nAction, const Point &_rPosPixel) override
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const
void RowInserted(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true, bool bKeepSelection=false)
virtual void VisibleRowsChanged(sal_Int32 nNewTopRow, sal_uInt16 nNumRows)
CursorWrapper * getDataSource() const
const css::util::Date & getNullDate() const
const css::uno::Reference< css::util::XNumberFormatter > & getNumberFormatter() const
Link< DbGridControlNavigationBarState, int > m_aMasterStateProvider
css::util::Date m_aNullDate
void SetSeekPos(sal_Int32 nPos, GrantControlAccess)
bool IsDesignMode() const
bool getDisplaySynchron() const
CursorWrapper * GetSeekCursor(GrantControlAccess) const
DECL_DLLPRIVATE_LINK(OnDelete, void *, void)
const std::vector< std::unique_ptr< DbGridColumn > > & GetColumns() const
FmXGridSourcePropListener * m_pDataSourcePropListener
bool IsFilterMode() const
sal_uInt16 GetViewColumnPos(sal_uInt16 nId) const
bool m_bPendingAdjustRows
ImplSVEvent * m_nDeleteEvent
void SetSlotExecutor(const Link< DbGridControlNavigationBarState, bool > &rExecutor)
const DbGridRowRef & GetSeekRow(GrantControlAccess) const
void SetSeekPos(sal_Int32 nPos)
sal_uInt16 GetColumnIdFromViewPos(sal_uInt16 nPos) const
const DbGridRowRef & GetSeekRow() const
void SetStateProvider(const Link< DbGridControlNavigationBarState, int > &rProvider)
DbGridControlOptions GetOptions() const
std::vector< std::unique_ptr< DbGridColumn > > m_aColumns
const DbGridRowRef & GetCurrentRow() const
ImplSVEvent * m_nAsynAdjustEvent
osl::Mutex m_aDestructionSafety
void setGridListener(FmGridListener *_pListener)
css::uno::Reference< css::uno::XComponentContext > m_xContext
std::unique_ptr< CursorWrapper > m_pSeekCursor
sal_Int32 GetSeekPos() const
css::uno::Reference< css::sdb::XRowsChangeListener > m_xRowSetListener
std::unique_ptr< DisposeListenerGridBridge > m_pCursorDisposeListener
sal_uInt16 GetModelColCount() const
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
sal_Int32 GetTotalCount() const
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pDataSourcePropMultiplexer
DbGridControlOptions m_nOptionMask
osl::Mutex m_aAdjustSafety
DbGridControlOptions m_nOptions
Link< DbGridControlNavigationBarState, bool > m_aMasterSlotExecutor
DECL_DLLPRIVATE_LINK(OnAsyncAdjust, void *, void)
std::unique_ptr< CursorWrapper > m_pDataCursor
sal_uInt16 GetViewColCount() const
NavigationBar & GetNavigationBar()
DbGridRowRef m_xCurrentRow
bool HasNavigationBar() const
const DbGridRowRef & GetEmptyRow() const
FmGridListener * m_pGridListener
virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess > &xFields)=0
const DbGridRowRef & GetPaintRow() const
VclPtr< NavigationBar > m_aBar
sal_Int32 GetCurrentPos() const
bool IsFilterRow(sal_Int32 nRow) const
static bool IsValid(const DbGridRowRef &_xRow)
void SetStatus(GridRowStatus _eStat)
::std::vector< std::unique_ptr<::svxform::DataColumn > > m_aVariants
GridRowStatus GetStatus() const
css::uno::Any m_aBookmark
const css::uno::Any & GetBookmark() const
bool HasField(sal_uInt32 nPos) const
const ::svxform::DataColumn & GetField(sal_uInt32 nPos) const
virtual void columnChanged()=0
virtual void selectionChanged()=0
weld::Entry * GetWidget()
virtual bool DoKeyInput(const KeyEvent &rEvt) override
virtual void PositionFired(sal_Int64 nRecord) override
VclPtr< NavigationBar > m_xParent
AbsolutePos(std::unique_ptr< weld::Entry > xEntry, NavigationBar *pBar)
std::unique_ptr< weld::Button > m_xPrevBtn
std::unique_ptr< weld::Label > m_xRecordOf
DECL_LINK(OnClick, weld::Button &, void)
NavigationBar(vcl::Window *pParent)
sal_uInt16 ArrangeControls()
std::unique_ptr< weld::Label > m_xRecordCount
std::unique_ptr< weld::Button > m_xLastBtn
std::unique_ptr< weld::Label > m_xRecordText
void PositionDataSource(sal_Int32 nRecord)
void SetState(DbGridControlNavigationBarState nWhich)
std::unique_ptr< weld::Button > m_xNextBtn
virtual void dispose() override
std::shared_ptr< weld::ButtonPressRepeater > m_xNextRepeater
std::unique_ptr< AbsolutePos > m_xAbsolute
void InvalidateAll(sal_Int32 nCurrentPos, bool bAll=false)
virtual ~NavigationBar() override
void InvalidateState(DbGridControlNavigationBarState nWhich)
bool GetState(DbGridControlNavigationBarState nWhich) const
std::unique_ptr< weld::Button > m_xNewBtn
std::unique_ptr< weld::Button > m_xFirstBtn
std::shared_ptr< weld::ButtonPressRepeater > m_xPrevRepeater
std::unique_ptr< weld::Entry > m_xWidget
virtual CellController * GetController(sal_Int32 nRow, sal_uInt16 nCol)
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const=0
virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId)
virtual void Dispatch(sal_uInt16 nId)
virtual bool IsTabAllowed(bool bForward) const
virtual void CursorMoved() override
virtual void KeyInput(const KeyEvent &rEvt) override
virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol)
virtual RowStatus GetRowStatus(sal_Int32 nRow) const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 nIndex) override
virtual void RemoveRows()
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void StateChanged(StateChangedType nType) override
virtual bool SaveModified()
virtual void ColumnMoved(sal_uInt16 nId) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual sal_uInt16 AppendColumn(const OUString &rName, sal_uInt16 nWidth, sal_uInt16 nPos=HEADERBAR_APPEND, sal_uInt16 nId=sal_uInt16(-1))
virtual bool SeekRow(sal_Int32 nRow) override
virtual sal_Int32 GetAccessibleControlCount() const override
virtual bool IsModified() const
virtual void ArrangeControls(sal_uInt16 &nX, sal_uInt16 nY)
virtual void dispose() override
virtual void CellModified()
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
bool CompareBookmark(const css::uno::Any &aLeft, const css::uno::Any &aRight)
tools::SvRef< DbGridRow > DbGridRowRef
#define GRID_COLUMN_NOT_FOUND
DbGridControlNavigationBarState
class SvxPropertySetInfoPool
#define SVXCORE_DLLPUBLIC