23#include <servicenames.hxx>
29#include <com/sun/star/awt/Point.hpp>
30#include <com/sun/star/awt/Size.hpp>
31#include <com/sun/star/beans/PropertyValue.hpp>
32#include <com/sun/star/frame/Desktop.hpp>
43 , m_xCC(
std::move(xContext))
44 , m_bUnlockControllersOnExecute(false)
46 uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xCC);
47 uno::Reference< frame::XTerminateListener > xListener(
this );
48 xDesktop->addTerminateListener( xListener );
51CreationWizardUnoDlg::~CreationWizardUnoDlg()
58OUString SAL_CALL CreationWizardUnoDlg::getImplementationName()
63sal_Bool SAL_CALL CreationWizardUnoDlg::supportsService(
const OUString& rServiceName )
68css::uno::Sequence< OUString > SAL_CALL CreationWizardUnoDlg::getSupportedServiceNames()
76 return OComponentHelper::queryInterface( aType );
78void SAL_CALL CreationWizardUnoDlg::acquire() noexcept
80 OComponentHelper::acquire();
82void SAL_CALL CreationWizardUnoDlg::release() noexcept
84 OComponentHelper::release();
90 void *
p =
static_cast< ui::dialogs::XAsynchronousExecutableDialog *
>( this );
95 void *
p =
static_cast< lang::XServiceInfo *
>( this );
100 void *
p =
static_cast< lang::XInitialization *
>( this );
105 void *
p =
static_cast< frame::XTerminateListener *
>( this );
110 void *
p =
static_cast< beans::XPropertySet *
>( this );
113 return OComponentHelper::queryAggregation( rType );
132 return css::uno::Sequence<sal_Int8>();
136void SAL_CALL CreationWizardUnoDlg::queryTermination(
const lang::EventObject& )
140void SAL_CALL CreationWizardUnoDlg::notifyTermination(
const lang::EventObject& )
146void SAL_CALL CreationWizardUnoDlg::disposing(
const lang::EventObject& )
151void SAL_CALL CreationWizardUnoDlg::setDialogTitle(
const OUString& )
154void CreationWizardUnoDlg::createDialogOnDemand()
160 if( !m_xParentWindow.is() && m_xChartModel.is() )
163 m_xChartModel->getCurrentController() );
169 m_xParentWindow =
xFrame->getContainerWindow();
177 pParent =
dynamic_cast<weld::Window*
>(pTunnel->getWidget());
181 if( m_xChartModel.is() )
183 m_xDialog = std::make_shared<CreationWizard>(pParent, m_xChartModel, m_xCC);
192void SAL_CALL CreationWizardUnoDlg::startExecuteModal(
const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener )
195 createDialogOnDemand();
200 m_xDialog->getDialog()->SetInstallLOKNotifierHdl(
204 if( m_bUnlockControllersOnExecute && m_xChartModel.is() )
205 m_xChartModel->unlockControllers();
211 ::css::uno::Reference< ::css::uno::XInterface > xSource;
213 css::ui::dialogs::DialogClosedEvent aEvent( xSource, nResult );
214 xListener->dialogClosed( aEvent );
224 beans::PropertyValue aProperty;
225 if(rArgument >>= aProperty)
227 if( aProperty.Name ==
"ParentWindow" )
229 aProperty.Value >>= m_xParentWindow;
231 else if( aProperty.Name ==
"ChartModel" )
234 aProperty.Value >>= xInt;
235 m_xChartModel =
dynamic_cast<::chart::ChartModel*
>(xInt.get());
236 assert(m_xChartModel);
244void SAL_CALL CreationWizardUnoDlg::disposing()
246 m_xChartModel.clear();
247 m_xParentWindow.clear();
256 xDesktop->removeTerminateListener( xListener );
258 catch(
const uno::Exception & )
267 OSL_FAIL(
"not implemented");
274 if( rPropertyName ==
"Position" )
277 createDialogOnDemand();
281 else if( rPropertyName ==
"Size")
285 else if( rPropertyName ==
"UnlockControllersOnExecute" )
287 if( ! (rValue >>= m_bUnlockControllersOnExecute) )
288 throw lang::IllegalArgumentException(
"Property 'UnlockControllers' requires value of type boolean" ,
nullptr, 0 );
291 throw beans::UnknownPropertyException(
"unknown property was tried to set to chart wizard" ,
nullptr );
294uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue(
const OUString& rPropertyName )
297 if( rPropertyName ==
"Position" )
302 createDialogOnDemand();
306 awt::Point aPoint(aPos.
X(), aPos.
Y());
310 else if( rPropertyName ==
"Size" )
315 createDialogOnDemand();
323 else if( rPropertyName ==
"UnlockControllersOnExecute" )
325 aRet <<= m_bUnlockControllersOnExecute;
328 throw beans::UnknownPropertyException(
"unknown property was tried to get from chart wizard" ,
nullptr );
332void SAL_CALL CreationWizardUnoDlg::addPropertyChangeListener(
335 OSL_FAIL(
"not implemented");
337void SAL_CALL CreationWizardUnoDlg::removePropertyChangeListener(
340 OSL_FAIL(
"not implemented");
345 OSL_FAIL(
"not implemented");
350 OSL_FAIL(
"not implemented");
355extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
357 css::uno::Sequence<css::uno::Any>
const &)
Reference< XExecutableDialog > m_xDialog
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
constexpr tools::Long Y() const
constexpr tools::Long X() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
std::shared_ptr< CreationWizard > m_xDialog
CreationWizardUnoDlg()=delete
css::uno::Type const & get()
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
#define DBG_UNHANDLED_EXCEPTION(...)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_chart2_WizardDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Sequence< PropertyValue > aArguments
#define LINK(Instance, Class, Member)
void setPropertyValue(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Set a property to a certain value in the given map.
IMPL_STATIC_LINK_NOARG(CreationWizardUnoDlg, InstallLOKNotifierHdl, void *, vcl::ILibreOfficeKitNotifier *)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_NAME
constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME
Reference< XController > xController
Reference< XFrame > xFrame