Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : : #include <svtools/grfmgr.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : :
40 : : namespace drawinglayer
41 : : {
42 : : namespace primitive2d
43 : : {
44 : : /** GraphicPrimitive2D class
45 : :
46 : : Primitive to hold graphics defined by GraphicObject and GraphicAttr
47 : : combination. This includes MetaFiles and diverse pixel-oriented graphic
48 : : formats. It even includes animated GIFs, Croppings and other changes
49 : : defined in GraphicAttr.
50 : :
51 : : This makes the decomposition contain a wide variety of possibilites,
52 : : too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
53 : : MetafilePrimitive2D (with and without embedding in a masking when e.g.
54 : : the Metafile is bigger than the geometry) and embeddings in
55 : : TransformPrimitive2D and MaskPrimitive2D for croppings.
56 : :
57 : : The primitive geometry area is defined by Transform.
58 : : */
59 [ + - ][ + - ]: 286 : class DRAWINGLAYER_DLLPUBLIC GraphicPrimitive2D : public BufferedDecompositionPrimitive2D
[ + - ][ - + ]
60 : : {
61 : : private:
62 : : /// the geometric definition
63 : : basegfx::B2DHomMatrix maTransform;
64 : :
65 : : /// the GraphicObject with all it's content possibilities
66 : : GraphicObject maGraphicObject;
67 : :
68 : : /// The GraphicAttr with all it's modification possibilities
69 : : GraphicAttr maGraphicAttr;
70 : :
71 : : protected:
72 : : /// local decomposition
73 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
74 : :
75 : : public:
76 : : /// constructor(s)
77 : : GraphicPrimitive2D(
78 : : const basegfx::B2DHomMatrix& rTransform,
79 : : const GraphicObject& rGraphicObject,
80 : : const GraphicAttr& rGraphicAttr);
81 : :
82 : : /// data read access
83 : 191 : const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
84 : 80 : const GraphicObject& getGraphicObject() const { return maGraphicObject; }
85 : 320 : const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
86 : : bool isTransparent() const;
87 : :
88 : : /// compare operator
89 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
90 : :
91 : : /// get range
92 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
93 : :
94 : : /// provide unique ID
95 : : DeclPrimitrive2DIDBlock()
96 : : };
97 : : } // end of namespace primitive2d
98 : : } // end of namespace drawinglayer
99 : :
100 : : //////////////////////////////////////////////////////////////////////////////
101 : :
102 : : #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
103 : :
104 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|