22#include <com/sun/star/util/URLTransformer.hpp>
23#include <com/sun/star/frame/XDispatchProvider.hpp>
24#include <com/sun/star/beans/PropertyValue.hpp>
25#include <com/sun/star/lang/DisposedException.hpp>
26#include <com/sun/star/lang/XMultiServiceFactory.hpp>
36using namespace css::awt;
37using namespace css::uno;
38using namespace css::beans;
39using namespace css::lang;
40using namespace css::frame;
41using namespace css::util;
47 uno::Reference< uno::XComponentContext > xContext,
50 m_bInitialized( false ),
54 m_pToolbar( pToolBar )
65 Any a = ::cppu::queryInterface(
67 static_cast< frame::XStatusListener*
>(
this ),
68 static_cast< frame::XToolbarController*
>(
this ),
69 static_cast< lang::XInitialization*
>(
this ),
70 static_cast< lang::XComponent*
>(
this ),
71 static_cast< util::XUpdatable*
>(
this ));
91 const css::uno::Sequence< css::uno::Any >& aArguments )
96 throw DisposedException();
103 PropertyValue aPropValue;
104 for (
const css::uno::Any& rArg :
aArguments )
106 if ( rArg >>= aPropValue )
108 if ( aPropValue.Name ==
"Frame" )
109 m_xFrame.set(aPropValue.Value,UNO_QUERY);
110 else if ( aPropValue.Name ==
"CommandURL" )
112 else if ( aPropValue.Name ==
"ServiceManager" )
114 Reference<XMultiServiceFactory> xServiceManager(aPropValue.Value,UNO_QUERY);
124 Reference< XComponent > xThis =
this;
140 const css::uno::Reference< css::lang::XEventListener >& )
146 const css::uno::Reference< css::lang::XEventListener >& )
156 throw DisposedException();
161 const css::lang::EventObject& Source )
163 uno::Reference< uno::XInterface > xSource(
Source.Source );
170 uno::Reference< uno::XInterface > xIfac(
m_xFrame, uno::UNO_QUERY );
171 if ( xIfac == xSource )
179 throw DisposedException();
185 uno::Reference< frame::XDispatch >
xDispatch;
186 uno::Reference< frame::XFrame >
xFrame;
187 uno::Reference< util::XURLTransformer > xURLTransformer;
188 OUString aCommandURL;
195 throw DisposedException();
213 uno::Reference< frame::XDispatchProvider > xDispatchProvider(
xFrame, uno::UNO_QUERY );
214 if ( xDispatchProvider.is() )
231 catch (
const DisposedException& )
241 throw DisposedException();
243 sal_Int16 nKeyModifier(
static_cast<sal_Int16
>(
m_pToolbar->GetModifier()) );
251 throw DisposedException();
257 throw DisposedException();
259 return uno::Reference< awt::XWindow >();
263 const css::uno::Reference< css::awt::XWindow >& )
266 throw DisposedException();
268 return uno::Reference< awt::XWindow >();
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
Reference< XDispatch > xDispatch
css::uno::Reference< css::uno::XComponentContext > m_xContext
Sequence< PropertyValue > aArguments
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Reference< XFrame > xFrame