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 _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_ 29 #define _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_ 30 31 #include <svtools/genericunodialog.hxx> 32 #include <comphelper/proparrhlp.hxx> 33 #include "componentmodule.hxx" 34 #include <cppuhelper/typeprovider.hxx> 35 #include <com/sun/star/beans/XPropertySet.hpp> 36 #include <com/sun/star/beans/PropertyValue.hpp> 37 38 //......................................................................... 39 namespace dbp 40 { 41 //......................................................................... 42 43 //===================================================================== 44 //= IServiceInfo 45 //===================================================================== 46 /** interface for the SERVICEINFO template parameter of the OUnoAutoPilot class 47 */ 48 struct IServiceInfo 49 { 50 public: 51 ::rtl::OUString getImplementationName() const; 52 ::com::sun::star::uno::Sequence< ::rtl::OUString > 53 getServiceNames() const; 54 }; 55 56 //===================================================================== 57 //= OUnoAutoPilot 58 //===================================================================== 59 typedef ::svt::OGenericUnoDialog OUnoAutoPilot_Base; 60 template <class TYPE, class SERVICEINFO> 61 class OUnoAutoPilot 62 :public OUnoAutoPilot_Base 63 ,public ::comphelper::OPropertyArrayUsageHelper< OUnoAutoPilot< TYPE, SERVICEINFO > > 64 ,public OModuleResourceClient 65 { 66 OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); 67 68 protected: 69 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 70 m_xObjectModel; 71 72 public: 73 // XTypeProvider 74 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 75 76 // XServiceInfo 77 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); 78 virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 79 80 // XServiceInfo - static methods 81 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 82 static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 83 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 84 SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&); 85 86 // XPropertySet 87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); 88 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 89 90 // OPropertyArrayUsageHelper 91 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; 92 93 protected: 94 // OGenericUnoDialog overridables 95 virtual Dialog* createDialog(Window* _pParent); 96 virtual void implInitialize(const com::sun::star::uno::Any& _rValue); 97 }; 98 99 #include "unoautopilot.inl" 100 101 //......................................................................... 102 } // namespace dbp 103 //......................................................................... 104 105 #endif // _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_ 106 107