35#include <com/sun/star/awt/PosSize.hpp>
36#include <com/sun/star/beans/PropertyAttribute.hpp>
37#include <com/sun/star/form/FormComponentType.hpp>
38#include <com/sun/star/form/XFormComponent.hpp>
39#include <com/sun/star/form/XLoadable.hpp>
40#include <com/sun/star/form/XReset.hpp>
41#include <com/sun/star/lang/DisposedException.hpp>
42#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
43#include <com/sun/star/lang/NoSupportException.hpp>
44#include <com/sun/star/sdbc/ResultSetType.hpp>
45#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
46#include <com/sun/star/util/URLTransformer.hpp>
47#include <com/sun/star/util/XURLTransformer.hpp>
48#include <com/sun/star/view/XSelectionSupplier.hpp>
49#include <com/sun/star/sdbcx/XRowLocate.hpp>
77using ::com::sun::star::sdbcx::XColumnsSupplier;
78using ::com::sun::star::frame::XDispatchProviderInterceptor;
79using ::com::sun::star::frame::XDispatchProvider;
80using ::com::sun::star::accessibility::XAccessible;
81using ::com::sun::star::accessibility::XAccessibleContext;
82using ::com::sun::star::sdb::XRowSetSupplier;
83using ::com::sun::star::awt::XVclWindowPeer;
88 css::awt::FontDescriptor aFD;
95 aFD.Pitch =
static_cast<sal_Int16
>(rFont.
GetPitch());
99 aFD.Underline =
static_cast<sal_Int16
>(rFont.
GetUnderline());
100 aFD.Strikeout =
static_cast<sal_Int16
>(rFont.
GetStrikeout());
116 aFont.
SetCharSet(
static_cast<rtl_TextEncoding
>(rDescr.CharSet) );
131 ,OInterfaceContainerHelper3( _rMutex )
138 Any aReturn = ::cppu::queryInterface(_rType,
139 static_cast< css::util::XModifyListener*
>(
this),
140 static_cast< XEventListener*
>(
this)
143 if (!aReturn.hasValue())
157 EventObject aMulti( e);
159 notifyEach( &XModifyListener::modified, aMulti );
164 ,OInterfaceContainerHelper3( _rMutex )
171 Any aReturn = ::cppu::queryInterface(_rType,
172 static_cast< XUpdateListener*
>(
this),
173 static_cast< XEventListener*
>(
this)
176 if (!aReturn.hasValue())
190 EventObject aMulti( e );
198 bResult = aIter.
next()->approveUpdate( aMulti );
207 EventObject aMulti( e );
209 notifyEach( &XUpdateListener::updated, aMulti );
214 ,OInterfaceContainerHelper3( _rMutex )
221 Any aReturn = ::cppu::queryInterface(_rType,
222 static_cast< XSelectionChangeListener*
>(
this),
223 static_cast< XEventListener*
>(
this)
226 if (!aReturn.hasValue())
240 EventObject aMulti(_rEvent);
242 notifyEach( &XSelectionChangeListener::selectionChanged, aMulti );
247 ,OInterfaceContainerHelper3( _rMutex )
254 Any aReturn = ::cppu::queryInterface(_rType,
255 static_cast< XContainerListener*
>(
this),
256 static_cast< XEventListener*
>(
this)
259 if (!aReturn.hasValue())
272 ContainerEvent aMulti( e );
274 notifyEach( &XContainerListener::elementInserted, aMulti );
280 ContainerEvent aMulti( e );
282 notifyEach( &XContainerListener::elementRemoved, aMulti );
288 ContainerEvent aMulti( e );
290 notifyEach( &XContainerListener::elementReplaced, aMulti );
295 ,OInterfaceContainerHelper3( _rMutex )
302 Any aReturn = ::cppu::queryInterface( _rType,
303 static_cast< XGridControlListener*
>(
this)
306 if (!aReturn.hasValue())
320 EventObject aForwardedEvent( _event );
322 notifyEach( &XGridControlListener::columnChanged, aForwardedEvent );
335 :m_aModifyListeners(*this, GetMutex())
336 ,m_aUpdateListeners(*this, GetMutex())
337 ,m_aContainerListeners(*this, GetMutex())
338 ,m_aSelectionListeners(*this, GetMutex())
339 ,m_aGridControlListeners(*this, GetMutex())
355 if (!aReturn.hasValue())
356 aReturn = UnoControl::queryAggregation( _rType );
369 return css::uno::Sequence<sal_Int8>();
380 return "com.sun.star.form.FmXGridControl";
394 aEvt.Source = getXWeak();
416 Reference< XGridPeer > xGridPeer(
getPeer(), UNO_QUERY);
419 Reference< XIndexContainer > xCols(
mxModel, UNO_QUERY);
420 xGridPeer->setColumns(xCols);
432 Reference< XPropertySet > xModelSet(
getModel(), UNO_QUERY);
437 if (::comphelper::getINT16(xModelSet->getPropertyValue(
FM_PROP_BORDER)))
442 OSL_FAIL(
"Can not get style");
446 pReturn->Create(pParent, nStyle);
454 throw DisposedException( OUString(), *
this );
473 if (rParentPeer.is())
481 DBG_ASSERT(pPeer !=
nullptr,
"FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !");
497 DBG_ASSERT(
getPeer().is(),
"FmXGridControl::createPeer : something went wrong ... no top level peer !");
502 Reference< XIndexContainer > xColumns(
getModel(), UNO_QUERY);
504 pPeer->setColumns(xColumns);
507 pPeer->setVisible(
true);
510 pPeer->setEnable(
false);
544 Any aOldCursorBookmark;
547 Reference< XFormComponent > xComp(
getModel(), UNO_QUERY);
550 Reference< XRowSet > xForm(xComp->getParent(), UNO_QUERY);
553 Reference< css::sdbcx::XColumnsSupplier > xColumnsSupplier(xForm, UNO_QUERY);
554 if (xColumnsSupplier.is())
556 if (Reference< XIndexAccess > (xColumnsSupplier->getColumns(),UNO_QUERY_THROW)->getCount())
564 if ( !xForm->isBeforeFirst() && !xForm->isAfterLast() )
568 aOldCursorBookmark = Reference< css::sdbcx::XRowLocate > (xForm, UNO_QUERY_THROW)->getBookmark();
578 pPeer->setRowSet(xForm);
585 if (aOldCursorBookmark.hasValue())
587 Reference< XFormComponent > xComp(
getModel(), UNO_QUERY);
588 Reference< css::sdbcx::XRowLocate > xLocate(xComp->getParent(), UNO_QUERY);
589 xLocate->moveToBookmark(aOldCursorBookmark);
597 Reference< css::awt::XView > xPeerView(
getPeer(), UNO_QUERY);
610 Reference< css::util::XModifyBroadcaster > xGrid(
getPeer(), UNO_QUERY);
619 Reference< XSelectionSupplier > xPeer(
getPeer(), UNO_QUERY);
620 return xPeer->select(_rSelection);
627 Reference< XSelectionSupplier > xPeer(
getPeer(), UNO_QUERY);
628 return xPeer->getSelection();
637 Reference< XSelectionSupplier > xGrid(
getPeer(), UNO_QUERY);
647 Reference< XSelectionSupplier > xGrid(
getPeer(), UNO_QUERY);
658 Reference< XGridFieldDataSupplier > xPeerSupplier(
getPeer(), UNO_QUERY);
659 if (xPeerSupplier.is())
660 return xPeerSupplier->queryFieldDataType(xType);
663 return Sequence<sal_Bool>();
671 Reference< XGridFieldDataSupplier > xPeerSupplier(
getPeer(), UNO_QUERY);
672 if (xPeerSupplier.is())
673 return xPeerSupplier->queryFieldData(nRow, xType);
676 return Sequence< Any>();
684 Reference< css::util::XModifyBroadcaster > xGrid(
getPeer(), UNO_QUERY);
702 css::util::ModeChangeEvent aModeChangeEvent;
708 Reference< XRowSetSupplier > xGrid(
getPeer(), UNO_QUERY);
710 if (xGrid.is() && (
bool(bOn) !=
mbDesignMode || (!bOn && !xGrid->getRowSet().is())))
714 xGrid->setRowSet(Reference< XRowSet > ());
718 Reference< XFormComponent > xComp(
getModel(), UNO_QUERY);
721 Reference< XRowSet > xForm(xComp->getParent(), UNO_QUERY);
722 xGrid->setRowSet(xForm);
729 Reference< XVclWindowPeer > xVclWindowPeer(
getPeer(), UNO_QUERY );
730 if (xVclWindowPeer.is())
731 xVclWindowPeer->setDesignMode(bOn);
746 aModeChangeEvent.Source = *
this;
747 aModeChangeEvent.NewMode =
mbDesignMode ? std::u16string_view(
u"design" ) : std::u16string_view(
u"alive" );
761 Reference< XBoundComponent > xBound(
getPeer(), UNO_QUERY);
771 Reference< XBoundComponent > xBound(
getPeer(), UNO_QUERY);
780 Reference< XBoundComponent > xBound(
getPeer(), UNO_QUERY);
782 return xBound->commit();
794 Reference< XContainer > xContainer(
getPeer(), UNO_QUERY);
804 Reference< XContainer > xContainer(
getPeer(), UNO_QUERY);
811Reference< css::frame::XDispatch > SAL_CALL
FmXGridControl::queryDispatch(
const css::util::URL& aURL,
const OUString& aTargetFrameName, sal_Int32 nSearchFlags)
813 Reference< css::frame::XDispatchProvider > xPeerProvider(
getPeer(), UNO_QUERY);
814 if (xPeerProvider.is())
815 return xPeerProvider->queryDispatch(
aURL, aTargetFrameName, nSearchFlags);
817 return Reference< css::frame::XDispatch > ();
823 Reference< css::frame::XDispatchProvider > xPeerProvider(
getPeer(), UNO_QUERY);
824 if (xPeerProvider.is())
825 return xPeerProvider->queryDispatches(aDescripts);
827 return Sequence< Reference< css::frame::XDispatch > >();
833 Reference< css::frame::XDispatchProviderInterception > xPeerInterception(
getPeer(), UNO_QUERY);
834 if (xPeerInterception.is())
835 xPeerInterception->registerDispatchProviderInterceptor(_xInterceptor);
841 Reference< css::frame::XDispatchProviderInterception > xPeerInterception(
getPeer(), UNO_QUERY);
842 if (xPeerInterception.is())
843 xPeerInterception->releaseDispatchProviderInterceptor(_xInterceptor);
849 ::osl::MutexGuard aGuard(
GetMutex() );
854 Reference< XGridControl > xPeerGrid(
getPeer(), UNO_QUERY );
855 if ( xPeerGrid.is() )
863 ::osl::MutexGuard aGuard(
GetMutex() );
867 Reference< XGridControl > xPeerGrid(
getPeer(), UNO_QUERY );
868 if ( xPeerGrid.is() )
878 Reference< XGridControl > xGrid(
getPeer(), UNO_QUERY );
879 return xGrid.is() ? xGrid->getCurrentColumnPosition() : -1;
885 Reference< XGridControl > xGrid(
getPeer(), UNO_QUERY );
889 xGrid->setCurrentColumnPosition(
nPos );
897 Reference< XElementAccess > xPeer(
getPeer(), UNO_QUERY);
898 return xPeer.is() && xPeer->hasElements();
911 Reference< XEnumerationAccess > xPeer(
getPeer(), UNO_QUERY);
913 return xPeer->createEnumeration();
915 return new ::comphelper::OEnumerationByIndex(
this);
922 Reference< XIndexAccess > xPeer(
getPeer(), UNO_QUERY);
923 return xPeer.is() ? xPeer->getCount() : 0;
929 Reference< XIndexAccess > xPeer(
getPeer(), UNO_QUERY);
931 throw IndexOutOfBoundsException();
933 return xPeer->getByIndex(_nIndex);
940 Reference< css::util::XModeSelector > xPeer(
getPeer(), UNO_QUERY);
942 throw NoSupportException();
944 xPeer->setMode(
Mode);
950 Reference< css::util::XModeSelector > xPeer(
getPeer(), UNO_QUERY);
951 return xPeer.is() ? xPeer->getMode() : OUString();
957 Reference< css::util::XModeSelector > xPeer(
getPeer(), UNO_QUERY);
958 return xPeer.is() ? xPeer->getSupportedModes() : css::uno::Sequence<OUString>();
964 Reference< css::util::XModeSelector > xPeer(
getPeer(), UNO_QUERY);
965 return xPeer.is() && xPeer->supportsMode(
Mode);
974 bool bAlreadyHasFocus = xGrid->HasChildPathFocus() || xGrid->ControlHasFocus();
977 if (bAlreadyHasFocus)
1012 m_pPeer->selectionChanged();
1018 m_pPeer->columnChanged();
1024 EventObject aSource;
1025 aSource.Source = getXWeak();
1033 EventObject
aEvent( *
this );
1058 DBG_ASSERT(pWin !=
nullptr,
"FmXGridPeer::Create : imp_CreateControl didn't return a control !");
1060 pWin->SetStateProvider(
LINK(
this,
FmXGridPeer, OnQueryGridSlotState));
1068 pWin->SetComponentInterface(
this);
1083 bool bKnownSender =
false;
1085 Reference< XIndexContainer > xCols( e.Source, UNO_QUERY );
1089 bKnownSender =
true;
1092 Reference< XRowSet > xCursor(e.Source, UNO_QUERY);
1097 bKnownSender =
true;
1104 const URL* pSupportedURLs = aSupportedURLs.getConstArray();
1105 for ( sal_Int32
i=0;
i < ( aSupportedURLs.getLength() ) && !bKnownSender; ++
i, ++pSupportedURLs )
1109 m_pDispatchers[
i]->removeStatusListener(
static_cast< css::frame::XStatusListener*
>(
this ), *pSupportedURLs );
1112 bKnownSender =
true;
1117 if ( !bKnownSender )
1136#define LAST_KNOWN_TYPE FormComponentType::PATTERNFIELD
1142 {
false,
false,
false,
false },
1143 {
false,
false,
false,
false },
1144 {
false,
false,
false,
false },
1145 {
false,
false,
false,
false },
1146 {
false,
false,
false,
true },
1147 {
false,
false,
false,
false },
1148 {
false,
false,
false,
false },
1149 {
false,
false,
false,
false },
1150 { true ,
false,
false,
false },
1151 {
false,
false,
false,
false },
1152 {
false,
false,
false,
false },
1153 {
false,
false,
false,
false },
1154 {
false,
false,
false,
false },
1155 {
false,
false,
false,
false },
1156 { true , true , true ,
false },
1157 { true , true ,
false,
false },
1158 { true , true ,
false,
false },
1159 { true , true ,
false,
false },
1160 { true ,
false,
false,
false }
1164 sal_Int16 nMapColumn = -1;
1165 switch (xType.getTypeClass())
1167 case TypeClass_STRING : nMapColumn = 0;
break;
1168 case TypeClass_FLOAT:
1169 case TypeClass_DOUBLE : nMapColumn = 1;
break;
1170 case TypeClass_SHORT:
1171 case TypeClass_LONG:
1172 case TypeClass_UNSIGNED_LONG:
1173 case TypeClass_UNSIGNED_SHORT : nMapColumn = 2;
break;
1174 case TypeClass_BOOLEAN : nMapColumn = 3;
break;
1179 Reference< XIndexContainer > xColumns =
getColumns();
1182 sal_Int32 nColumns = pGrid->GetViewColCount();
1184 std::vector< std::unique_ptr<DbGridColumn> >
const & aColumns = pGrid->GetColumns();
1186 Sequence<sal_Bool> aReturnSequence(nColumns);
1187 sal_Bool* pReturnArray = aReturnSequence.getArray();
1189 bool bRequestedAsAny = (xType.getTypeClass() == TypeClass_ANY);
1192 Reference< css::sdb::XColumn > xFieldContent;
1193 Reference< XPropertySet > xCurrentColumn;
1194 for (sal_Int32
i=0;
i<nColumns; ++
i)
1196 if (bRequestedAsAny)
1198 pReturnArray[
i] =
true;
1202 pReturnArray[
i] =
false;
1204 sal_uInt16 nModelPos = pGrid->GetModelColumnPos(pGrid->GetColumnIdFromViewPos(
static_cast<sal_uInt16
>(
i)));
1205 DBG_ASSERT(nModelPos != sal_uInt16(-1),
"FmXGridPeer::queryFieldDataType : no model pos !");
1207 pCol = aColumns[ nModelPos ].get();
1210 if (!xFieldContent.is())
1215 xColumns->getByIndex(nModelPos) >>= xCurrentColumn;
1219 sal_Int16 nClassId = sal_Int16();
1223 DBG_ASSERT(nClassId>0,
"FmXGridPeer::queryFieldDataType : somebody changed the definition of the FormComponentType enum !");
1225 if (nMapColumn != -1)
1226 pReturnArray[
i] = bCanConvert[nClassId-1][nMapColumn];
1229 return aReturnSequence;
1236 DBG_ASSERT(pGrid && pGrid->IsOpen(),
"FmXGridPeer::queryFieldData : have no valid grid window !");
1237 if (!pGrid || !pGrid->IsOpen())
1238 return Sequence< Any>();
1241 if (!pGrid->SeekRow(nRow))
1243 throw IllegalArgumentException();
1252 std::vector< std::unique_ptr<DbGridColumn> >
const & aColumns = pGrid->GetColumns();
1255 sal_Int32 nColumnCount = pGrid->GetViewColCount();
1257 Sequence< Any> aReturnSequence(nColumnCount);
1258 Any* pReturnArray = aReturnSequence.getArray();
1260 bool bRequestedAsAny = (xType.getTypeClass() == TypeClass_ANY);
1261 Reference< css::sdb::XColumn > xFieldContent;
1262 for (sal_Int32
i=0;
i < nColumnCount; ++
i)
1264 sal_uInt16 nModelPos = pGrid->GetModelColumnPos(pGrid->GetColumnIdFromViewPos(
static_cast<sal_uInt16
>(
i)));
1265 DBG_ASSERT(nModelPos != sal_uInt16(-1),
"FmXGridPeer::queryFieldData : invalid model pos !");
1270 xFieldContent = xPaintRow->HasField( pCol->
GetFieldPos() )
1271 ? xPaintRow->GetField( pCol->
GetFieldPos() ).getColumn()
1272 : Reference< XColumn > ();
1274 if ( !xFieldContent.is() )
1277 if (bRequestedAsAny)
1279 Reference< XPropertySet > xFieldSet(xFieldContent, UNO_QUERY);
1284 switch (xType.getTypeClass())
1287 case TypeClass_STRING :
1289 OUString sText = aColumns[ nModelPos ]->GetCellText( xPaintRow.
get(), pGrid->getNumberFormatter() );
1290 pReturnArray[
i] <<= sText;
1294 case TypeClass_FLOAT : pReturnArray[
i] <<= xFieldContent->getFloat();
break;
1295 case TypeClass_DOUBLE : pReturnArray[
i] <<= xFieldContent->getDouble();
break;
1296 case TypeClass_SHORT : pReturnArray[
i] <<= xFieldContent->getShort();
break;
1297 case TypeClass_LONG : pReturnArray[
i] <<=
static_cast<sal_Int32
>(xFieldContent->getLong());
break;
1298 case TypeClass_UNSIGNED_SHORT : pReturnArray[
i] <<=
static_cast<sal_uInt16
>(xFieldContent->getShort());
break;
1299 case TypeClass_UNSIGNED_LONG : pReturnArray[
i] <<=
static_cast<sal_uInt32
>(xFieldContent->getLong());
break;
1300 case TypeClass_BOOLEAN : pReturnArray[
i] <<= xFieldContent->getBoolean();
break;
1303 throw IllegalArgumentException();
1308 return aReturnSequence;
1316 aEvt.Source = getXWeak();
1335 pGrid->propertyChange(evt);
1339 css::uno::Reference<css::uno::XInterface> xCurrent;
1344 xCurrent.set(
m_xColumns->getByIndex(
i), css::uno::UNO_QUERY);
1345 if (evt.Source == xCurrent)
1353 sal_uInt16
nId = pGrid->GetColumnIdFromModelPos(
static_cast<sal_uInt16
>(
i));
1354 bool bInvalidateColumn =
false;
1358 OUString
aName = ::comphelper::getString(evt.NewValue);
1359 if (
aName != pGrid->GetColumnTitle(
nId))
1364 sal_Int32 nWidth = 0;
1365 if (evt.NewValue.getValueType().getTypeClass() == TypeClass_VOID)
1366 nWidth = pGrid->GetDefaultColumnWidth(pGrid->GetColumnTitle(
nId));
1370 sal_Int32 nTest = 0;
1371 if (evt.NewValue >>= nTest)
1373 nWidth = pGrid->LogicToPixel(
Point(nTest, 0),
MapMode(MapUnit::Map10thMM)).X();
1375 nWidth = pGrid->CalcZoom(nWidth);
1378 if (nWidth != (sal_Int32(pGrid->GetColumnWidth(
nId))))
1380 if (pGrid->IsEditing())
1382 pGrid->DeactivateCell();
1383 pGrid->ActivateCell();
1385 pGrid->SetColumnWidth(
nId, nWidth);
1390 DBG_ASSERT(evt.NewValue.getValueType().getTypeClass() == TypeClass_BOOLEAN,
1391 "FmXGridPeer::propertyChange : the property 'hidden' should be of type boolean !");
1392 if (::comphelper::getBOOL(evt.NewValue))
1393 pGrid->HideColumn(
nId);
1395 pGrid->ShowColumn(
nId);
1405 bInvalidateColumn =
true;
1411 bInvalidateColumn =
true;
1415 if (bInvalidateColumn)
1417 bool bWasEditing = pGrid->IsEditing();
1419 pGrid->DeactivateCell();
1423 aColRect.
SetBottom( pGrid->GetSizePixel().Height() );
1424 pGrid->Invalidate(aColRect);
1427 pGrid->ActivateCell();
1455 EventObject aEvt(getXWeak());
1457 bool bCancel =
false;
1459 if ( !aIter.
next()->approveUpdate( aEvt ) )
1463 bCancel = !pGrid->commit();
1476 if (pGrid && pGrid->IsOpen() && !::comphelper::getBOOL(Reference< XPropertySet > (_rEvent.Source, UNO_QUERY_THROW)->getPropertyValue(
FM_PROP_ISNEW)))
1477 pGrid->positioned();
1484 if (pGrid && pGrid->IsOpen())
1486 if (
m_xCursor->rowUpdated() && !pGrid->IsCurrentAppending())
1487 pGrid->RowModified(pGrid->GetCurrentPos());
1510 updateGrid( Reference< XRowSet > (
nullptr) );
1517 updateGrid( Reference< XRowSet > (
nullptr) );
1524 updateGrid( Reference< XRowSet > (
nullptr) );
1531 const sal_Int32 cnt =
m_xColumns->getCount();
1532 for(sal_Int32
i=0;
i<cnt; ++
i)
1534 Reference< XLoadListener> xll(
m_xColumns->getByIndex(
i), UNO_QUERY);
1554 static const rtl::OUStringConstExpr aPropsListenedTo[] =
1562 Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
1565 if ( xInfo->hasPropertyByName( aPropsListenedTo[
i] ) )
1567 Property aPropDesc = xInfo->getPropertyByName( aPropsListenedTo[
i] );
1568 if ( 0 != ( aPropDesc.Attributes & PropertyAttribute::BOUND ) )
1569 xCol->addPropertyChangeListener( aPropsListenedTo[
i],
this );
1579 static const rtl::OUStringConstExpr aPropsListenedTo[] =
1585 Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
1586 for (
const auto &
i : aPropsListenedTo)
1587 if (xInfo->hasPropertyByName(
i))
1588 xCol->removePropertyChangeListener(
i,
this);
1600 Reference< XPropertySet > xCol;
1603 xCol.set(
m_xColumns->getByIndex(
i), css::uno::UNO_QUERY);
1606 Reference< XContainer > xContainer(
m_xColumns, UNO_QUERY);
1607 xContainer->removeContainerListener(
this);
1609 Reference< XSelectionSupplier > xSelSupplier(
m_xColumns, UNO_QUERY);
1610 xSelSupplier->removeSelectionChangeListener(
this);
1612 Reference< XReset > xColumnReset(
m_xColumns, UNO_QUERY);
1613 if (xColumnReset.is())
1614 xColumnReset->removeResetListener(
static_cast<XResetListener*
>(
this));
1618 Reference< XContainer > xContainer(
Columns, UNO_QUERY);
1619 xContainer->addContainerListener(
this);
1621 Reference< XSelectionSupplier > xSelSupplier(
Columns, UNO_QUERY);
1622 xSelSupplier->addSelectionChangeListener(
this);
1624 Reference< XPropertySet > xCol;
1625 for (sal_Int32
i = 0;
i <
Columns->getCount();
i++)
1627 xCol.set(
Columns->getByIndex(
i), css::uno::UNO_QUERY);
1631 Reference< XReset > xColumnReset(
Columns, UNO_QUERY);
1632 if (xColumnReset.is())
1633 xColumnReset->addResetListener(
static_cast<XResetListener*
>(
this));
1681 if (!pGrid || !
m_xColumns.is() || pGrid->IsInColumnMove() ||
m_xColumns->getCount() ==
static_cast<sal_Int32
>(pGrid->GetModelColCount()))
1684 Reference< XPropertySet > xNewColumn(evt.Element, css::uno::UNO_QUERY);
1687 OUString
aName = ::comphelper::getString(xNewColumn->getPropertyValue(
FM_PROP_LABEL));
1689 sal_Int32 nWidth = 0;
1690 if (aWidth >>= nWidth)
1691 nWidth = pGrid->LogicToPixel(
Point(nWidth, 0),
MapMode(MapUnit::Map10thMM)).X();
1693 pGrid->AppendColumn(
aName,
static_cast<sal_uInt16
>(nWidth),
static_cast<sal_Int16
>(::comphelper::getINT32(evt.Accessor)));
1696 DbGridColumn* pCol = pGrid->GetColumns()[ ::comphelper::getINT32(evt.Accessor) ].
get();
1700 if (::comphelper::getBOOL(aHidden))
1701 pGrid->HideColumn(pCol->
GetId());
1703 FormControlFactory(
m_xContext ).initializeTextFieldLineEnds( xNewColumn );
1714 if (!pGrid || !
m_xColumns.is() || pGrid->IsInColumnMove())
1717 Reference< XPropertySet > xNewColumn(evt.Element, css::uno::UNO_QUERY);
1718 Reference< XPropertySet > xOldColumn(
1719 evt.ReplacedElement, css::uno::UNO_QUERY);
1721 bool bWasEditing = pGrid->IsEditing();
1723 pGrid->DeactivateCell();
1725 pGrid->RemoveColumn(pGrid->GetColumnIdFromModelPos(
static_cast<sal_uInt16
>(::comphelper::getINT32(evt.Accessor))));
1730 OUString
aName = ::comphelper::getString(xNewColumn->getPropertyValue(
FM_PROP_LABEL));
1732 sal_Int32 nWidth = 0;
1733 if (aWidth >>= nWidth)
1734 nWidth = pGrid->LogicToPixel(
Point(nWidth, 0),
MapMode(MapUnit::Map10thMM)).X();
1735 sal_uInt16 nNewId = pGrid->AppendColumn(
aName,
static_cast<sal_uInt16
>(nWidth),
static_cast<sal_Int16
>(::comphelper::getINT32(evt.Accessor)));
1736 sal_uInt16 nNewPos = pGrid->GetModelColumnPos(nNewId);
1742 Reference< XColumnsSupplier > xSuppColumns;
1744 if ( pGridDataSource )
1745 xSuppColumns.
set(Reference< XInterface >( *pGridDataSource ), css::uno::UNO_QUERY);
1746 Reference< XNameAccess > xColumnsByName;
1747 if ( xSuppColumns.is() )
1748 xColumnsByName = xSuppColumns->getColumns();
1749 Reference< XIndexAccess > xColumnsByIndex( xColumnsByName, UNO_QUERY );
1751 if ( xColumnsByIndex.is() )
1758 pGrid->ActivateCell();
1769 if (!pGrid || !
m_xColumns.is() || pGrid->IsInColumnMove() ||
m_xColumns->getCount() ==
static_cast<sal_Int32
>(pGrid->GetModelColCount()))
1772 pGrid->RemoveColumn(pGrid->GetColumnIdFromModelPos(
static_cast<sal_uInt16
>(::comphelper::getINT32(evt.Accessor))));
1774 Reference< XPropertySet > xOldColumn(evt.Element, css::uno::UNO_QUERY);
1785 bool bVoid = !
Value.hasValue();
1792 pGrid->SetTextLineColor();
1793 pGrid->GetDataWindow().SetTextLineColor();
1797 pGrid->SetTextLineColor(aTextLineColor);
1798 pGrid->GetDataWindow().SetTextLineColor(aTextLineColor);
1802 std::vector< std::unique_ptr<DbGridColumn> >
const & rColumns = pGrid->GetColumns();
1803 for (
auto const & pLoop : rColumns)
1816 pGrid->Invalidate();
1820 vcl::Font aGridFont = pGrid->GetControlFont();
1823 pGrid->SetControlFont( aGridFont );
1827 vcl::Font aGridFont = pGrid->GetControlFont();
1830 pGrid->SetControlFont( aGridFont );
1835 OSL_VERIFY(
Value >>= sHelpURL );
1839 pGrid->SetHelpId( sHelpURL );
1843 pGrid->setDisplaySynchron(::comphelper::getBOOL(
Value));
1852 pGrid->Invalidate();
1856 pGrid->EnablePermanentCursor(::comphelper::getBOOL(
Value));
1858 pGrid->Invalidate();
1866 css::awt::FontDescriptor aFont;
1867 if (
Value >>= aFont)
1870 if (aFont != ::comphelper::getDefaultFont())
1874 vcl::Font aOldVclFont = pGrid->GetControlFont();
1879 pGrid->SetControlFont( aNewVclFont );
1883 Reference< XPropertySet > xModelSet(
getColumns(), UNO_QUERY);
1887 if (!aHeight.hasValue())
1888 pGrid->SetDataRowHeight(0);
1898 pGrid->SetControlBackground();
1903 pGrid->SetBackground( aColor );
1904 pGrid->SetControlBackground( aColor );
1911 pGrid->SetControlForeground();
1916 pGrid->SetTextColor( aColor );
1917 pGrid->SetControlForeground( aColor );
1922 sal_Int32 nLogHeight(0);
1923 if (
Value >>= nLogHeight)
1925 sal_Int32 nHeight = pGrid->LogicToPixel(
Point(0, nLogHeight),
MapMode(MapUnit::Map10thMM)).Y();
1927 nHeight = pGrid->CalcZoom(nHeight);
1928 pGrid->SetDataRowHeight(nHeight);
1931 pGrid->SetDataRowHeight(0);
1935 bool bValue(
true );
1936 OSL_VERIFY(
Value >>= bValue );
1937 pGrid->EnableNavigationBar( bValue );
1941 bool bValue(
true );
1942 OSL_VERIFY(
Value >>= bValue );
1943 pGrid->EnableHandle( bValue );
1947 bool bValue(
true );
1948 OSL_VERIFY(
Value >>= bValue );
1953 pGrid->GetDataWindow().Enable( bValue );
1955 pGrid->Enable( bValue );
1964 Reference< XAccessibleContext > xContext;
1970 Reference< XAccessible > xAcc( pGrid->GetAccessible() );
1972 xContext = xAcc->getAccessibleContext();
1984 if ( !xContext.is() )
1997 vcl::Window* pDataWindow = &pGrid->GetDataWindow();
2014 sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
2016 nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
2017 aProp <<= static_cast<sal_Int32>(pGrid->PixelToLogic(
Point(0, nPixelHeight),
MapMode(MapUnit::Map10thMM)).
Y());
2021 bool bHasNavBar = pGrid->HasNavigationBar();
2022 aProp <<= bHasNavBar;
2026 bool bHasHandle = pGrid->HasHandle();
2027 aProp <<= bHasHandle;
2045 aEvt.Source = getXWeak();
2053 while ( xInterceptor.is() )
2056 xInterceptor->setMasterDispatchProvider(
nullptr );
2059 Reference< XDispatchProvider > xSlave = xInterceptor->getSlaveDispatchProvider();
2061 xInterceptor->setSlaveDispatchProvider(
nullptr );
2064 xInterceptor.set(xSlave, css::uno::UNO_QUERY);
2074 Reference< XReset > xReset(
m_xCursor, UNO_QUERY);
2076 xReset->removeResetListener(
this);
2077 Reference< XLoadable > xLoadable(
m_xCursor, UNO_QUERY);
2079 xLoadable->removeLoadListener(
this);
2080 Reference< XPropertySet > xSet(
m_xCursor, UNO_QUERY);
2092 pGrid->setDataSource(Reference< XRowSet > ());
2093 pGrid->DisposeAccessible();
2122 Reference< XReset > xReset(
m_xCursor, UNO_QUERY);
2124 xReset->addResetListener(
this);
2127 Reference< XPropertySet > xSet(
m_xCursor, UNO_QUERY);
2146 Reference< XReset > xReset(
m_xCursor, UNO_QUERY);
2148 xReset->removeResetListener(
this);
2150 Reference< XPropertySet > xSet(
m_xCursor, UNO_QUERY);
2163 pGrid->setDataSource(_rxCursor);
2181 Reference< XLoadable > xLoadable(
m_xCursor, UNO_QUERY);
2186 xLoadable->removeLoadListener(
this);
2195 Reference< XLoadable > xLoadable(
m_xCursor, UNO_QUERY);
2197 if (xLoadable.is() && xLoadable->isLoaded())
2200 pGrid->setDataSource(Reference< XRowSet > ());
2205 xLoadable->addLoadListener(
this);
2227 return pGrid ? pGrid->GetViewColumnPos(pGrid->GetCurColumnId()) : -1;
2235 pGrid->GoToColumnId(pGrid->GetColumnIdFromViewPos(
nPos));
2247 Reference< css::view::XSelectionSupplier > xSelSupplier(evt.Source, UNO_QUERY);
2248 Any aSelection = xSelSupplier->getSelection();
2249 DBG_ASSERT(aSelection.getValueType().getTypeClass() == TypeClass_INTERFACE,
"FmXGridPeer::selectionChanged : invalid selection !");
2250 Reference< XPropertySet > xSelection;
2251 aSelection >>= xSelection;
2252 if (xSelection.is())
2254 Reference< XPropertySet > xCol;
2256 sal_Int32 nColCount =
m_xColumns->getCount();
2258 for (;
i < nColCount; ++
i)
2261 if ( xCol == xSelection )
2263 pGrid->markColumn(pGrid->GetColumnIdFromModelPos(
static_cast<sal_uInt16
>(i)));
2269 if ( i != pGrid->GetSelectedColumn() )
2271 if ( i < nColCount )
2273 pGrid->SelectColumnPos(pGrid->GetViewColumnPos(pGrid->GetColumnIdFromModelPos(
static_cast<sal_uInt16
>(i) )) + 1);
2275 if (pGrid->IsEditing())
2276 pGrid->DeactivateCell();
2279 pGrid->SetNoSelection();
2283 pGrid->markColumn(USHRT_MAX);
2303 return new ::comphelper::OEnumerationByIndex(
this);
2312 return pGrid->GetViewColCount();
2323 throw IndexOutOfBoundsException();
2327 sal_uInt16
nId = pGrid->GetColumnIdFromViewPos(
static_cast<sal_uInt16
>(_nIndex));
2329 sal_uInt16
nPos = pGrid->GetModelColumnPos(
nId);
2335 Reference< css::awt::XControl > xControl(pCol->
GetCell());
2336 aElement <<= xControl;
2346 throw NoSupportException();
2354 if (
Mode ==
"FilterMode" )
2355 pGrid->SetFilterMode(
true);
2358 pGrid->SetFilterMode(
false);
2372 static css::uno::Sequence<OUString>
const aModes
2392 sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->
GetId());
2393 Reference< css::awt::XControl > xControl(pColumn->
GetCell());
2394 ContainerEvent aEvt;
2395 aEvt.Source =
static_cast<XContainer*
>(
this);
2396 aEvt.Accessor <<= _nIndex;
2397 aEvt.Element <<= xControl;
2408 sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->
GetId());
2409 Reference< css::awt::XControl > xControl(pColumn->
GetCell());
2410 ContainerEvent aEvt;
2411 aEvt.Source =
static_cast<XContainer*
>(
this);
2412 aEvt.Accessor <<= _nIndex;
2413 aEvt.Element <<= xControl;
2424 pGrid->SetBrowserFlags(nOldFlags | EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT);
2428 pGrid->SetBrowserFlags(nOldFlags);
2432Reference< css::frame::XDispatch >
FmXGridPeer::queryDispatch(
const css::util::URL& aURL,
const OUString& aTargetFrameName, sal_Int32 nSearchFlags)
2434 Reference< css::frame::XDispatch > xResult;
2457 return Sequence< Reference< css::frame::XDispatch > >();
2463 if (!_xInterceptor.is())
2475 _xInterceptor->setSlaveDispatchProvider(
static_cast<css::frame::XDispatchProvider*
>(
this));
2491 if (!_xInterceptor.is())
2503 while (xChainWalk.is())
2506 Reference< css::frame::XDispatchProviderInterceptor > xSlave(xChainWalk->getSlaveDispatchProvider(), UNO_QUERY);
2508 if (xChainWalk == _xInterceptor)
2511 Reference< css::frame::XDispatchProviderInterceptor > xMaster(xChainWalk->getMasterDispatchProvider(), UNO_QUERY);
2514 xChainWalk->setSlaveDispatchProvider(Reference< css::frame::XDispatchProvider > ());
2515 xChainWalk->setMasterDispatchProvider(Reference< css::frame::XDispatchProvider > ());
2521 xMaster->setSlaveDispatchProvider(xSlave);
2524 xMaster->setSlaveDispatchProvider(
static_cast<css::frame::XDispatchProvider*
>(
this));
2530 xSlave->setMasterDispatchProvider(
static_cast<css::frame::XDispatchProvider*
>(
this));
2534 xChainWalk = xSlave;
2552 auto pUrl = std::find_if(aUrls.begin(), aUrls.end(),
2553 [&Event](
const css::util::URL& rUrl) { return rUrl.Main == Event.FeatureURL.Main; });
2554 if (pUrl != aUrls.end())
2556 auto i =
static_cast<sal_uInt32
>(std::distance(aUrls.begin(), pUrl));
2557 DBG_ASSERT(
m_pDispatchers[
i] == Event.Source,
"FmXGridPeer::statusChanged : the event source is a little bit suspect !");
2561 pGrid->GetNavigationBar().InvalidateState(aSlots[
i]);
2563 DBG_ASSERT(pUrl != aUrls.end(),
"FmXGridPeer::statusChanged : got a call for an unknown url !");
2575 Sequence< Any > aBookmarks;
2576 if ( !( _rSelection >>= aBookmarks ) )
2577 throw IllegalArgumentException();
2579 return GetAs< FmGridControl >()->selectBookmarks(aBookmarks);
2593 Sequence< Any > aSelectionBookmarks = pVclControl->getSelectionBookmarks();
2594 return Any(aSelectionBookmarks);
2620 pGrid->resetCurrentRow();
2627 if (pGrid && pGrid->IsOpen())
2628 pGrid->positioned();
2635 static const std::vector<DbGridControlNavigationBarState> aSupported {
2649 static Sequence< css::util::URL> aSupported = []()
2651 static const rtl::OUStringConstExpr sSupported[] = {
2660 css::util::URL* pSupported = tmp.getArray();
2662 for ( sal_Int32
i = 0;
i < tmp.getLength(); ++
i, ++pSupported)
2663 pSupported->Complete = sSupported[
i];
2666 Reference< css::util::XURLTransformer > xTransformer(
2667 util::URLTransformer::create(::comphelper::getProcessComponentContext()) );
2668 for (css::util::URL & rURL : asNonConstRange(tmp))
2669 xTransformer->parseStrict(rURL);
2685 sal_uInt16 nDispatchersGot = 0;
2687 const css::util::URL* pSupportedURLs = aSupportedURLs.getConstArray();
2688 Reference< css::frame::XDispatch > xNewDispatch;
2689 for (sal_Int32
i=0;
i<aSupportedURLs.getLength(); ++
i, ++pSupportedURLs)
2691 xNewDispatch =
queryDispatch(*pSupportedURLs, OUString(), 0);
2695 m_pDispatchers[
i]->removeStatusListener(
static_cast<css::frame::XStatusListener*
>(
this), *pSupportedURLs);
2698 m_pDispatchers[
i]->addStatusListener(
static_cast<css::frame::XStatusListener*
>(
this), *pSupportedURLs);
2704 if (!nDispatchersGot)
2725 m_pDispatchers.reset(
new Reference< css::frame::XDispatch > [aSupportedURLs.getLength()]);
2727 sal_uInt16 nDispatchersGot = 0;
2728 const css::util::URL* pSupportedURLs = aSupportedURLs.getConstArray();
2729 for (sal_Int32
i=0;
i<aSupportedURLs.getLength(); ++
i, ++pSupportedURLs)
2735 m_pDispatchers[
i]->addStatusListener(
static_cast<css::frame::XStatusListener*
>(
this), *pSupportedURLs);
2740 if (!nDispatchersGot)
2755 const css::util::URL* pSupportedURLs = aSupportedURLs.getConstArray();
2756 for (sal_Int32
i=0;
i<aSupportedURLs.getLength(); ++
i, ++pSupportedURLs)
2759 m_pDispatchers[
i]->removeStatusListener(
static_cast<css::frame::XStatusListener*
>(
this), *pSupportedURLs);
2773 const std::vector<DbGridControlNavigationBarState>& aSupported = getSupportedGridSlots();
2774 for (
size_t i=0;
i<aSupported.size(); ++
i)
2776 if (aSupported[
i] == nSlot)
2778 if (!m_pDispatchers[
i].is())
2781 return m_pStateCache[
i] ? 1 : 0;
2791 if (!m_pDispatchers)
2794 Sequence< css::util::URL>& aUrls = getSupportedURLs();
2795 const css::util::URL* pUrls = aUrls.getConstArray();
2797 const std::vector<DbGridControlNavigationBarState>& aSlots = getSupportedGridSlots();
2799 DBG_ASSERT(aSlots.size() ==
o3tl::make_unsigned(aUrls.getLength()),
"FmXGridPeer::OnExecuteGridSlot : inconsistent data returned by getSupportedURLs/getSupportedGridSlots!");
2801 for (
size_t i=0;
i<aSlots.size(); ++
i, ++pUrls)
2803 if (aSlots[
i] == nSlot)
2805 if (m_pDispatchers[
i].is())
2809 m_pDispatchers[
i]->dispatch(*pUrls, Sequence< PropertyValue>());
Reference< XComponentContext > m_xContext
sal_Int16 SetAlignmentFromModel(sal_Int16 nStandardAlign)
void setModel(const css::uno::Reference< css::beans::XPropertySet > &_xModel)
FmXGridCell * GetCell() const
sal_Int16 GetFieldPos() const
static void InitColumnByField(DbGridColumn *_pColumn, const css::uno::Reference< css::beans::XPropertySet > &_rxColumnModel, const css::uno::Reference< css::container::XNameAccess > &_rxFieldsByNames, const css::uno::Reference< css::container::XIndexAccess > &_rxFieldsByIndex)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
FmXContainerMultiplexer(::cppu::OWeakObject &rSource, ::osl::Mutex &rMutex)
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
virtual void SAL_CALL columnChanged(const css::lang::EventObject &_event) override
FmXGridControlMultiplexer(::cppu::OWeakObject &rSource, ::osl::Mutex &rMutex)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual void SAL_CALL removeUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &l) override
virtual OUString GetComponentServiceName() const override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
FmXSelectionMultiplexer m_aSelectionListeners
virtual OUString SAL_CALL getMode() override
virtual void SAL_CALL draw(sal_Int32 x, sal_Int32 y) override
virtual sal_Bool SAL_CALL select(const css::uno::Any &aSelection) override
virtual void SAL_CALL addUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &l) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual void SAL_CALL removeGridControlListener(const css::uno::Reference< css::form::XGridControlListener > &_listener) override
virtual void SAL_CALL registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual void SAL_CALL dispose() override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &l) override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &_rToolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual void SAL_CALL setFocus() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) override
virtual void SAL_CALL setMode(const OUString &Mode) override
virtual ~FmXGridControl() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual rtl::Reference< FmXGridPeer > imp_CreatePeer(vcl::Window *pParent)
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &l) override
virtual void SAL_CALL releaseDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override
virtual void SAL_CALL setDesignMode(sal_Bool bOn) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL hasElements() override
FmXUpdateMultiplexer m_aUpdateListeners
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Any SAL_CALL getSelection() override
virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) override
virtual sal_Bool SAL_CALL commit() override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
FmXGridControl(const css::uno::Reference< css::uno::XComponentContext > &)
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
virtual css::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType(const css::uno::Type &xType) override
FmXModifyMultiplexer m_aModifyListeners
virtual sal_Bool SAL_CALL supportsMode(const OUString &Mode) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Int16 SAL_CALL getCurrentColumnPosition() override
FmXContainerMultiplexer m_aContainerListeners
FmXGridControlMultiplexer m_aGridControlListeners
virtual void SAL_CALL addGridControlListener(const css::uno::Reference< css::form::XGridControlListener > &_listener) override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL queryFieldData(sal_Int32 nRow, const css::uno::Type &xType) override
virtual ~GridListenerDelegator()
virtual void columnChanged() override
virtual void selectionChanged() override
GridListenerDelegator(FmXGridPeer *_pPeer)
virtual void SAL_CALL reloaded(const css::lang::EventObject &aEvent) override
std::unique_ptr< GridListenerDelegator > m_pGridListener
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
virtual void SAL_CALL reloading(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL setMode(const OUString &Mode) override
void addColumnListeners(const css::uno::Reference< css::beans::XPropertySet > &xCol)
If a derived class wants to listen at some column properties, it doesn't have to override all methods...
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Type SAL_CALL getElementType() override
void removeColumnListeners(const css::uno::Reference< css::beans::XPropertySet > &xCol)
virtual sal_Bool SAL_CALL supportsMode(const OUString &Mode) override
virtual OUString SAL_CALL getMode() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
virtual void SAL_CALL addUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &l) override
virtual css::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType(const css::uno::Type &xType) override
virtual void SAL_CALL removeUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &l) override
virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) override
void DisConnectFromDispatcher()
class SAL_DLLPRIVATE GridListenerDelegator
void ConnectToDispatcher()
virtual sal_Int32 SAL_CALL getCount() override
virtual void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void updateGrid(const css::uno::Reference< css::sdbc::XRowSet > &_rDatabaseCursor)
css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xFirstDispatchInterceptor
css::uno::Reference< css::sdbc::XRowSet > m_xCursor
virtual sal_Bool SAL_CALL select(const css::uno::Any &aSelection) override
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
sal_Int32 m_nCursorListening
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
virtual VclPtr< FmGridControl > imp_CreateControl(vcl::Window *pParent, WinBits nStyle)
virtual css::uno::Any SAL_CALL getSelection() override
static const std::vector< DbGridControlNavigationBarState > & getSupportedGridSlots()
virtual void SAL_CALL dispose() override
std::unique_ptr< bool[]> m_pStateCache
virtual sal_Bool SAL_CALL isDesignMode() override
virtual void SAL_CALL unloaded(const css::lang::EventObject &rEvent) override
::comphelper::OInterfaceContainerHelper4< css::form::XUpdateListener > m_aUpdateListeners
virtual void SAL_CALL rowSetChanged(const css::lang::EventObject &event) override
virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getColumns() override
::comphelper::OInterfaceContainerHelper4< css::util::XModifyListener > m_aModifyListeners
std::unique_ptr< css::uno::Reference< css::frame::XDispatch >[]> m_pDispatchers
virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject &rEvent) override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL queryFieldData(sal_Int32 nRow, const css::uno::Type &xType) override
virtual css::uno::Reference< css::sdbc::XRowSet > SAL_CALL getRowSet() override
bool m_bInterceptingDispatch
void columnHidden(DbGridColumn const *pColumn)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override
virtual void SAL_CALL loaded(const css::lang::EventObject &rEvent) override
void Create(vcl::Window *pParent, WinBits nStyle)
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
virtual void SAL_CALL rowChanged(const css::lang::EventObject &event) override
virtual sal_Bool SAL_CALL commit() override
static css::uno::Sequence< css::util::URL > & getSupportedURLs()
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
void startCursorListening()
virtual void SAL_CALL setColumns(const css::uno::Reference< css::container::XIndexContainer > &aColumns) override final
virtual void SAL_CALL unloading(const css::lang::EventObject &aEvent) override
virtual css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
css::uno::Reference< css::container::XIndexContainer > m_xColumns
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
::comphelper::OInterfaceContainerHelper4< css::view::XSelectionChangeListener > m_aSelectionListeners
FmXGridPeer(const css::uno::Reference< css::uno::XComponentContext > &)
virtual void SAL_CALL setRowSet(const css::uno::Reference< css::sdbc::XRowSet > &xDataSource) override final
void stopCursorListening()
virtual sal_Int16 SAL_CALL getCurrentColumnPosition() override
virtual ~FmXGridPeer() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
virtual sal_Bool SAL_CALL hasElements() override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &l) override
virtual void SAL_CALL cursorMoved(const css::lang::EventObject &event) override
virtual void SAL_CALL draw(sal_Int32 x, sal_Int32 y) override
virtual void SAL_CALL removeGridControlListener(const css::uno::Reference< css::form::XGridControlListener > &_listener) override
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
virtual void SAL_CALL resetted(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL addGridControlListener(const css::uno::Reference< css::form::XGridControlListener > &_listener) override
virtual void SAL_CALL releaseDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override
::comphelper::OInterfaceContainerHelper4< css::form::XGridControlListener > m_aGridControlListeners
void columnVisible(DbGridColumn const *pColumn)
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &l) override
virtual void SAL_CALL registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
::comphelper::OInterfaceContainerHelper4< css::container::XContainerListener > m_aContainerListeners
virtual void SAL_CALL setDesignMode(sal_Bool bOn) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL modified(const css::lang::EventObject &Source) override
FmXModifyMultiplexer(::cppu::OWeakObject &rSource, ::osl::Mutex &rMutex)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
FmXSelectionMultiplexer(::cppu::OWeakObject &rSource, ::osl::Mutex &rMutex)
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
FmXUpdateMultiplexer(::cppu::OWeakObject &rSource, ::osl::Mutex &rMutex)
virtual void SAL_CALL updated(const css::lang::EventObject &) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
virtual sal_Bool SAL_CALL approveUpdate(const css::lang::EventObject &) override
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
INetProtocol GetProtocol() const
::cppu::OWeakObject & m_rParent
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
MouseListenerMultiplexer maMouseListeners
void SAL_CALL dispose() override
MouseMotionListenerMultiplexer maMouseMotionListeners
KeyListenerMultiplexer maKeyListeners
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
::osl::Mutex & GetMutex()
virtual void updateFromModel()
UnoControlComponentInfos maComponentInfos
FocusListenerMultiplexer maFocusListeners
void SAL_CALL setPosSize(sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags) override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
css::uno::Reference< css::awt::XControlModel > mxModel
css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
css::uno::WeakReferenceHelper maAccessibleContext
::comphelper::OInterfaceContainerHelper3< css::util::XModeChangeListener > maModeChangeListeners
void SAL_CALL setFocus() override
WindowListenerMultiplexer maWindowListeners
void setPeer(const css::uno::Reference< css::awt::XVclWindowPeer > &_xPeer)
PaintListenerMultiplexer maPaintListeners
void DisposeAccessibleContext(css::uno::Reference< css::lang::XComponent > const &xContext)
css::uno::Reference< css::awt::XGraphics > mxGraphics
virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext()
vcl::Window * GetWindow() const
css::uno::Any SAL_CALL getProperty(const OUString &PropertyName) override
void SAL_CALL setProperty(const OUString &PropertyName, const css::uno::Any &Value) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void SAL_CALL draw(sal_Int32 nX, sal_Int32 nY) override
void SAL_CALL dispose() override
void set(reference_type *pBody)
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(const css::lang::EventObject &rEvt)
sal_Int32 getLength() const
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
bool hasMoreElements() const
css::uno::Reference< ListenerT > const & next()
bool hasMoreElements() const
css::uno::Reference< ListenerT > const & next()
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
css::uno::Type const & get()
void SetFontSize(const Size &)
void SetOrientation(Degree10 nLineOrientation)
FontFamily GetFamilyType()
void SetWidthType(FontWidth)
void SetStyleName(const OUString &rStyleName)
void SetWordLineMode(bool bWordLine)
void SetPitch(FontPitch ePitch)
const OUString & GetStyleName() const
FontStrikeout GetStrikeout() const
FontRelief GetRelief() const
FontEmphasisMark GetEmphasisMark() const
void SetItalic(FontItalic)
void SetWeight(FontWeight)
const OUString & GetFamilyName() const
void SetFamily(FontFamily)
void SetUnderline(FontLineStyle)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
void SetKerning(FontKerning nKerning)
void SetFamilyName(const OUString &rFamilyName)
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
void SetRelief(FontRelief)
bool IsWordLineMode() const
Degree10 GetOrientation() const
void SetEmphasisMark(FontEmphasisMark)
void SetStrikeout(FontStrikeout)
const Color & GetControlForeground() const
vcl::Font GetControlFont() const
const Color & GetControlBackground() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
static css::awt::FontDescriptor ImplCreateFontDescriptor(const vcl::Font &rFont)
IMPL_LINK(FmXGridPeer, OnQueryGridSlotState, DbGridControlNavigationBarState, nSlot, int)
Reference< XInterface > FmXGridControl_NewInstance_Impl(const Reference< XMultiServiceFactory > &_rxFactory)
static vcl::Font ImplCreateFont(const css::awt::FontDescriptor &rDescr)
constexpr OUStringLiteral FM_PROP_ROWCOUNT
#define FM_PROP_FONTRELIEF
constexpr OUStringLiteral FM_PROP_CURSORCOLOR
constexpr OUStringLiteral FM_PROP_DISPLAYSYNCHRON
constexpr OUStringLiteral FM_PROP_WIDTH
constexpr OUStringLiteral FM_PROP_CLASSID
#define FM_PROP_BACKGROUNDCOLOR
constexpr OUStringLiteral FM_PROP_ISNEW
constexpr OUStringLiteral FM_PROP_ENABLED
constexpr OUStringLiteral FM_PROP_LABEL
constexpr OUStringLiteral FM_PROP_HIDDEN
constexpr OUStringLiteral FM_PROP_NAME
#define FM_PROP_RECORDMARKER
constexpr OUStringLiteral FM_PROP_ALIGN
#define FM_PROP_TEXTCOLOR
constexpr OUStringLiteral FM_PROP_FONT
constexpr OUStringLiteral FM_PROP_BORDER
#define FM_PROP_HASNAVIGATION
constexpr OUStringLiteral FM_PROP_RESULTSET_TYPE
constexpr OUStringLiteral FM_PROP_ROWHEIGHT
constexpr OUStringLiteral FM_PROP_FORMATKEY
constexpr OUStringLiteral FM_PROP_ALWAYSSHOWCURSOR
constexpr OUStringLiteral FM_PROP_TEXTLINECOLOR
#define FM_PROP_FONTEMPHASISMARK
constexpr OUStringLiteral FM_PROP_VALUE
constexpr OUStringLiteral FM_PROP_ISMODIFIED
constexpr OUStringLiteral FM_SUN_CONTROL_GRIDCONTROL
constexpr OUStringLiteral FMURL_RECORD_MOVETONEW
constexpr OUStringLiteral FMURL_RECORD_MOVELAST
constexpr OUStringLiteral FMURL_RECORD_MOVENEXT
constexpr OUStringLiteral FMURL_RECORD_MOVEPREV
constexpr OUStringLiteral FMURL_RECORD_MOVEFIRST
constexpr OUStringLiteral FMURL_RECORD_UNDO
#define GRID_COLUMN_NOT_FOUND
DbGridControlNavigationBarState
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
B2DTuple getColumn(const B2DHomMatrix &rMatrix, sal_uInt16 nCol)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
VCL_DLLPUBLIC css::awt::FontSlant ConvertFontSlant(FontItalic eWeight)
VCL_DLLPUBLIC float ConvertFontWidth(FontWidth eWidth)
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)