21#include <com/sun/star/lang/XMultiComponentFactory.hpp>
22#include <com/sun/star/awt/XRequestCallback.hpp>
23#include <com/sun/star/frame/Desktop.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
39 throw uno::RuntimeException();
59 uno::Reference< lang::XMultiComponentFactory >
xFactory(
m_xContext->getServiceManager(), uno::UNO_SET_THROW );
61 uno::Reference< awt::XRequestCallback > xRequestCallback(
63 "com.sun.star.awt.AsyncCallback",
65 uno::UNO_QUERY_THROW );
67 xRequestCallback->addCallback(
this,
uno::Any() );
69 catch ( uno::Exception& )
93 bool bSuccess =
false;
97 uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(
m_xContext);
100 uno::Reference< beans::XPropertySet > xPropertySet( xDesktop, uno::UNO_QUERY_THROW );
101 OUString aVetoPropName(
"SuspendQuickstartVeto" );
104 xPropertySet->setPropertyValue( aVetoPropName, aValue );
108 bSuccess = xDesktop->terminate();
109 }
catch( uno::Exception& )
115 xPropertySet->setPropertyValue( aVetoPropName, aValue );
122 catch( uno::Exception& )
133 return "com.sun.star.comp.task.OfficeRestartManager";
143 return {
"com.sun.star.comp.task.OfficeRestartManager" };
149extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
151 css::uno::XComponentContext *context,
152 css::uno::Sequence<css::uno::Any>
const &)
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL notify(const css::uno::Any &aData) override
virtual void SAL_CALL requestRestart(const css::uno::Reference< css::task::XInteractionHandler > &xInteractionHandler) override
virtual sal_Bool SAL_CALL isRestartRequested(sal_Bool bInitialized) override
bool m_bOfficeInitialized
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Reference< XSingleServiceFactory > xFactory
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_task_OfficeRestartManager(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)