Bump version to 5.0-14
[LibreOffice.git] / cppcanvas / source / wrapper / implspritecanvas.hxx
blob76652d323ceb139179f131f2d9430692fca85942
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/.
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 INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLSPRITECANVAS_HXX
21 #define INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLSPRITECANVAS_HXX
23 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
24 #include <basegfx/vector/b2dsize.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
27 #include <boost/shared_ptr.hpp>
30 #include <cppcanvas/spritecanvas.hxx>
32 #include <implcanvas.hxx>
35 namespace cppcanvas
37 namespace internal
39 class ImplSpriteCanvas : public virtual SpriteCanvas, protected virtual ImplCanvas
41 public:
42 ImplSpriteCanvas( const ::com::sun::star::uno::Reference<
43 ::com::sun::star::rendering::XSpriteCanvas >& rCanvas );
44 ImplSpriteCanvas(const ImplSpriteCanvas&);
46 virtual ~ImplSpriteCanvas();
48 virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) SAL_OVERRIDE;
50 virtual bool updateScreen( bool bUpdateAll ) const SAL_OVERRIDE;
52 virtual CustomSpriteSharedPtr createCustomSprite( const ::basegfx::B2DSize& ) const SAL_OVERRIDE;
53 virtual SpriteSharedPtr createClonedSprite( const SpriteSharedPtr& ) const SAL_OVERRIDE;
55 virtual CanvasSharedPtr clone() const SAL_OVERRIDE;
57 virtual ::com::sun::star::uno::Reference<
58 ::com::sun::star::rendering::XSpriteCanvas > getUNOSpriteCanvas() const SAL_OVERRIDE;
60 /** This class passes the view transformation
61 to child sprites
63 This helper class is necessary, because the
64 ImplSpriteCanvas object cannot hand out shared ptrs of
65 itself, but has somehow pass an object to child
66 sprites those can query for the canvas' view transform.
68 class TransformationArbiter
70 public:
71 TransformationArbiter();
73 void setTransformation( const ::basegfx::B2DHomMatrix& rViewTransform );
74 ::basegfx::B2DHomMatrix getTransformation() const { return maTransformation; }
76 private:
77 ::basegfx::B2DHomMatrix maTransformation;
80 typedef ::boost::shared_ptr< TransformationArbiter > TransformationArbiterSharedPtr;
82 private:
83 ImplSpriteCanvas& operator=( const ImplSpriteCanvas& ) SAL_DELETED_FUNCTION;
85 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > mxSpriteCanvas;
86 TransformationArbiterSharedPtr mpTransformArbiter;
91 #endif // INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLSPRITECANVAS_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */