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 _RTFIMPORTFILTER_HXX_ 25 #define _RTFIMPORTFILTER_HXX_ 26 27 #include <com/sun/star/document/XFilter.hpp> 28 #include <com/sun/star/document/XImporter.hpp> 29 #include <com/sun/star/uno/XComponentContext.hpp> 30 #include <cppuhelper/implbase2.hxx> 31 #include <tools/stream.hxx> 32 #include <shellio.hxx> 33 34 /// The physical access to the RTF document (for reading). 35 class RtfImportFilter : public cppu::WeakImplHelper2 36 < 37 com::sun::star::document::XFilter, 38 com::sun::star::document::XImporter 39 > 40 { 41 protected: 42 ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; 43 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xDstDoc; 44 public: 45 RtfImportFilter( const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); 46 virtual ~RtfImportFilter(); 47 48 // XFilter 49 virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) 50 throw (::com::sun::star::uno::RuntimeException); 51 virtual void SAL_CALL cancel( ) 52 throw (::com::sun::star::uno::RuntimeException); 53 54 // XImporter 55 virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) 56 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 57 }; 58 59 ::rtl::OUString RtfImport_getImplementationName(); 60 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RtfImport_getSupportedServiceNames() 61 throw(); 62 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL RtfImport_createInstance( 63 const ::com::sun::star::uno::Reference< 64 com::sun::star::lang::XMultiServiceFactory > &xMSF) 65 throw( ::com::sun::star::uno::Exception ); 66 67 #define IMPL_NAME_RTFIMPORT "com.sun.star.comp.Writer.RtfImport" 68 69 #endif // _RTFIMPORTFILTER_HXX_ 70 /* vi:set shiftwidth=4 expandtab: */ 71