30#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
31#include <com/sun/star/accessibility/XAccessible.hpp>
32#include <com/sun/star/sdb/XResultSetAccess.hpp>
33#include <com/sun/star/sdb/RowChangeAction.hpp>
34#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
35#include <com/sun/star/sdbc/SQLException.hpp>
36#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
37#include <com/sun/star/sdbc/XRowSet.hpp>
38#include <com/sun/star/sdbcx/Privilege.hpp>
39#include <com/sun/star/util/NumberFormatter.hpp>
40#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
41#include <com/sun/star/beans/XPropertySet.hpp>
42#include <com/sun/star/beans/PropertyChangeEvent.hpp>
43#include <com/sun/star/container/XIndexAccess.hpp>
52#include <svx/strings.hrc>
80#define ROWSTATUS(row) (!row.is() ? "NULL" : row->GetStatus() == GridRowStatus::Clean ? "CLEAN" : row->GetStatus() == GridRowStatus::Modified ? "MODIFIED" : row->GetStatus() == GridRowStatus::Deleted ? "DELETED" : "INVALID")
83 BrowserMode::COLUMNSELECTION
84 | BrowserMode::MULTISELECTION
85 | BrowserMode::KEEPHIGHLIGHT
86 | BrowserMode::TRACKING_TIPS
89 | BrowserMode::HEADERBAR_NEW;
101 virtual void SAL_CALL
disposing(
const css::lang::EventObject& )
override
104 virtual void SAL_CALL
rowsChanged(
const css::sdb::RowsChangeEvent& i_aEvt)
override
106 if ( i_aEvt.Action != RowChangeAction::UPDATE )
112 for(
const Any& rBookmark : i_aEvt.Bookmarks)
116 rSeekRow->SetState(pSeek,
true);
117 sal_Int32 nSeekPos = pSeek->
getRow() - 1;
157 m_pRealListener = new ::comphelper::OPropertyChangeMultiplexer(
this, _rField);
239 return aLeft == aRight;
264 DBG_ASSERT(
m_pParent,
"FmXGridSourcePropListener::FmXGridSourcePropListener : invalid parent !");
271 m_pParent->DataSourcePropertyChanged(evt);
286 m_xParent->GetParent()->GrabFocus();
294 m_xParent->PositionDataSource(nRecord);
350 m_xAbsolute->GetWidget()->set_size_request(nReserveWidth, -1);
384 bool lResult =
false;
385 if (&rButton == m_xFirstBtn.get())
387 else if( &rButton == m_xPrevBtn.get() )
389 else if( &rButton == m_xNextBtn.get() )
391 else if( &rButton == m_xLastBtn.get() )
393 else if( &rButton == m_xNewBtn.get() )
401 if (&rButton == m_xFirstBtn.get())
403 else if( &rButton == m_xPrevBtn.get() )
405 else if( &rButton == m_xNextBtn.get() )
407 else if( &rButton == m_xLastBtn.get() )
409 else if( &rButton == m_xNewBtn.get() )
415 if (!(
m_nCurrentPos != nCurrentPos || nCurrentPos < 0 || bAll))
424 bAll = bAll || nCurrentPos <= 0;
426 bAll = bAll || nCurrentPos >= nAdjustedRowCount;
460 bool bAvailable =
true;
544 aText = OUString::number(pParent->
GetRowCount() - 1);
557 OUString aExtendedInfo = aText +
" (" +
593 if (pCur && pCur->
Is())
595 Reference< XIndexAccess > xColumns(pCur->
getColumns(), UNO_QUERY);
596 for (sal_Int32
i = 0;
i < xColumns->getCount(); ++
i)
598 Reference< XPropertySet > xColSet(
599 xColumns->getByIndex(
i), css::uno::UNO_QUERY);
600 m_aVariants.emplace_back(
new DataColumn(xColSet) );
641 if (pCur && pCur->
Is())
654 DBG_ASSERT(xSet.is(),
"DbGridRow::SetState : invalid cursor !");
688 Reference< XComponentContext >
const & _rxContext,
694 ,m_nAsynAdjustEvent(nullptr)
695 ,m_pDataSourcePropListener(nullptr)
696 ,m_pFieldListeners(nullptr)
697 ,m_pGridListener(nullptr)
703 ,m_nDeleteEvent(nullptr)
706 ,m_nLastColId(sal_uInt16(-1))
708 ,m_bDesignMode(false)
709 ,m_bRecordCountFinal(false)
710 ,m_bSynchDisplay(true)
712 ,m_bFilterMode(false)
713 ,m_bWantDestruction(false)
714 ,m_bPendingAdjustRows(false)
715 ,m_bHideScrollbars( false )
738 pHeader->SetMouseTransparent(
false);
779 EditBrowseBox::dispose();
784 EditBrowseBox::StateChanged(
nType );
788 case StateChangedType::Mirroring:
793 case StateChangedType::Zoom:
799 sal_uInt16 nX =
static_cast<sal_uInt16
>(aPoint.
X());
804 case StateChangedType::ControlFont:
808 case StateChangedType::ControlForeground:
812 case StateChangedType::ControlBackground:
822 EditBrowseBox::DataChanged( rDCEvt );
823 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS ) &&
824 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
833 EditBrowseBox::Select();
853 m_aBar->EnableRTL( IsRTLEnabled() );
861 if ( IsControlFont() )
862 m_aBar->SetControlFont( GetControlFont() );
866 m_aBar->SetZoom( GetZoom() );
873 if (IsControlBackground())
876 GetDataWindow().SetControlBackground(GetControlBackground());
877 GetDataWindow().GetOutDev()->SetFillColor(GetControlBackground());
924 EditBrowseBox::RemoveRows();
935 nX =
m_aBar->ArrangeControls();
952 bool adjustModeForScrollbars(
BrowserMode& _rMode,
bool _bNavigationBar,
bool _bHideScrollbars )
956 if ( !_bNavigationBar )
961 if ( _bHideScrollbars )
963 _rMode |= BrowserMode::NO_HSCROLL | BrowserMode::NO_VSCROLL;
964 _rMode &=
~BrowserMode( BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL );
968 _rMode |= BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL;
969 _rMode &=
~BrowserMode( BrowserMode::NO_HSCROLL | BrowserMode::NO_VSCROLL );
974 if ( _bNavigationBar )
976 _rMode |= BrowserMode::AUTO_HSCROLL;
980 return nOldMode != _rMode;
1002 sal_uInt16 nX =
static_cast<sal_uInt16
>(aPoint.
X());
1022 "DbGridControl::SetOptions : please do not call when editing a record (things are much easier this way ;) !");
1028 Reference< XPropertySet > xDataSourceSet =
m_pDataCursor->getPropertySet();
1029 if (xDataSourceSet.is())
1032 sal_Int32 nPrivileges = 0;
1034 if ((nPrivileges & Privilege::INSERT) == 0)
1036 if ((nPrivileges & Privilege::UPDATE) == 0)
1038 if ((nPrivileges & Privilege::DELETE) == 0)
1050 if (!(
m_nMode & BrowserMode::CURSOR_WO_FOCUS))
1053 nNewMode |= BrowserMode::HIDECURSOR;
1117 m_nMode |= BrowserMode::CURSOR_WO_FOCUS;
1122 m_nMode |= BrowserMode::HIDECURSOR;
1138 return (
m_nMode & BrowserMode::CURSOR_WO_FOCUS) && !(
m_nMode & BrowserMode::HIDECURSOR);
1167 if (!_xCursor.is() || !Reference< XColumnsSupplier > (_xCursor, UNO_QUERY_THROW)->getColumns()->hasElements())
1203 xSupplier->getNumberFormatSettings()->getPropertyValue(
"NullDate") >>=
m_aNullDate;
1214 Reference< XResultSet > xClone;
1215 Reference< XResultSetAccess > xAccess( _xCursor, UNO_QUERY );
1218 xClone = xAccess.is() ? xAccess->createResultSet() : Reference< XResultSet > ();
1244 Reference< XPropertySet > xSet(_xCursor, UNO_QUERY);
1248 sal_Int32 nConcurrency = ResultSetConcurrency::READ_ONLY;
1251 if ( ResultSetConcurrency::UPDATABLE == nConcurrency )
1253 sal_Int32 nPrivileges = 0;
1278 if ( bPermanentCursor )
1280 m_nMode |= BrowserMode::CURSOR_WO_FOCUS;
1287 m_nMode |= BrowserMode::HIDECURSOR;
1290 m_nMode |= BrowserMode::MULTISELECTION;
1294 Reference< XColumnsSupplier > xSupplyColumns(_xCursor, UNO_QUERY);
1295 if (xSupplyColumns.is())
1301 sal_uInt32 nRecordCount(0);
1305 Reference< XPropertySet > xSet =
m_pDataCursor->getPropertySet();
1310 Reference< XRowsChangeBroadcaster> xChangeBroad(xSet,UNO_QUERY);
1311 if ( xChangeBroad.is( ) )
1354 if (nCurPos == 0 &&
ColCount() > 1)
1387 EditBrowseBox::RemoveColumns();
1398 sal_uInt16 nRealPos = nModelPos;
1403 sal_Int16 nViewPos = nModelPos;
1410 nModelPos = nRealPos;
1412 nRealPos = nViewPos + 1;
1421 EditBrowseBox::AppendColumn(rName, nWidth, nRealPos,
nId);
1432 EditBrowseBox::RemoveColumn(
nId);
1443 EditBrowseBox::ColumnMoved(
nId);
1449 DBG_ASSERT(!pCol->
IsHidden(),
"DbGridControl::ColumnMoved : moved a hidden col ? how this ?");
1459 size_t nNewModelPos;
1460 for (nNewModelPos = 0; nNewModelPos <
m_aColumns.size(); ++nNewModelPos)
1470 DBG_ASSERT( nNewModelPos <
m_aColumns.size(),
"DbGridControl::ColumnMoved : could not find the new model position !");
1530 auto temp = std::move(
m_aColumns[ nOldModelPos ]);
1562 EditBrowseBox::SeekRow(nRow);
1570 RecalcRows(nNewTopRow, nLinesOnScreen,
false);
1583 bool bDisablePaint = !bUpdateCursor && IsPaintEnabled();
1588 Reference< XPropertySet > xSet =
m_pSeekCursor->getPropertySet();
1591 bool bCacheAligned =
false;
1599 if (nLimit < nLinesOnScreen)
1602 aCacheSize <<= sal_Int32(nLinesOnScreen*2);
1605 bUpdateCursor =
true;
1606 bCacheAligned =
true;
1607 nLimit = nLinesOnScreen;
1615 if (nDelta < nLimit && (nDelta > 0
1618 else if (nDelta < 0 && std::abs(nDelta) < nLimit)
1620 else if (nDelta != 0 || bUpdateCursor)
1645 EditBrowseBox::RowInserted(nRow, nNumRows, bDoPaint);
1664 EditBrowseBox::RowRemoved(nRow, nNumRows, bDoPaint);
1673 Reference< XPropertySet > xSet =
m_pDataCursor->getPropertySet();
1676 sal_Int32 nRecordCount = 0;
1707 EditBrowseBox::GoToRow(nNewPos);
1734 return EditBrowseBox::FILTER;
1739 return EditBrowseBox::DELETED;
1741 return EditBrowseBox::MODIFIED;
1743 return EditBrowseBox::CURRENTNEW;
1745 return EditBrowseBox::CURRENT;
1748 return EditBrowseBox::NEW;
1750 return EditBrowseBox::DELETED;
1752 return EditBrowseBox::CLEAN;
1765 if ((
GetMode() & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::CURSOR_WO_FOCUS)
1788 return EditBrowseBox::CursorMoving( nNewRow, nNewCol );
1809 bool bNewRowInserted =
false;
1816 Reference< XPropertySet > xCursorProps =
m_pDataCursor->getPropertySet();
1817 if ( !::comphelper::getBOOL(xCursorProps->getPropertyValue(
FM_PROP_ISNEW)) )
1819 Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*
m_pDataCursor), UNO_QUERY);
1820 xUpdateCursor->moveToInsertRow();
1822 bNewRowInserted =
true;
1852 if (bNewRowInserted)
1860 OSL_FAIL(
"DbGridControl::SetCurrent : SeekRow failed !");
1886 EditBrowseBox::CursorMoved();
1927 SAL_INFO(
"svx.fmcomp",
"DbGridControl::AdjustDataSource");
1946 bool bDataCursorIsOnNew =
false;
1949 if ( bEqualBookmarks && !bDataCursorIsOnNew )
1975 EditBrowseBox::GoToRow(nNewPos);
2002 Reference< XPropertySet > xSet =
m_pDataCursor->getPropertySet();
2005 if (::comphelper::getBOOL(xSet->getPropertyValue(
FM_PROP_ISNEW)))
2014 SAL_INFO(
"svx.fmcomp",
"DbGridControl::AlignSeekCursor: nobody should tamper with my cursor this way (before first)!" );
2021 SAL_INFO(
"svx.fmcomp",
"DbGridControl::AlignSeekCursor: nobody should tamper with my cursor this way (after last)!" );
2079 bool bSuccess =
false;
2094 "DbGridControl::SeekCursor: how did the seek cursor get to this position?!" );
2096 bAbsolute = std::abs(nSteps) > 100;
2116 else if (nSteps < 0)
2134 OSL_FAIL(
"DbGridControl::SeekCursor : failed ...");
2141 if (bAbsolute || nSteps > 0)
2165 OSL_FAIL(
"DbGridControl::SeekCursor : failed ...");
2212 sal_Int32 nNewRow = std::max(
GetCurRow() - 1, sal_Int32(0));
2245 catch(SQLException &)
2284 EditBrowseBox::GoToRow(
nPos);
2312 if (nNewRow > 0 &&
GetCurRow() != nNewRow)
2339 SetMouseTransparent(bMode);
2365 if (!pCurCol->IsHidden())
2366 pCurCol->UpdateControl();
2391 if ( pColumn &&
IsValid(_rRow) )
2422 bCanUndo &= ( 0 !=
nState );
2429 if (rExecutionResult ==
"delete")
2436 else if (rExecutionResult ==
"undo")
2438 else if (rExecutionResult ==
"save")
2444 SAL_INFO(
"svx.fmcomp",
"DbGridControl::DataSourcePropertyChanged");
2451 Reference< XPropertySet > xSource(evt.Source, UNO_QUERY);
2452 DBG_ASSERT( xSource.is(),
"DbGridControl::DataSourcePropertyChanged: invalid event source!" );
2453 bool bIsNew =
false;
2455 bIsNew = ::comphelper::getBOOL(xSource->getPropertyValue(
FM_PROP_ISNEW));
2459 DBG_ASSERT(::comphelper::getBOOL(xSource->getPropertyValue(
FM_PROP_ROWCOUNTFINAL)),
"DbGridControl::DataSourcePropertyChanged : somebody moved the form to a new record before the row count was final !");
2460 sal_Int32 nRecordCount = 0;
2462 if (::comphelper::getBOOL(evt.NewValue))
2532 std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu(
"menu"));
2545 case CommandEventId::ContextMenu:
2549 EditBrowseBox::Command(rEvt);
2579 std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu(
"menu"));
2580 if (!xContextMenu->popup_at_rect(pPopupParent, aRect).isEmpty())
2585 EditBrowseBox::Command(rEvt);
2592 EditBrowseBox::Command(rEvt);
2598 m_nDeleteEvent =
nullptr;
2599 DeleteSelectedRows();
2620 CellController* pReturn =
nullptr;
2634 if ((bInsert && !pColumn->
IsAutoValue()) || bUpdate)
2644 SAL_INFO(
"svx.fmcomp",
"DbGridControl::CellModified");
2671 SAL_INFO(
"svx.fmcomp",
"current row is new, new state: MODIFIED");
2686 SAL_INFO(
"svx.fmcomp",
"current row is not new, new state: MODIFIED");
2701 EditBrowseBox::Dispatch(
nId);
2733 Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*
m_pDataCursor), UNO_QUERY);
2737 xUpdateCursor->moveToInsertRow();
2739 xUpdateCursor->cancelRowUpdates();
2755 if (bAppending && (EditBrowseBox::IsModified() || bDirty))
2779 if (xDataSource.is() && !::comphelper::getBOOL(xDataSource->getPropertyValue(
FM_PROP_ISMODIFIED)))
2808 aTmpRef->SaveValue();
2811 EditBrowseBox::RowModified(nRow);
2831 SAL_INFO(
"svx.fmcomp",
"DbGridControl::SaveModified");
2838 if (!EditBrowseBox::IsModified())
2843 bool bOK = pColumn && pColumn->
Commit();
2844 DBG_ASSERT(
Controller().is(),
"DbGridControl::SaveModified: was modified, by have no controller?!" );
2875 SAL_INFO(
"svx.fmcomp",
"DbGridControl::SaveRow");
2889 bool bSuccess =
false;
2892 Reference< XResultSetUpdate > xUpdateCursor(Reference< XInterface >(*
m_pDataCursor), UNO_QUERY);
2894 xUpdateCursor->insertRow();
2896 xUpdateCursor->updateRow();
2899 catch(SQLException&)
2950 return BrowseBox::PreNotify(rEvt);
2954 case NotifyEventType::KEYINPUT:
2962 if ( (
KEY_TAB == nCode ) && bCtrl && !bAlt )
2976 if ( !bShift && !bCtrl && (
KEY_ESCAPE == nCode ) )
2984 else if ( (
KEY_DELETE == nCode ) && !bShift && !bCtrl )
2999 return EditBrowseBox::PreNotify(rEvt);
3030 EditBrowseBox::KeyInput(rEvt);
3044 EditBrowseBox::RemoveColumn(
nId);
3050 DBG_ASSERT(pColumn,
"DbGridControl::HideColumn : somebody did hide a nonexistent column !");
3094 for (
size_t i =
nPos;
i > 0; --
i )
3099 nNextNonHidden =
i-1;
3131 OSL_FAIL(
"DbGridControl::GetColumnIdFromModelPos : invalid argument !");
3136#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
3142 sal_uInt16 nViewPos =
nPos;
3148 "DbGridControl::GetColumnIdFromModelPos : this isn't consistent... did I misunderstand something ?");
3151 return pCol->
GetId();
3165 SAL_INFO(
"svx.fmcomp",
"DbGridControl::implAdjustInSolarThread");
3172 SAL_INFO(
"svx.fmcomp",
"posting an AdjustRows");
3174 SAL_INFO(
"svx.fmcomp",
"posting an AdjustDataSource");
3179 SAL_INFO(
"svx.fmcomp",
"doing an AdjustRows");
3181 SAL_INFO(
"svx.fmcomp",
"doing an AdjustDataSource");
3197 m_nAsynAdjustEvent =
nullptr;
3211 for (
const auto& rListener : *pListeners)
3228 for (
const auto& rListener : *pListeners)
3243 DBG_ASSERT(!pListeners || pListeners->empty(),
"DbGridControl::ConnectToFields : please call DisconnectFromFields first !");
3257 Reference< XPropertySet > xField = pCurrent->GetField();
3263 DBG_ASSERT(!rpListener,
"DbGridControl::ConnectToFields : already a listener for this column ?!");
3274 while (!pListeners->empty())
3276 sal_Int32 nOldSize = pListeners->size();
3277 pListeners->begin()->second->dispose();
3278 DBG_ASSERT(nOldSize >
static_cast<sal_Int32
>(pListeners->size()),
"DbGridControl::DisconnectFromFields : dispose on a listener should result in a removal from my list !");
3298 std::unique_ptr<vcl::SolarMutexTryAndBuyGuard> pGuard;
3319 OSL_FAIL(
"DbGridControl::FieldListenerDisposing : invalid call (have no listener array) !");
3323 ColumnFieldValueListeners::const_iterator aPos = pListeners->find(_nId);
3324 if (aPos == pListeners->end())
3326 OSL_FAIL(
"DbGridControl::FieldListenerDisposing : invalid call (did not find the listener) !");
3330 delete aPos->second;
3332 pListeners->erase(aPos);
3351 return EditBrowseBox::GetAccessibleControlCount() + 1;
3356 Reference<XAccessible > xRet;
3357 if ( _nIndex == EditBrowseBox::GetAccessibleControlCount() )
3359 xRet =
m_aBar->GetAccessible();
3362 xRet = EditBrowseBox::CreateAccessibleControl( _nIndex );
3368 sal_uInt16 nColumnId =
GetColumnId( _nColumnPos );
3373 Reference< css::awt::XControl> xInt(pColumn->
GetCell());
3374 Reference< css::awt::XCheckBox> xBox(xInt,UNO_QUERY);
3378 switch( xBox->getState() )
3390 return EditBrowseBox::CreateAccessibleCheckBoxCell( _nRow, _nColumnPos,eValue );
3393 return EditBrowseBox::CreateAccessibleCell( _nRow, _nColumnPos );
Reference< XComponentContext > m_xContext
#define BROWSER_INVALIDID
#define BROWSER_CURSORENDOFFILE
static bool IsMainThread()
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
sal_uInt16 GetVisibleRows() const
sal_uInt16 GetColumnId(sal_uInt16 nPos) const
void SetUpdateMode(bool bUpdate)
tools::Rectangle GetControlArea() const
bool GoToColumnId(sal_uInt16 nColId)
void SetRealRowCount(const OUString &rRealRowCount)
BrowserDataWin & GetDataWindow() const
void InsertDataColumn(sal_uInt16 nItemId, const OUString &rText, tools::Long nSize, HeaderBarItemBits nBits=HeaderBarItemBits::STDSTYLE, sal_uInt16 nPos=HEADERBAR_APPEND)
sal_Int32 GetCurRow() const
const MultiSelection * GetSelection() const
sal_Int32 GetRowAtYPosPixel(tools::Long nY, bool bRelToBrowser=true) const
tools::Long CalcReverseZoom(tools::Long nVal) const
sal_Int32 GetTopRow() const
sal_uInt16 ColCount() const
void InsertHandleColumn(sal_uLong nWidth)
bool GoToRowColumnId(sal_Int32 nRow, sal_uInt16 nColId)
void SetMode(BrowserMode nMode)
sal_uInt16 GetColumnPos(sal_uInt16 nColumnId) const
void SetCursorColor(const Color &_rCol)
void SelectColumnId(sal_uInt16 nColId)
sal_Int32 GetSelectRowCount() const
static const sal_uInt16 HandleColumnId
sal_uInt16 GetCurColumnId() const
sal_uLong GetDefaultColumnWidth(const OUString &_rText) const
tools::Rectangle GetRowRectPixel(sal_Int32 nRow) const
bool ReserveControlArea(sal_uInt16 nWidth=USHRT_MAX)
sal_uInt16 GetColumnAtXPosPixel(tools::Long nX) const
sal_Int32 FirstSelectedRow()
virtual sal_Int32 GetRowCount() const override
virtual sal_Int32 GetSelectedColumnCount() const override
BrowserMode GetMode() const
virtual void SetNoSelection() override
sal_uLong GetColumnWidth(sal_uInt16 nColumnId) const
void SetHeaderBar(BrowserHeader *)
virtual bool IsRowSelected(sal_Int32 nRow) const override
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
css::uno::Any getBookmark()
bool isBeforeFirst() const
const css::uno::Reference< css::beans::XPropertySet > & getPropertySet() const
css::uno::Reference< css::container::XNameAccess > getColumns() const
bool moveToBookmark(const css::uno::Any &bookmark)
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void UpdateFromField(const DbGridRow *pRow, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter)
OUString GetCellText(const DbGridRow *pRow, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) const
FmXGridCell * GetCell() const
const ::svt::CellControllerRef & GetController() const
sal_Int32 m_nLastVisibleWidth
void Paint(OutputDevice &rDev, const tools::Rectangle &rRect, const DbGridRow *pRow, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter)
const css::uno::Reference< css::beans::XPropertySet > & getModel() const
void disposing(sal_uInt16 _nId)
virtual void DeleteSelectedRows()
void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess)
called when a controller needs to be re-initialized
CursorWrapper * getDataSource() const
void EnableNavigationBar(bool bEnable)
bool SetCurrent(sal_Int32 nNewRow)
friend class DisposeListenerGridBridge
const css::uno::Reference< css::util::XNumberFormatter > & getNumberFormatter() const
virtual void SetDesignMode(bool bMode)
void DataSourcePropertyChanged(const css::beans::PropertyChangeEvent &evt)
Link< DbGridControlNavigationBarState, int > m_aMasterStateProvider
css::util::Date m_aNullDate
bool IsDesignMode() const
virtual sal_Int32 GetAccessibleControlCount() const override
bool getDisplaySynchron() const
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const override
GetCellText returns the text at the given position.
void RowInserted(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true)
sal_uInt16 GetColumnIdFromModelPos(sal_uInt16 nPos) const
virtual void ShowColumn(sal_uInt16 nId)
show a column
sal_Int32 AlignSeekCursor()
void AdjustDataSource(bool bFull=false)
void RowRemoved(sal_Int32 nRow, sal_Int32 nNumRows=1, bool bDoPaint=true)
FmXGridSourcePropListener * m_pDataSourcePropListener
bool IsFilterMode() const
void DisconnectFromFields()
virtual ::svt::CellController * GetController(sal_Int32 nRow, sal_uInt16 nCol) override
virtual void ArrangeControls(sal_uInt16 &nX, sal_uInt16 nY) override
virtual bool PreNotify(NotifyEvent &rEvt) override
virtual RowStatus GetRowStatus(sal_Int32 nRow) const override
virtual void onColumnChange()
called when the current column changed
sal_uInt16 GetViewColumnPos(sal_uInt16 nId) const
bool m_bPendingAdjustRows
virtual void onRowChange()
called when the current row changed
virtual bool SaveRow() override
virtual void CursorMoved() override
virtual bool IsModified() const override
ImplSVEvent * m_nDeleteEvent
virtual void VisibleRowsChanged(sal_Int32 nNewTopRow, sal_uInt16 nNumRows) override
bool IsInsertionRow(sal_Int32 nRow) const
void setDataSource(const css::uno::Reference< css::sdbc::XRowSet > &rCursor, DbGridControlOptions nOpts=DbGridControlOptions::Insert|DbGridControlOptions::Update|DbGridControlOptions::Delete)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell(sal_Int32 nRow, sal_uInt16 nColumnId) override
Creates the accessible object of a data table cell.
sal_uInt16 GetColumnIdFromViewPos(sal_uInt16 nPos) const
virtual void ColumnMoved(sal_uInt16 nId) override
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
DbGridControlOptions GetOptions() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void EnableHandle(bool bEnable)
virtual void Init() override
std::vector< std::unique_ptr< DbGridColumn > > m_aColumns
friend class FmXGridSourcePropListener
virtual void HideColumn(sal_uInt16 nId)
hide a column
virtual sal_uInt32 GetTotalCellWidth(sal_Int32 nRow, sal_uInt16 nColId) override
void implAdjustInSolarThread(bool _bRows)
virtual bool IsTabAllowed(bool bForward) const override
friend class GridFieldValueListener
void setDisplaySynchron(bool bSync)
ImplSVEvent * m_nAsynAdjustEvent
osl::Mutex m_aDestructionSafety
void ForceHideScrollbars()
forces both scrollbars to be hidden
virtual void Dispatch(sal_uInt16 nId) override
bool IsPermanentCursorEnabled() const
css::uno::Reference< css::uno::XComponentContext > m_xContext
std::unique_ptr< CursorWrapper > m_pSeekCursor
virtual ~DbGridControl() override
sal_uInt16 GetModelColumnPos(sal_uInt16 nId) const
css::uno::Reference< css::sdb::XRowsChangeListener > m_xRowSetListener
bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
returns <TRUE> if the text of the given cell can be copied into the clipboard
std::unique_ptr< DisposeListenerGridBridge > m_pCursorDisposeListener
void SetFilterMode(bool bMode)
void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
copies the text of the given cell into the clipboard
virtual void CellModified() override
virtual void dispose() override
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const override
virtual void PostExecuteRowContextMenu(const OUString &rExecutionResult)
After executing the context menu for a row this method is called.
void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor)
virtual bool CursorMoving(sal_Int32 nNewRow, sal_uInt16 nNewCol) override
virtual void StateChanged(StateChangedType nType) override
bool SeekCursor(sal_Int32 nRow, bool bAbsolute=false)
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pDataSourcePropMultiplexer
bool IsCurrentAppending() const
virtual sal_uInt16 AppendColumn(const OUString &rName, sal_uInt16 nWidth, sal_uInt16 nPos=HEADERBAR_APPEND, sal_uInt16 nId=sal_uInt16(-1)) override
DbGridControlOptions m_nOptionMask
osl::Mutex m_aAdjustSafety
void RemoveColumn(sal_uInt16 nId)
void EnablePermanentCursor(bool bEnable)
DbGridControlOptions m_nOptions
Link< DbGridControlNavigationBarState, bool > m_aMasterSlotExecutor
OUString GetCurrentRowCellText(DbGridColumn const *pCol, const DbGridRowRef &_rRow) const
virtual bool SaveModified() override
virtual void KeyInput(const KeyEvent &rEvt) override
void RowModified(sal_Int32 nRow)
void executeRowContextMenu(const Point &_rPreferredPos)
virtual bool SeekRow(sal_Int32 nRow) override
std::unique_ptr< CursorWrapper > m_pDataCursor
virtual void Command(const CommandEvent &rEvt) override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl(sal_Int32 _nIndex) override
Creates the accessible object of an additional control.
sal_uInt16 GetViewColCount() const
void FieldValueChanged(sal_uInt16 _nId)
virtual void RemoveRows() override
DbGridRowRef m_xCurrentRow
FmGridListener * m_pGridListener
DbGridControl(css::uno::Reference< css::uno::XComponentContext > const &_rxContext, vcl::Window *pParent, WinBits nBits)
virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess > &xFields)=0
virtual void EndCursorAction()
VclPtr< NavigationBar > m_aBar
std::unique_ptr< DbGridColumn > CreateColumn(sal_uInt16 nId)
void ImplInitWindow(const InitWindowFacet _eInitWhat)
virtual void Select() override
virtual void PreExecuteRowContextMenu(weld::Menu &rMenu)
This is called before executing a context menu for a row.
void MoveToPosition(sal_uInt32 nPos)
bool IsFilterRow(sal_Int32 nRow) const
virtual void BeginCursorAction()
DbGridControlOptions SetOptions(DbGridControlOptions nOpt)
static bool IsValid(const DbGridRowRef &_xRow)
void FieldListenerDisposing(sal_uInt16 _nId)
void InsertHandleColumn()
::std::vector< std::unique_ptr<::svxform::DataColumn > > m_aVariants
void SetState(CursorWrapper *pCur, bool bPaintCursor)
virtual ~DbGridRow() override
css::uno::Any m_aBookmark
rtl::Reference< FmXDisposeMultiplexer > m_xRealListener
virtual ~DisposeListenerGridBridge() override
virtual void disposing(sal_Int16 _nId) override
DisposeListenerGridBridge(DbGridControl &_rParent, const Reference< XComponent > &_rxObject)
DbGridControl & m_rParent
virtual void columnChanged()=0
virtual void selectionChanged()=0
friend class FmXDisposeMultiplexer
virtual void _propertyChanged(const PropertyChangeEvent &evt) override
FmXGridSourcePropListener(DbGridControl *_pParent)
VclPtr< DbGridControl > m_pParent
GridFieldValueListener(DbGridControl &_rParent, const Reference< XPropertySet > &xField, sal_uInt16 _nId)
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pRealListener
virtual ~GridFieldValueListener() override
virtual void _propertyChanged(const PropertyChangeEvent &evt) override
DbGridControl & m_rParent
virtual void dispose() override
std::unique_ptr< weld::Builder > m_xBuilder
std::unique_ptr< weld::Container > m_xContainer
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
virtual bool DoKeyInput(const KeyEvent &rEvt) override
virtual void PositionFired(sal_Int64 nRecord) override
AbsolutePos(std::unique_ptr< weld::Entry > xEntry, NavigationBar *pBar)
std::unique_ptr< weld::Button > m_xPrevBtn
std::unique_ptr< weld::Label > m_xRecordOf
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
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
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
NotifyEventType GetType() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
virtual bool DoKeyInput(const KeyEvent &rEvt)
RowSetEventListener(DbGridControl *i_pControl)
VclPtr< DbGridControl > m_pControl
virtual void SAL_CALL disposing(const css::lang::EventObject &) override
virtual void SAL_CALL rowsChanged(const css::sdb::RowsChangeEvent &i_aEvt) override
constexpr tools::Long Height() const
constexpr tools::Long Width() const
virtual void DeactivateCell(bool bUpdate=true)
const CellControllerRef & Controller() const
virtual VclPtr< BrowserHeader > CreateHeaderBar(BrowseBox *pParent) override
void InvalidateStatusCell(sal_Int32 nRow)
VclPtr< BrowserHeader > pHeader
virtual void InitController(CellControllerRef &rController, sal_Int32 nRow, sal_uInt16 nCol)
void SetTransparent(bool bTransparent)
sal_uInt16 GetCode() const
KeyFuncType GetFunction() const
vcl::Window * GetParent() const
virtual void KeyInput(const KeyEvent &rKEvt)
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
OUString SvxResId(TranslateId aId)
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
virtual sal_uInt32 GetId() const override
constexpr OUStringLiteral IsHidden(u"IsHidden")
constexpr OUStringLiteral FM_PROP_ROWCOUNT
constexpr OUStringLiteral FM_PROP_ISNEW
constexpr OUStringLiteral FM_PROP_ENABLED
constexpr OUStringLiteral FM_PROP_LABEL
constexpr OUStringLiteral FM_PROP_FETCHSIZE
constexpr OUStringLiteral FM_PROP_RESULTSET_CONCURRENCY
constexpr OUStringLiteral FM_PROP_PRIVILEGES
constexpr OUStringLiteral FM_PROP_ROWCOUNTFINAL
constexpr OUStringLiteral FM_PROP_VALUE
constexpr OUStringLiteral FM_PROP_ISMODIFIED
IMPL_LINK(NavigationBar, OnClick, weld::Button &, rButton, void)
constexpr auto DEFAULT_BROWSE_MODE
const DbGridControlNavigationBarState ControlMap[]
bool CompareBookmark(const Any &aLeft, const Any &aRight)
IMPL_LINK_NOARG(DbGridControl, OnDelete, void *, void)
const int nReserveNumDigits
std::map< sal_uInt16, GridFieldValueListener * > ColumnFieldValueListeners
#define GRID_COLUMN_NOT_FOUND
DbGridControlNavigationBarState
constexpr OUStringLiteral HID_GRID_TRAVEL_LAST
constexpr OUStringLiteral HID_GRID_TRAVEL_PREV
constexpr OUStringLiteral HID_GRID_TRAVEL_FIRST
constexpr OUStringLiteral HID_GRID_TRAVEL_ABSOLUTE
constexpr OUStringLiteral HID_GRID_TRAVEL_NEW
constexpr OUStringLiteral HID_GRID_NUMBEROFRECORDS
constexpr OUStringLiteral HID_GRID_TRAVEL_NEXT
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_DELETE
#define LINK(Instance, Class, Member)
#define SAL_INFO(area, stream)
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
std::shared_ptr< T > make_shared(Args &&... args)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Color GetFillColor(Color const &rColor, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
constexpr auto nCacheSize