1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _CHART2_CREATION_WIZARD_UNO_HXX 29 #define _CHART2_CREATION_WIZARD_UNO_HXX 30 31 #include "ServiceMacros.hxx" 32 #include "MutexContainer.hxx" 33 #include <cppuhelper/component.hxx> 34 #include <com/sun/star/awt/XWindow.hpp> 35 #include <com/sun/star/beans/XPropertySet.hpp> 36 #include <com/sun/star/frame/XModel.hpp> 37 #include <com/sun/star/frame/XTerminateListener.hpp> 38 #include <com/sun/star/lang/XInitialization.hpp> 39 #include <com/sun/star/lang/XServiceInfo.hpp> 40 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> 41 #include <com/sun/star/uno/XComponentContext.hpp> 42 43 // header for define DECL_LINK 44 #include <tools/link.hxx> 45 #include <vcl/vclevent.hxx> 46 47 //............................................................................. 48 namespace chart 49 { 50 //............................................................................. 51 52 class CreationWizard; 53 class CreationWizardUnoDlg : public MutexContainer 54 , public ::cppu::OComponentHelper 55 , public ::com::sun::star::ui::dialogs::XExecutableDialog 56 , public ::com::sun::star::lang::XServiceInfo 57 , public ::com::sun::star::lang::XInitialization 58 , public ::com::sun::star::frame::XTerminateListener 59 , public ::com::sun::star::beans::XPropertySet 60 { 61 public: 62 CreationWizardUnoDlg( const ::com::sun::star::uno::Reference< 63 ::com::sun::star::uno::XComponentContext >& xContext ); 64 virtual ~CreationWizardUnoDlg(); 65 66 // XInterface 67 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 68 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException); 69 virtual void SAL_CALL acquire() throw (); 70 virtual void SAL_CALL release() throw (); 71 72 // XTypeProvider 73 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); 74 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); 75 76 // XServiceInfo 77 APPHELPER_XSERVICEINFO_DECL() 78 APPHELPER_SERVICE_FACTORY_HELPER(CreationWizardUnoDlg) 79 80 // XExecutableDialog 81 virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException); 82 virtual sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException); 83 84 // XInitialization 85 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 86 87 // XTerminateListener 88 virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); 89 virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 90 91 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 92 93 //XPropertySet 94 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); 95 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 96 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 97 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 98 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 99 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 100 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 101 102 DECL_LINK( DialogEventHdl, VclWindowEvent* ); 103 104 protected: 105 // ____ OComponentHelper ____ 106 /// Called in dispose method after the listeners were notified. 107 virtual void SAL_CALL disposing(); 108 109 private: 110 //no default constructor 111 CreationWizardUnoDlg(); 112 void createDialogOnDemand(); 113 114 private: 115 ::com::sun::star::uno::Reference< 116 ::com::sun::star::frame::XModel > m_xChartModel; 117 ::com::sun::star::uno::Reference< 118 ::com::sun::star::uno::XComponentContext> m_xCC; 119 com::sun::star::uno::Reference< 120 com::sun::star::awt::XWindow > m_xParentWindow; 121 122 CreationWizard* m_pDialog; 123 sal_Bool m_bUnlockControllersOnExecute; 124 }; 125 126 //............................................................................. 127 } //namespace chart 128 //............................................................................. 129 #endif 130