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_WALLPAPERPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/primitivetools2d.hxx>
35 : : #include <vcl/bitmapex.hxx>
36 : : #include <vcl/wall.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : :
40 : : namespace drawinglayer
41 : : {
42 : : namespace primitive2d
43 : : {
44 : : /** WallpaperBitmapPrimitive2D class
45 : :
46 : : This is a specialized primtive for the Wallpaper definitions included in
47 : : VCL and Metafiles. The extraordinary about the bitmap definition part of
48 : : the Wallpaper is that it uses PIXEL size of the given Bitmap and not
49 : : the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
50 : : To emulate this, a ViewTransformation dependent primitive is needed which
51 : : takes over the correct scaling(s).
52 : :
53 : : Since a specialized primitive is needed anyways, i opted to also add the
54 : : layouting which is dependent from WallpaperStyle; thus it does not need
55 : : to be handled anywhere else in the future.
56 : : */
57 [ # # ][ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC WallpaperBitmapPrimitive2D : public ViewTransformationDependentPrimitive2D
58 : : {
59 : : private:
60 : : basegfx::B2DRange maObjectRange;
61 : : BitmapEx maBitmapEx;
62 : : WallpaperStyle meWallpaperStyle;
63 : :
64 : : protected:
65 : : /// create local decomposition
66 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
67 : :
68 : : public:
69 : : /// constructor
70 : : WallpaperBitmapPrimitive2D(
71 : : const basegfx::B2DRange& rObjectRange,
72 : : const BitmapEx& rBitmapEx,
73 : : WallpaperStyle eWallpaperStyle);
74 : :
75 : : /// data read access
76 : 0 : const basegfx::B2DRange& getLocalObjectRange() const { return maObjectRange; }
77 : 0 : const BitmapEx& getBitmapEx() const { return maBitmapEx ; }
78 : 0 : WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; }
79 : :
80 : : /// compare operator
81 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
82 : :
83 : : /// get B2Drange
84 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
85 : :
86 : : /// provide unique ID
87 : : DeclPrimitrive2DIDBlock()
88 : : };
89 : : } // end of namespace primitive2d
90 : : } // end of namespace drawinglayer
91 : :
92 : : //////////////////////////////////////////////////////////////////////////////
93 : :
94 : : #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
95 : :
96 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|