xref: /aoo41x/main/vcl/inc/vcl/wall.hxx (revision 45fd3b9a)
10d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
30d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50d63794cSAndrew Rist  * distributed with this work for additional information
60d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
80d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
90d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
100d63794cSAndrew Rist  *
110d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
120d63794cSAndrew Rist  *
130d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
140d63794cSAndrew Rist  * software distributed under the License is distributed on an
150d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
170d63794cSAndrew Rist  * specific language governing permissions and limitations
180d63794cSAndrew Rist  * under the License.
190d63794cSAndrew Rist  *
200d63794cSAndrew Rist  *************************************************************/
210d63794cSAndrew Rist 
220d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_WALL_HXX
25cdf0e10cSrcweir #define _SV_WALL_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/sv.h>
28cdf0e10cSrcweir #include <vcl/dllapi.h>
29cdf0e10cSrcweir #include <tools/color.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class Rectangle;
32cdf0e10cSrcweir class Gradient;
33cdf0e10cSrcweir class BitmapEx;
34cdf0e10cSrcweir class ImplWallpaper;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // -------------------
37cdf0e10cSrcweir // - Wallpaper-Types -
38cdf0e10cSrcweir // -------------------
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #define	WALLPAPER_NULL 					WallpaperStyle_NULL
41cdf0e10cSrcweir #define	WALLPAPER_TILE					WallpaperStyle_TILE
42cdf0e10cSrcweir #define	WALLPAPER_CENTER				WallpaperStyle_CENTER
43cdf0e10cSrcweir #define	WALLPAPER_SCALE					WallpaperStyle_SCALE
44cdf0e10cSrcweir #define	WALLPAPER_TOPLEFT				WallpaperStyle_TOPLEFT
45cdf0e10cSrcweir #define	WALLPAPER_TOP					WallpaperStyle_TOP
46cdf0e10cSrcweir #define	WALLPAPER_TOPRIGHT				WallpaperStyle_TOPRIGHT
47cdf0e10cSrcweir #define	WALLPAPER_LEFT					WallpaperStyle_LEFT
48cdf0e10cSrcweir #define	WALLPAPER_RIGHT					WallpaperStyle_RIGHT
49cdf0e10cSrcweir #define	WALLPAPER_BOTTOMLEFT			WallpaperStyle_BOTTOMLEFT
50cdf0e10cSrcweir #define	WALLPAPER_BOTTOM				WallpaperStyle_BOTTOM
51cdf0e10cSrcweir #define	WALLPAPER_BOTTOMRIGHT			WallpaperStyle_BOTTOMRIGHT
52cdf0e10cSrcweir #define	WALLPAPER_APPLICATIONGRADIENT	WallpaperStyle_APPLICATIONGRADIENT
53cdf0e10cSrcweir #define	WALLPAPER_FORCE_EQUAL_SIZE		WallpaperStyle_FORCE_EQUAL_SIZE
54cdf0e10cSrcweir 
55cdf0e10cSrcweir #ifndef ENUM_WALLPAPERSTYLE_DECLARED
56cdf0e10cSrcweir #define ENUM_WALLPAPERSTYLE_DECLARED
57cdf0e10cSrcweir 
58cdf0e10cSrcweir enum WallpaperStyle
59cdf0e10cSrcweir {
60cdf0e10cSrcweir 	WALLPAPER_NULL,
61cdf0e10cSrcweir 	WALLPAPER_TILE,
62cdf0e10cSrcweir 	WALLPAPER_CENTER,
63cdf0e10cSrcweir 	WALLPAPER_SCALE,
64cdf0e10cSrcweir 	WALLPAPER_TOPLEFT,
65cdf0e10cSrcweir 	WALLPAPER_TOP,
66cdf0e10cSrcweir 	WALLPAPER_TOPRIGHT,
67cdf0e10cSrcweir 	WALLPAPER_LEFT,
68cdf0e10cSrcweir 	WALLPAPER_RIGHT,
69cdf0e10cSrcweir 	WALLPAPER_BOTTOMLEFT,
70cdf0e10cSrcweir 	WALLPAPER_BOTTOM,
71cdf0e10cSrcweir 	WALLPAPER_BOTTOMRIGHT,
72cdf0e10cSrcweir 	WALLPAPER_APPLICATIONGRADIENT,          // defines a gradient that internally covers the whole application
73cdf0e10cSrcweir                                             // and uses a color derived from the face color
74cdf0e10cSrcweir 	WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
75cdf0e10cSrcweir };
76cdf0e10cSrcweir 
77cdf0e10cSrcweir #endif
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // -------------
80cdf0e10cSrcweir // - Wallpaper -
81cdf0e10cSrcweir // -------------
82cdf0e10cSrcweir 
83cdf0e10cSrcweir class VCL_DLLPUBLIC Wallpaper
84cdf0e10cSrcweir {
85cdf0e10cSrcweir private:
86cdf0e10cSrcweir 	ImplWallpaper*	mpImplWallpaper;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	SAL_DLLPRIVATE void			  ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
89cdf0e10cSrcweir     SAL_DLLPRIVATE Gradient       ImplGetApplicationGradient() const;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
92cdf0e10cSrcweir public:
ImplGetImpWallpaper() const93cdf0e10cSrcweir 	SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
94cdf0e10cSrcweir //#endif
95cdf0e10cSrcweir 
96cdf0e10cSrcweir public:
97cdf0e10cSrcweir 					Wallpaper();
98cdf0e10cSrcweir 					Wallpaper( const Wallpaper& rWallpaper );
99cdf0e10cSrcweir 					Wallpaper( const Color& rColor );
100*45fd3b9aSArmin Le Grand 					explicit Wallpaper( const BitmapEx& rBmpEx );
101cdf0e10cSrcweir 					Wallpaper( const Gradient& rGradient );
102cdf0e10cSrcweir 					~Wallpaper();
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	void			SetColor( const Color& rColor );
105cdf0e10cSrcweir 	const Color&	GetColor() const;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	void			SetStyle( WallpaperStyle eStyle );
108cdf0e10cSrcweir 	WallpaperStyle	GetStyle() const;
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	void			SetBitmap( const BitmapEx& rBitmap );
111cdf0e10cSrcweir 	void			SetBitmap();
112cdf0e10cSrcweir 	BitmapEx		GetBitmap() const;
113cdf0e10cSrcweir 	sal_Bool			IsBitmap() const;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	void			SetGradient( const Gradient& rGradient );
116cdf0e10cSrcweir 	void			SetGradient();
117cdf0e10cSrcweir 	Gradient		GetGradient() const;
118cdf0e10cSrcweir 	sal_Bool			IsGradient() const;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	void			SetRect( const Rectangle& rRect );
121cdf0e10cSrcweir 	void			SetRect();
122cdf0e10cSrcweir 	Rectangle		GetRect() const;
123cdf0e10cSrcweir 	sal_Bool			IsRect() const;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	sal_Bool			IsFixed() const;
126cdf0e10cSrcweir 	sal_Bool			IsScrollable() const;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	Wallpaper&		operator=( const Wallpaper& rWallpaper );
129cdf0e10cSrcweir 	sal_Bool			operator==( const Wallpaper& rWallpaper ) const;
operator !=(const Wallpaper & rWallpaper) const130cdf0e10cSrcweir 	sal_Bool			operator!=( const Wallpaper& rWallpaper ) const
131cdf0e10cSrcweir 						{ return !(Wallpaper::operator==( rWallpaper )); }
IsSameInstance(const Wallpaper & rWallpaper) const132cdf0e10cSrcweir 	sal_Bool			IsSameInstance( const Wallpaper& rWallpaper ) const
133cdf0e10cSrcweir 						{ return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
136cdf0e10cSrcweir 	friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper );
137cdf0e10cSrcweir };
138cdf0e10cSrcweir 
139cdf0e10cSrcweir #endif	// _SV_WALL_HXX
140