1*4f506f19SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*4f506f19SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*4f506f19SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*4f506f19SAndrew Rist * distributed with this work for additional information 6*4f506f19SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*4f506f19SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*4f506f19SAndrew Rist * "License"); you may not use this file except in compliance 9*4f506f19SAndrew Rist * with the License. You may obtain a copy of the License at 10*4f506f19SAndrew Rist * 11*4f506f19SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*4f506f19SAndrew Rist * 13*4f506f19SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*4f506f19SAndrew Rist * software distributed under the License is distributed on an 15*4f506f19SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*4f506f19SAndrew Rist * KIND, either express or implied. See the License for the 17*4f506f19SAndrew Rist * specific language governing permissions and limitations 18*4f506f19SAndrew Rist * under the License. 19*4f506f19SAndrew Rist * 20*4f506f19SAndrew Rist *************************************************************/ 21*4f506f19SAndrew Rist 22*4f506f19SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX 25cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX 26cdf0e10cSrcweir 27090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h> 28cdf0e10cSrcweir #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 29cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx> 30cdf0e10cSrcweir #include <basegfx/color/bcolor.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace drawinglayer 35cdf0e10cSrcweir { 36cdf0e10cSrcweir namespace primitive2d 37cdf0e10cSrcweir { 38cdf0e10cSrcweir /** MediaPrimitive2D class 39cdf0e10cSrcweir 40cdf0e10cSrcweir This is a unified primitive for Media visualisation, e.g. animations 41cdf0e10cSrcweir or sounds. It's geometry is defined by Transform. For conveinience, 42cdf0e10cSrcweir it also contains a discrete border size (aka Pixels) which will be added 43cdf0e10cSrcweir if used. This makes it a view-dependent primitive. It also gets a filled 44cdf0e10cSrcweir background and the decomposition will try to create a graphic representation 45cdf0e10cSrcweir if te content (defined by the URL), e.g. a still frome for animated stuff. 46cdf0e10cSrcweir */ 47090f0eb8SEike Rathke class DRAWINGLAYER_DLLPUBLIC MediaPrimitive2D : public BufferedDecompositionPrimitive2D 48cdf0e10cSrcweir { 49cdf0e10cSrcweir private: 50cdf0e10cSrcweir /// the geometry definition 51cdf0e10cSrcweir basegfx::B2DHomMatrix maTransform; 52cdf0e10cSrcweir 53cdf0e10cSrcweir /// the content definition 54cdf0e10cSrcweir rtl::OUString maURL; 55cdf0e10cSrcweir 56cdf0e10cSrcweir /// style: background color 57cdf0e10cSrcweir basegfx::BColor maBackgroundColor; 58cdf0e10cSrcweir 59cdf0e10cSrcweir /// discrete border (in 'pixels') 60cdf0e10cSrcweir sal_uInt32 mnDiscreteBorder; 61cdf0e10cSrcweir 62cdf0e10cSrcweir protected: 63cdf0e10cSrcweir /// local decomposition 64cdf0e10cSrcweir virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 65cdf0e10cSrcweir 66cdf0e10cSrcweir public: 67cdf0e10cSrcweir /// constructor 68cdf0e10cSrcweir MediaPrimitive2D( 69cdf0e10cSrcweir const basegfx::B2DHomMatrix& rTransform, 70cdf0e10cSrcweir const rtl::OUString& rURL, 71cdf0e10cSrcweir const basegfx::BColor& rBackgroundColor, 72cdf0e10cSrcweir sal_uInt32 nDiscreteBorder); 73cdf0e10cSrcweir 74cdf0e10cSrcweir /// data read access getTransform() const75cdf0e10cSrcweir const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } getURL() const76cdf0e10cSrcweir const rtl::OUString& getURL() const { return maURL; } getBackgroundColor() const77cdf0e10cSrcweir const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; } getDiscreteBorder() const78cdf0e10cSrcweir sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; } 79cdf0e10cSrcweir 80cdf0e10cSrcweir /// compare operator 81cdf0e10cSrcweir virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 82cdf0e10cSrcweir 83cdf0e10cSrcweir /// get range 84cdf0e10cSrcweir virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; 85cdf0e10cSrcweir 86cdf0e10cSrcweir /// provide unique ID 87cdf0e10cSrcweir DeclPrimitrive2DIDBlock() 88cdf0e10cSrcweir }; 89cdf0e10cSrcweir } // end of namespace primitive2d 90cdf0e10cSrcweir } // end of namespace drawinglayer 91cdf0e10cSrcweir 92cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 93cdf0e10cSrcweir 94cdf0e10cSrcweir #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MEDIAPRIMITIVE2D_HXX 95cdf0e10cSrcweir 96cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 97cdf0e10cSrcweir // eof 98