Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / controller / inc / dlg_CreationWizard_UNO.hxx
blob89b8cb5a08f24e0df1d814200db6b62d5be64c8a
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::frame { class XModel; }
37 namespace com::sun::star::uno { class XComponentContext; }
39 class VclWindowEvent;
41 namespace chart
43 class ChartModel;
45 class CreationWizardUnoDlg final : public cppu::BaseMutex
46 , public ::cppu::OComponentHelper
47 , public css::ui::dialogs::XAsynchronousExecutableDialog
48 , public css::lang::XServiceInfo
49 , public css::lang::XInitialization
50 , public css::frame::XTerminateListener
51 , public css::beans::XPropertySet
53 public:
54 CreationWizardUnoDlg() = delete;
56 CreationWizardUnoDlg( css::uno::Reference< css::uno::XComponentContext > xContext );
57 virtual ~CreationWizardUnoDlg() override;
59 // XInterface
60 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
61 virtual css::uno::Any SAL_CALL queryAggregation( css::uno::Type const & rType ) override;
62 virtual void SAL_CALL acquire() noexcept override;
63 virtual void SAL_CALL release() noexcept override;
65 // XTypeProvider
66 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
67 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
69 // XServiceInfo
70 virtual OUString SAL_CALL getImplementationName() override;
71 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
72 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
74 // XAsynchronousExecutableDialog
75 virtual void SAL_CALL setDialogTitle( const OUString& aTitle ) override;
76 virtual void SAL_CALL startExecuteModal( const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener ) override;
78 // XInitialization
79 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
81 // XTerminateListener
82 virtual void SAL_CALL queryTermination( const css::lang::EventObject& Event ) override;
83 virtual void SAL_CALL notifyTermination( const css::lang::EventObject& Event ) override;
85 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
87 //XPropertySet
88 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
89 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
90 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
91 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
92 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
93 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
96 protected:
97 // ____ OComponentHelper ____
98 /// Called in dispose method after the listeners were notified.
99 virtual void SAL_CALL disposing() override;
101 private:
102 void createDialogOnDemand();
103 DECL_STATIC_LINK(CreationWizardUnoDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
105 private:
106 rtl::Reference< ::chart::ChartModel > m_xChartModel;
107 css::uno::Reference< css::uno::XComponentContext> m_xCC;
108 css::uno::Reference< css::awt::XWindow > m_xParentWindow;
110 std::shared_ptr<CreationWizard> m_xDialog;
111 bool m_bUnlockControllersOnExecute;
114 } //namespace chart
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */