nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / mediaprimitive2d.hxx
blob258652a854d5c894ce7750e54c03fe07f0107096
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 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
26 #include <basegfx/color/bcolor.hxx>
27 #include <vcl/graph.hxx>
30 namespace drawinglayer::primitive2d
32 /** MediaPrimitive2D class
34 This is a unified primitive for Media visualisation, e.g. animations
35 or sounds. It's geometry is defined by Transform. For convenience,
36 it also contains a discrete border size (aka Pixels) which will be added
37 if used. This makes it a view-dependent primitive. It also gets a filled
38 background and the decomposition will try to create a graphic representation
39 if the content (defined by the URL), e.g. a still frame for animated stuff.
41 class DRAWINGLAYER_DLLPUBLIC MediaPrimitive2D final : public BufferedDecompositionPrimitive2D
43 private:
44 /// the geometry definition
45 basegfx::B2DHomMatrix maTransform;
47 /// the content definition
48 OUString maURL;
50 /// style: background color
51 basegfx::BColor maBackgroundColor;
53 /// discrete border (in 'pixels')
54 sal_uInt32 mnDiscreteBorder;
56 const Graphic maSnapshot;
58 /// local decomposition
59 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
61 public:
62 /// constructor
63 MediaPrimitive2D(
64 const basegfx::B2DHomMatrix& rTransform,
65 const OUString& rURL,
66 const basegfx::BColor& rBackgroundColor,
67 sal_uInt32 nDiscreteBorder,
68 const Graphic &rSnapshot);
70 /// data read access
71 const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
72 const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
73 sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
75 /// compare operator
76 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
78 /// get range
79 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
81 /// provide unique ID
82 virtual sal_uInt32 getPrimitive2DID() const override;
84 } // end of namespace drawinglayer::primitive2d
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */