25#include <com/sun/star/form/runtime/FormFeature.hpp>
30#include <osl/diagnose.h>
42 namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
46 ,m_aFeatureInterception( m_xORB )
47 ,m_nConnectedFeatures( 0 )
100 if ( feature.second.aURL.Main == _rState.FeatureURL.Main )
102 if ( ( feature.second.bCachedState !=
bool(_rState.IsEnabled) )
103 || ( feature.second.aCachedAdditionalState != _rState.State )
107 feature.second.bCachedState = _rState.IsEnabled;
108 feature.second.aCachedAdditionalState = _rState.State;
117 OSL_FAIL(
"OFormNavigationHelper::statusChanged: huh? An invalid/unknown URL?" );
129 if ( feature.second.xDispatcher == _rSource.Source )
131 feature.second.xDispatcher->removeStatusListener(
static_cast< XStatusListener*
>(
this ), feature.second.aURL );
132 feature.second.xDispatcher =
nullptr;
133 feature.second.bCachedState =
false;
134 feature.second.aCachedAdditionalState.clear();
156 Reference< XDispatch > xNewDispatcher;
157 Reference< XDispatch > xCurrentDispatcher;
162 xCurrentDispatcher = feature.second.xDispatcher;
163 if ( xNewDispatcher != xCurrentDispatcher )
166 if ( xCurrentDispatcher.is() )
167 xCurrentDispatcher->removeStatusListener(
static_cast< XStatusListener*
>(
this ), feature.second.aURL );
169 xCurrentDispatcher = feature.second.xDispatcher = xNewDispatcher;
171 if ( xCurrentDispatcher.is() )
172 xCurrentDispatcher->addStatusListener(
static_cast< XStatusListener*
>(
this ), feature.second.aURL );
175 if ( xCurrentDispatcher.is() )
178 feature.second.bCachedState =
false;
200 feature.second.bCachedState =
false;
201 feature.second.aCachedAdditionalState.clear();
202 feature.second.xDispatcher =
queryDispatch( feature.second.aURL );
203 if ( feature.second.xDispatcher.is() )
206 feature.second.xDispatcher->addStatusListener(
static_cast< XStatusListener*
>(
this ), feature.second.aURL );
221 if ( feature.second.xDispatcher.is() )
222 feature.second.xDispatcher->removeStatusListener(
static_cast< XStatusListener*
>(
this ), feature.second.aURL );
224 feature.second.xDispatcher =
nullptr;
225 feature.second.bCachedState =
false;
226 feature.second.aCachedAdditionalState.clear();
243 ::std::vector< sal_Int16 > aFeatureIds;
248 for (
auto const& feature : aFeatureIds)
254 DBG_ASSERT( bKnownId,
"OFormNavigationHelper::initializeSupportedFeatures: unknown feature id!" );
270 const Any& _rParamValue )
const
275 if ( aInfo->second.xDispatcher.is() )
278 OUString::createFromAscii( _pParamAsciiName ), _rParamValue) };
280 aInfo->second.xDispatcher->dispatch( aInfo->second.aURL, aArgs );
291 if ( aInfo->second.xDispatcher.is() )
293 Sequence< PropertyValue > aEmptyArgs;
294 aInfo->second.xDispatcher->dispatch( aInfo->second.aURL, aEmptyArgs );
304 return aInfo->second.bCachedState;
316 aInfo->second.aCachedAdditionalState >>= bState;
328 aInfo->second.aCachedAdditionalState >>= sState;
340 aInfo->second.aCachedAdditionalState >>=
nState;
382 FeatureURL(
const sal_Int16 _nFormFeature,
const char* _pAsciiURL )
388 const FeatureURL* lcl_getFeatureTable()
390 static const FeatureURL s_aFeatureURLs[] =
411 FeatureURL( 0,
nullptr )
413 return s_aFeatureURLs;
420 const FeatureURL* pFeatures = lcl_getFeatureTable();
421 while ( pFeatures->pAsciiURL )
423 if ( pFeatures->nFormFeature == _nFeatureId )
424 return pFeatures->pAsciiURL;
433 const FeatureURL* pFeatures = lcl_getFeatureTable();
434 while ( pFeatures->pAsciiURL )
437 return pFeatures->nFormFeature;
void releaseDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &Interceptor)
void registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &Interceptor)
css::uno::Reference< css::frame::XDispatch > queryDispatch(const css::util::URL &_rURL)
queries the interceptor chain for the given dispatch, with a blank target frame and no frame search f...
#define DBG_ASSERT(sCon, aError)
#define URL_FORM_AUTO_FILTER
#define URL_FORM_APPLY_FILTER
#define URL_FORM_REMOVE_FILTER
#define URL_RECORD_DELETE
#define URL_FORM_REFRESH_CURRENT_CONTROL
#define URL_FORM_POSITION
#define URL_FORM_RECORDCOUNT
#define URL_FORM_SORT_DOWN
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
ListBox is a bit confusing / different from other form components, so here are a few notes:
bool equalsAscii(std::u16string_view s1, std::string_view s2)