1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _CHART2_CREATION_WIZARD_UNO_HXX 25 #define _CHART2_CREATION_WIZARD_UNO_HXX 26 27 #include "ServiceMacros.hxx" 28 #include "MutexContainer.hxx" 29 #include <cppuhelper/component.hxx> 30 #include <com/sun/star/awt/XWindow.hpp> 31 #include <com/sun/star/beans/XPropertySet.hpp> 32 #include <com/sun/star/frame/XModel.hpp> 33 #include <com/sun/star/frame/XTerminateListener.hpp> 34 #include <com/sun/star/lang/XInitialization.hpp> 35 #include <com/sun/star/lang/XServiceInfo.hpp> 36 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> 37 #include <com/sun/star/uno/XComponentContext.hpp> 38 39 // header for define DECL_LINK 40 #include <tools/link.hxx> 41 #include <vcl/vclevent.hxx> 42 43 //............................................................................. 44 namespace chart 45 { 46 //............................................................................. 47 48 class CreationWizard; 49 class CreationWizardUnoDlg : public MutexContainer 50 , public ::cppu::OComponentHelper 51 , public ::com::sun::star::ui::dialogs::XExecutableDialog 52 , public ::com::sun::star::lang::XServiceInfo 53 , public ::com::sun::star::lang::XInitialization 54 , public ::com::sun::star::frame::XTerminateListener 55 , public ::com::sun::star::beans::XPropertySet 56 { 57 public: 58 CreationWizardUnoDlg( const ::com::sun::star::uno::Reference< 59 ::com::sun::star::uno::XComponentContext >& xContext ); 60 virtual ~CreationWizardUnoDlg(); 61 62 // XInterface 63 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 64 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException); 65 virtual void SAL_CALL acquire() throw (); 66 virtual void SAL_CALL release() throw (); 67 68 // XTypeProvider 69 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); 70 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); 71 72 // XServiceInfo 73 APPHELPER_XSERVICEINFO_DECL() 74 APPHELPER_SERVICE_FACTORY_HELPER(CreationWizardUnoDlg) 75 76 // XExecutableDialog 77 virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException); 78 virtual sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException); 79 80 // XInitialization 81 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); 82 83 // XTerminateListener 84 virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); 85 virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); 86 87 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 88 89 //XPropertySet 90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); 91 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); 92 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); 93 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); 94 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); 95 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); 96 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); 97 98 DECL_LINK( DialogEventHdl, VclWindowEvent* ); 99 100 protected: 101 // ____ OComponentHelper ____ 102 /// Called in dispose method after the listeners were notified. 103 virtual void SAL_CALL disposing(); 104 105 private: 106 //no default constructor 107 CreationWizardUnoDlg(); 108 void createDialogOnDemand(); 109 110 private: 111 ::com::sun::star::uno::Reference< 112 ::com::sun::star::frame::XModel > m_xChartModel; 113 ::com::sun::star::uno::Reference< 114 ::com::sun::star::uno::XComponentContext> m_xCC; 115 com::sun::star::uno::Reference< 116 com::sun::star::awt::XWindow > m_xParentWindow; 117 118 CreationWizard* m_pDialog; 119 sal_Bool m_bUnlockControllersOnExecute; 120 }; 121 122 //............................................................................. 123 } //namespace chart 124 //............................................................................. 125 #endif 126