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 _SV_WALL_HXX
30 : : #define _SV_WALL_HXX
31 : :
32 : : #include <tools/solar.h>
33 : : #include <vcl/dllapi.h>
34 : : #include <tools/color.hxx>
35 : :
36 : : class Rectangle;
37 : : class Gradient;
38 : : class BitmapEx;
39 : : class ImplWallpaper;
40 : :
41 : : // -------------------
42 : : // - Wallpaper-Types -
43 : : // -------------------
44 : :
45 : : #define WALLPAPER_NULL WallpaperStyle_NULL
46 : : #define WALLPAPER_TILE WallpaperStyle_TILE
47 : : #define WALLPAPER_CENTER WallpaperStyle_CENTER
48 : : #define WALLPAPER_SCALE WallpaperStyle_SCALE
49 : : #define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
50 : : #define WALLPAPER_TOP WallpaperStyle_TOP
51 : : #define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
52 : : #define WALLPAPER_LEFT WallpaperStyle_LEFT
53 : : #define WALLPAPER_RIGHT WallpaperStyle_RIGHT
54 : : #define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
55 : : #define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
56 : : #define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
57 : : #define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
58 : : #define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
59 : :
60 : : #ifndef ENUM_WALLPAPERSTYLE_DECLARED
61 : : #define ENUM_WALLPAPERSTYLE_DECLARED
62 : :
63 : : enum WallpaperStyle
64 : : {
65 : : WALLPAPER_NULL,
66 : : WALLPAPER_TILE,
67 : : WALLPAPER_CENTER,
68 : : WALLPAPER_SCALE,
69 : : WALLPAPER_TOPLEFT,
70 : : WALLPAPER_TOP,
71 : : WALLPAPER_TOPRIGHT,
72 : : WALLPAPER_LEFT,
73 : : WALLPAPER_RIGHT,
74 : : WALLPAPER_BOTTOMLEFT,
75 : : WALLPAPER_BOTTOM,
76 : : WALLPAPER_BOTTOMRIGHT,
77 : : WALLPAPER_APPLICATIONGRADIENT, // defines a gradient that internally covers the whole application
78 : : // and uses a color derived from the face color
79 : : WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
80 : : };
81 : :
82 : : #endif
83 : :
84 : : // -------------
85 : : // - Wallpaper -
86 : : // -------------
87 : :
88 : : class VCL_DLLPUBLIC Wallpaper
89 : : {
90 : : private:
91 : : ImplWallpaper* mpImplWallpaper;
92 : :
93 : : SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
94 : : SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
95 : :
96 : : public:
97 : 0 : SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
98 : :
99 : :
100 : : public:
101 : : Wallpaper();
102 : : Wallpaper( const Wallpaper& rWallpaper );
103 : : Wallpaper( const Color& rColor );
104 : : Wallpaper( const BitmapEx& rBmpEx );
105 : : Wallpaper( const Gradient& rGradient );
106 : : ~Wallpaper();
107 : :
108 : : void SetColor( const Color& rColor );
109 : : const Color& GetColor() const;
110 : :
111 : : void SetStyle( WallpaperStyle eStyle );
112 : : WallpaperStyle GetStyle() const;
113 : :
114 : : void SetBitmap( const BitmapEx& rBitmap );
115 : : BitmapEx GetBitmap() const;
116 : : sal_Bool IsBitmap() const;
117 : :
118 : : void SetGradient( const Gradient& rGradient );
119 : : Gradient GetGradient() const;
120 : : sal_Bool IsGradient() const;
121 : :
122 : : void SetRect( const Rectangle& rRect );
123 : : Rectangle GetRect() const;
124 : : sal_Bool IsRect() const;
125 : :
126 : : sal_Bool IsFixed() const;
127 : : sal_Bool IsScrollable() const;
128 : :
129 : : Wallpaper& operator=( const Wallpaper& rWallpaper );
130 : : sal_Bool operator==( const Wallpaper& rWallpaper ) const;
131 : 0 : sal_Bool operator!=( const Wallpaper& rWallpaper ) const
132 : 0 : { return !(Wallpaper::operator==( rWallpaper )); }
133 : : sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
134 : : { return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
135 : :
136 : : friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
137 : : friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper );
138 : : };
139 : :
140 : : #endif // _SV_WALL_HXX
141 : :
142 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|