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_MEDIAPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : : #include <basegfx/color/bcolor.hxx>
37 : : #include <vcl/graph.hxx>
38 : :
39 : : //////////////////////////////////////////////////////////////////////////////
40 : :
41 : : namespace drawinglayer
42 : : {
43 : : namespace primitive2d
44 : : {
45 : : /** MediaPrimitive2D class
46 : :
47 : : This is a unified primitive for Media visualisation, e.g. animations
48 : : or sounds. It's geometry is defined by Transform. For conveinience,
49 : : it also contains a discrete border size (aka Pixels) which will be added
50 : : if used. This makes it a view-dependent primitive. It also gets a filled
51 : : background and the decomposition will try to create a graphic representation
52 : : if te content (defined by the URL), e.g. a still frome for animated stuff.
53 : : */
54 [ # # ][ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC MediaPrimitive2D : public BufferedDecompositionPrimitive2D
[ # # ]
55 : : {
56 : : private:
57 : : /// the geometry definition
58 : : basegfx::B2DHomMatrix maTransform;
59 : :
60 : : /// the content definition
61 : : rtl::OUString maURL;
62 : :
63 : : /// style: background color
64 : : basegfx::BColor maBackgroundColor;
65 : :
66 : : /// discrete border (in 'pixels')
67 : : sal_uInt32 mnDiscreteBorder;
68 : :
69 : : const Graphic maSnapshot;
70 : :
71 : : protected:
72 : : /// local decomposition
73 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
74 : :
75 : : public:
76 : : /// constructor
77 : : MediaPrimitive2D(
78 : : const basegfx::B2DHomMatrix& rTransform,
79 : : const rtl::OUString& rURL,
80 : : const basegfx::BColor& rBackgroundColor,
81 : : sal_uInt32 nDiscreteBorder,
82 : : const Graphic &rSnapshot);
83 : :
84 : : /// data read access
85 : 0 : const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
86 : 0 : const rtl::OUString& getURL() const { return maURL; }
87 : 0 : const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
88 : 0 : sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
89 : :
90 : : /// compare operator
91 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
92 : :
93 : : /// get range
94 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
95 : :
96 : : /// provide unique ID
97 : : DeclPrimitrive2DIDBlock()
98 : : };
99 : : } // end of namespace primitive2d
100 : : } // end of namespace drawinglayer
101 : :
102 : : //////////////////////////////////////////////////////////////////////////////
103 : :
104 : : #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX
105 : :
106 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|