Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / cppcanvas / source / wrapper / implspritecanvas.hxx
blob1999c5630ff07eb7a898137cb45ed784964d865c
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 _CPPCANVAS_IMPLSPRITECANVAS_HXX
21 #define _CPPCANVAS_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 );
50 virtual bool updateScreen( bool bUpdateAll ) const;
52 virtual CustomSpriteSharedPtr createCustomSprite( const ::basegfx::B2DSize& ) const;
53 virtual SpriteSharedPtr createClonedSprite( const SpriteSharedPtr& ) const;
55 virtual CanvasSharedPtr clone() const;
57 virtual ::com::sun::star::uno::Reference<
58 ::com::sun::star::rendering::XSpriteCanvas > getUNOSpriteCanvas() const;
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;
76 private:
77 ::basegfx::B2DHomMatrix maTransformation;
80 typedef ::boost::shared_ptr< TransformationArbiter > TransformationArbiterSharedPtr;
82 private:
83 // default: disabled assignment
84 ImplSpriteCanvas& operator=( const ImplSpriteCanvas& );
86 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > mxSpriteCanvas;
87 TransformationArbiterSharedPtr mpTransformArbiter;
92 #endif /* _CPPCANVAS_IMPLSPRITECANVAS_HXX */
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */