xref: /aoo4110/main/filter/source/pdf/pdffilter.hxx (revision b1cdbd2c)
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 PDFFILTER_HXX
25 #define PDFFILTER_HXX
26 
27 #include <com/sun/star/document/XFilter.hpp>
28 #include <com/sun/star/document/XExporter.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/lang/XComponent.hpp>
33 #include <cppuhelper/implbase1.hxx>
34 #include <cppuhelper/implbase2.hxx>
35 #include <cppuhelper/implbase3.hxx>
36 #include <cppuhelper/implbase4.hxx>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/beans/XPropertyAccess.hpp>
39 #include <comphelper/property.hxx>
40 #include <com/sun/star/task/XStatusIndicator.hpp>
41 #include <com/sun/star/task/XInteractionHandler.hpp>
42 
43 #include <osl/diagnose.h>
44 #include <rtl/process.h>
45 #include <tools/debug.hxx>
46 #include <comphelper/processfactory.hxx>
47 #include <unotools/tempfile.hxx>
48 #include <unotools/localfilehelper.hxx>
49 #include <unotools/ucbstreamhelper.hxx>
50 #include <unotools/streamwrap.hxx>
51 
52 using namespace ::rtl;
53 using namespace ::com::sun::star;
54 using namespace ::com::sun::star::uno;
55 using namespace ::com::sun::star::lang;
56 using namespace ::com::sun::star::beans;
57 using namespace ::com::sun::star::document;
58 using namespace ::com::sun::star::io;
59 
60 // -------------
61 // - PDFFilter -
62 // -------------
63 
64 class PDFFilter : public cppu::WeakImplHelper4 < XFilter,
65                                                  XExporter,
66 												 XInitialization,
67 												 XServiceInfo >
68 {
69 private:
70 
71 	Reference< XMultiServiceFactory >	mxMSF;
72 	Reference< XComponent >				mxSrcDoc;
73 
74     sal_Bool                            implExport( const Sequence< PropertyValue >& rDescriptor );
75 
76 protected:
77 
78 	// XFilter
79     virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) throw(RuntimeException);
80     virtual void SAL_CALL cancel( ) throw (RuntimeException);
81 
82 	// XExporter
83     virtual void SAL_CALL setSourceDocument( const Reference< XComponent >& xDoc ) throw(IllegalArgumentException, RuntimeException);
84 
85 	// XInitialization
86     virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException);
87 
88 	// XServiceInfo
89     virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
90     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
91     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()  throw(RuntimeException);
92 
93 public:
94 
95 				PDFFilter( const Reference< XMultiServiceFactory >& rxMSF );
96 	virtual		~PDFFilter();
97 };
98 
99 // -----------------------------------------------------------------------------
100 
101 OUString PDFFilter_getImplementationName ()
102 	throw ( RuntimeException );
103 
104 // -----------------------------------------------------------------------------
105 
106 sal_Bool SAL_CALL PDFFilter_supportsService( const OUString& ServiceName )
107 	throw ( RuntimeException );
108 
109 // -----------------------------------------------------------------------------
110 
111 Sequence< OUString > SAL_CALL PDFFilter_getSupportedServiceNames(  )
112 	throw ( RuntimeException );
113 
114 // -----------------------------------------------------------------------------
115 
116 Reference< XInterface >
117 SAL_CALL PDFFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
118 	throw ( Exception );
119 
120 #endif // PDFFILTER_HXX
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131