22#include <com/sun/star/util/URLTransformer.hpp>
23#include <com/sun/star/util/XURLTransformer.hpp>
24#include <com/sun/star/beans/PropertyValue.hpp>
25#include <com/sun/star/lang/DisposedException.hpp>
26#include <com/sun/star/frame/status/ItemStatus.hpp>
27#include <com/sun/star/frame/status/Visibility.hpp>
28#include <com/sun/star/frame/XControlNotificationListener.hpp>
29#include <com/sun/star/frame/XFrame.hpp>
38using namespace css::awt;
39using namespace css::uno;
40using namespace css::beans;
41using namespace css::lang;
42using namespace css::frame;
43using namespace css::frame::status;
44using namespace css::util;
50 const Reference< XComponentContext >& rxContext,
51 const Reference< XFrame >& rFrame,
55 svt::ToolboxController( rxContext, rFrame,
aCommand )
56 , m_xToolbar( pToolbar )
58 , m_bMadeInvisible( false )
89 Reference< XURLTransformer > xURLTransformer;
91 Sequence<PropertyValue> aArgs;
97 throw DisposedException();
116 pExecuteInfo->
aArgs = aArgs;
139 ItemStatus aItemState;
141 ControlCommand aControlCommand;
143 if ( Event.State >>= bValue )
151 nItemBits |= ToolBoxItemBits::CHECKABLE;
153 else if ( Event.State >>= aStrValue )
162 else if ( Event.State >>= aItemState )
165 nItemBits |= ToolBoxItemBits::CHECKABLE;
169 else if ( Event.State >>= aItemVisibility )
174 else if ( Event.State >>= aControlCommand )
176 if (aControlCommand.Command ==
"SetQuickHelpText")
178 for (NamedValue
const & rArg : std::as_const(aControlCommand.Arguments))
180 if (rArg.Name ==
"HelpText")
183 rArg.Value >>= aHelpText;
206 ExecuteInfo* pExecuteInfo =
static_cast<ExecuteInfo*
>(
p);
213 pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs );
231 frame::ControlEvent
aEvent;
232 aEvent.aURL = pNotifyInfo->aSourceURL;
233 aEvent.Event = pNotifyInfo->aEventName;
234 aEvent.aInformation = pNotifyInfo->aInfoSeq;
235 pNotifyInfo->xNotifyListener->controlEvent(
aEvent );
245 const OUString& aEventName,
246 const uno::Reference< frame::XDispatch >& xDispatch,
247 const uno::Sequence< beans::NamedValue >& rInfo )
249 uno::Reference< frame::XControlNotificationListener > xControlNotify(
xDispatch, uno::UNO_QUERY );
251 if ( !xControlNotify.is() )
262 sal_Int32
nCount = rInfo.getLength();
263 uno::Sequence< beans::NamedValue > aInfoSeq( rInfo );
264 aInfoSeq.realloc(
nCount+1 );
265 auto pInfoSeq = aInfoSeq.getArray();
266 pInfoSeq[
nCount].Name =
"Source";
275 uno::Reference< frame::XDispatch >
xDispatch;
289 if (
m_aURL.Complete.isEmpty() )
300 uno::Sequence< beans::NamedValue > aInfo;
309 uno::Sequence< beans::NamedValue > aInfo;
318 uno::Sequence< beans::NamedValue > aInfo { {
"Text", css::uno::Any(aText) } };
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static OUString EraseAllMnemonicChars(const OUString &rStr)
Reference< XDispatch > xDispatch
#define LINK(Instance, Class, Member)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
IMPL_STATIC_LINK(ComplexToolbarController, ExecuteHdl_Impl, void *, p, void)