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_METAFILEPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : : #include <vcl/gdimtf.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : : // MetafilePrimitive2D class
40 : :
41 : : namespace drawinglayer
42 : : {
43 : : namespace primitive2d
44 : : {
45 : : /** MetafilePrimitive2D class
46 : :
47 : : This is the MetaFile representing primitive. It's geometry is defined
48 : : by MetaFileTransform. The content (defined by MetaFile) will be scaled
49 : : to the geometric definiton by using PrefMapMode and PrefSize of the
50 : : Metafile.
51 : :
52 : : It has shown that this not always guarantees that all Metafile content
53 : : is inside the geometric definition, but this primitive defines that this
54 : : is the case to allow a getB2DRange implementation. If it cannot be
55 : : guaranteed that the Metafile is inside the geometric definition, it should
56 : : be embedded to a MaskPrimitive2D.
57 : :
58 : : This primitive has no decomposition yet, so when not supported by a renderer,
59 : : it will not be visualized.
60 : :
61 : : In the future, a decomposition implementation would be appreciated and would
62 : : have many advantages; Metafile would no longer have to be rendered by
63 : : sub-systems and a standard way for converting Metafiles would exist.
64 : : */
65 [ + - ][ + - ]: 130 : class DRAWINGLAYER_DLLPUBLIC MetafilePrimitive2D : public BufferedDecompositionPrimitive2D
[ - + ]
66 : : {
67 : : private:
68 : : /// the geometry definition
69 : : basegfx::B2DHomMatrix maMetaFileTransform;
70 : :
71 : : /// the content definition
72 : : GDIMetaFile maMetaFile;
73 : :
74 : : protected:
75 : : /// local decomposition.
76 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
77 : : public:
78 : : /// constructor
79 : : MetafilePrimitive2D(
80 : : const basegfx::B2DHomMatrix& rMetaFileTransform,
81 : : const GDIMetaFile& rMetaFile);
82 : :
83 : : /// data read access
84 : 64 : const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; }
85 : 325 : const GDIMetaFile& getMetaFile() const { return maMetaFile; }
86 : :
87 : : /// compare operator
88 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
89 : :
90 : : /// get range
91 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
92 : :
93 : : /// provide unique ID
94 : : DeclPrimitrive2DIDBlock()
95 : : };
96 : : } // end of namespace primitive2d
97 : : } // end of namespace drawinglayer
98 : :
99 : : //////////////////////////////////////////////////////////////////////////////
100 : :
101 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_METAFILEPRIMITIVE2D_HXX
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|