build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / drawinglayer / primitive2d / graphicprimitive2d.hxx
blobf437fbda1667371fa0e2d6b934aa18c5d2f44b84
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_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
27 #include <svtools/grfmgr.hxx>
30 namespace drawinglayer
32 namespace primitive2d
34 /** GraphicPrimitive2D class
36 Primitive to hold graphics defined by GraphicObject and GraphicAttr
37 combination. This includes MetaFiles and diverse pixel-oriented graphic
38 formats. It even includes animated GIFs, Croppings and other changes
39 defined in GraphicAttr.
41 This makes the decomposition contain a wide variety of possibilites,
42 too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
43 MetafilePrimitive2D (with and without embedding in a masking when e.g.
44 the Metafile is bigger than the geometry) and embeddings in
45 TransformPrimitive2D and MaskPrimitive2D for croppings.
47 The primitive geometry area is defined by Transform.
49 class DRAWINGLAYER_DLLPUBLIC GraphicPrimitive2D : public BufferedDecompositionPrimitive2D
51 private:
52 /// the geometric definition
53 basegfx::B2DHomMatrix maTransform;
55 /// the GraphicObject with all its content possibilities
56 GraphicObject maGraphicObject;
58 /// The GraphicAttr with all its modification possibilities
59 GraphicAttr maGraphicAttr;
61 protected:
62 /// local decomposition
63 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
65 public:
66 /// constructor(s)
67 GraphicPrimitive2D(
68 const basegfx::B2DHomMatrix& rTransform,
69 const GraphicObject& rGraphicObject,
70 const GraphicAttr& rGraphicAttr);
71 GraphicPrimitive2D(
72 const basegfx::B2DHomMatrix& rTransform,
73 const GraphicObject& rGraphicObject);
75 /// data read access
76 const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
77 const GraphicObject& getGraphicObject() const { return maGraphicObject; }
78 const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
80 /// compare operator
81 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
83 /// get range
84 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
86 /// provide unique ID
87 DeclPrimitive2DIDBlock()
89 } // end of namespace primitive2d
90 } // end of namespace drawinglayer
93 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GRAPHICPRIMITIVE2D_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */