Branch libreoffice-5-0-4
[LibreOffice.git] / cppcanvas / source / uno / uno_mtfrenderer.hxx
blob821cf4fbcb515c5291d7cdcd15d41027619262c7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_CPPCANVAS_SOURCE_UNO_UNO_MTFRENDERER_HXX
11 #define INCLUDED_CPPCANVAS_SOURCE_UNO_UNO_MTFRENDERER_HXX
12 #include <com/sun/star/rendering/MtfRenderer.hpp>
13 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
14 #include <com/sun/star/uno/XComponentContext.hpp>
15 #include <com/sun/star/beans/XFastPropertySet.hpp>
16 #include <cppuhelper/compbase2.hxx>
17 #include <cppuhelper/basemutex.hxx>
18 #include <vcl/gdimtf.hxx>
20 typedef cppu::WeakComponentImplHelper2<com::sun::star::rendering::XMtfRenderer, com::sun::star::beans::XFastPropertySet> MtfRendererBase;
22 class MtfRenderer : private cppu::BaseMutex, public MtfRendererBase
24 public:
25 MtfRenderer (com::sun::star::uno::Sequence<com::sun::star::uno::Any> const& args,
26 com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&);
28 // XMtfRenderer iface
29 void SAL_CALL setMetafile (const ::com::sun::star::uno::Sequence< sal_Int8 >& rMtf) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
30 void SAL_CALL draw (double fScaleX, double fScaleY) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
32 // XFastPropertySet
33 // setFastPropertyValue (0, GDIMetaFile*) is used to speedup the rendering
34 virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 /*nHandle*/) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { return ::com::sun::star::uno::Any(); }
35 virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const ::com::sun::star::uno::Any&) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
37 private:
38 GDIMetaFile* mpMetafile;
39 com::sun::star::uno::Reference<com::sun::star::rendering::XBitmapCanvas> mxCanvas;
42 #endif
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */