cid#1640468 Dereference after null check
[LibreOffice.git] / chart2 / source / controller / inc / dlg_CreationWizard_UNO.hxx
blob68dbe78432da43e4782f478b78f2c51b23bbdbce
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <cppuhelper/basemutex.hxx>
23 #include <cppuhelper/component.hxx>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/frame/XTerminateListener.hpp>
26 #include <com/sun/star/lang/XInitialization.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
30 #include <rtl/ref.hxx>
32 #include "dlg_CreationWizard.hxx"
33 #include <tools/link.hxx>
35 namespace com::sun::star::awt { class XWindow; }
36 namespace com::sun::star::uno { class XComponentContext; }
38 namespace chart
40 class ChartModel;
42 class CreationWizardUnoDlg final : public cppu::BaseMutex
43 , public ::cppu::OComponentHelper
44 , public css::ui::dialogs::XAsynchronousExecutableDialog
45 , public css::lang::XServiceInfo
46 , public css::lang::XInitialization
47 , public css::frame::XTerminateListener
48 , public css::beans::XPropertySet
50 public:
51 CreationWizardUnoDlg() = delete;
53 CreationWizardUnoDlg( css::uno::Reference< css::uno::XComponentContext > xContext );
54 virtual ~CreationWizardUnoDlg() override;
56 // XInterface
57 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
58 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) override;
59 virtual void SAL_CALL acquire() noexcept override;
60 virtual void SAL_CALL release() noexcept override;
62 // XTypeProvider
63 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
64 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
66 // XServiceInfo
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
69 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
71 // XAsynchronousExecutableDialog
72 virtual void SAL_CALL setDialogTitle( const OUString& aTitle ) override;
73 virtual void SAL_CALL startExecuteModal( const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener ) override;
75 // XInitialization
76 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
78 // XTerminateListener
79 virtual void SAL_CALL queryTermination( const css::lang::EventObject& Event ) override;
80 virtual void SAL_CALL notifyTermination( const css::lang::EventObject& Event ) override;
82 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
84 //XPropertySet
85 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
86 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
87 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
88 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
89 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
90 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
91 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
93 protected:
94 // ____ OComponentHelper ____
95 /// Called in dispose method after the listeners were notified.
96 virtual void SAL_CALL disposing() override;
98 private:
99 void createDialogOnDemand();
100 DECL_STATIC_LINK(CreationWizardUnoDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
102 private:
103 rtl::Reference< ::chart::ChartModel > m_xChartModel;
104 css::uno::Reference< css::uno::XComponentContext> m_xCC;
105 css::uno::Reference< css::awt::XWindow > m_xParentWindow;
107 std::shared_ptr<CreationWizard> m_xDialog;
108 bool m_bUnlockControllersOnExecute;
111 } //namespace chart
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */