1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _GRAPHICEXPORTFILTER_HXX_
21 #define _GRAPHICEXPORTFILTER_HXX_
23 #include <com/sun/star/frame/Desktop.hpp>
24 #include <com/sun/star/document/XFilter.hpp>
25 #include <com/sun/star/document/XExporter.hpp>
26 #include <com/sun/star/lang/XInitialization.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
29 #include <com/sun/star/io/XOutputStream.hpp>
31 #include <cppuhelper/implbase3.hxx>
32 #include <comphelper/processfactory.hxx>
35 using namespace css::uno
;
36 using namespace css::lang
;
37 using namespace css::beans
;
38 using namespace css::document
;
40 class GraphicExportFilter
:
41 public cppu::WeakImplHelper3
< XFilter
, XExporter
, XInitialization
>
43 Reference
<XComponent
> mxDocument
;
44 Reference
<XComponentContext
> mxContext
;
45 Reference
<task::XStatusIndicator
> mxStatusIndicator
;
46 Reference
<io::XOutputStream
> mxOutputStream
;
48 void gatherProperties( const Sequence
<PropertyValue
>& rDescriptor
);
50 bool mExportSelection
;
51 OUString mFilterExtension
;
54 Sequence
<PropertyValue
> mFilterDataSequence
;
56 sal_Int32 mTargetWidth
;
57 sal_Int32 mTargetHeight
;
60 explicit GraphicExportFilter( const Reference
<XComponentContext
>& rxContext
);
61 virtual ~GraphicExportFilter();
64 virtual sal_Bool SAL_CALL
filter( const Sequence
<PropertyValue
>& rDescriptor
) throw(RuntimeException
);
65 virtual void SAL_CALL
cancel( ) throw (RuntimeException
);
68 virtual void SAL_CALL
setSourceDocument( const Reference
< XComponent
>& xDocument
) throw(IllegalArgumentException
, RuntimeException
);
71 virtual void SAL_CALL
initialize( const Sequence
<Any
>& aArguments
) throw(Exception
, RuntimeException
);
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */