Branch libreoffice-5-0-4
[LibreOffice.git] / include / vcl / wall.hxx
blobcc4a8366ba27a8a0dd47ac8f3520a673731f0b02
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_WALL_HXX
21 #define INCLUDED_VCL_WALL_HXX
23 #include <tools/color.hxx>
24 #include <tools/gen.hxx>
25 #include <vcl/dllapi.h>
27 class Gradient;
28 class BitmapEx;
29 class ImplWallpaper;
31 #define WALLPAPER_NULL WallpaperStyle_NULL
32 #define WALLPAPER_TILE WallpaperStyle_TILE
33 #define WALLPAPER_CENTER WallpaperStyle_CENTER
34 #define WALLPAPER_SCALE WallpaperStyle_SCALE
35 #define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
36 #define WALLPAPER_TOP WallpaperStyle_TOP
37 #define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
38 #define WALLPAPER_LEFT WallpaperStyle_LEFT
39 #define WALLPAPER_RIGHT WallpaperStyle_RIGHT
40 #define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
41 #define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
42 #define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
43 #define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
44 #define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
46 #ifndef ENUM_WALLPAPERSTYLE_DECLARED
47 #define ENUM_WALLPAPERSTYLE_DECLARED
49 enum WallpaperStyle
51 WALLPAPER_NULL,
52 WALLPAPER_TILE,
53 WALLPAPER_CENTER,
54 WALLPAPER_SCALE,
55 WALLPAPER_TOPLEFT,
56 WALLPAPER_TOP,
57 WALLPAPER_TOPRIGHT,
58 WALLPAPER_LEFT,
59 WALLPAPER_RIGHT,
60 WALLPAPER_BOTTOMLEFT,
61 WALLPAPER_BOTTOM,
62 WALLPAPER_BOTTOMRIGHT,
63 WALLPAPER_APPLICATIONGRADIENT, // defines a gradient that internally covers the whole application
64 // and uses a color derived from the face color
65 WALLPAPER_FORCE_EQUAL_SIZE = 0x7fffffff
68 #endif
70 class VCL_DLLPUBLIC Wallpaper
72 private:
73 ImplWallpaper* mpImplWallpaper;
75 SAL_DLLPRIVATE void ImplMakeUnique( bool bReleaseCache = true );
76 SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
78 public:
79 SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
82 public:
83 Wallpaper();
84 Wallpaper( const Wallpaper& rWallpaper );
85 Wallpaper( const Color& rColor );
86 explicit Wallpaper( const BitmapEx& rBmpEx );
87 Wallpaper( const Gradient& rGradient );
88 ~Wallpaper();
90 void SetColor( const Color& rColor );
91 const Color& GetColor() const;
93 void SetStyle( WallpaperStyle eStyle );
94 WallpaperStyle GetStyle() const;
96 void SetBitmap( const BitmapEx& rBitmap );
97 BitmapEx GetBitmap() const;
98 bool IsBitmap() const;
100 void SetGradient( const Gradient& rGradient );
101 Gradient GetGradient() const;
102 bool IsGradient() const;
104 void SetRect( const Rectangle& rRect );
105 Rectangle GetRect() const;
106 bool IsRect() const;
108 bool IsFixed() const;
109 bool IsScrollable() const;
111 Wallpaper& operator=( const Wallpaper& rWallpaper );
112 bool operator==( const Wallpaper& rWallpaper ) const;
113 bool operator!=( const Wallpaper& rWallpaper ) const
114 { return !(Wallpaper::operator==( rWallpaper )); }
115 bool IsSameInstance( const Wallpaper& rWallpaper ) const
116 { return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
118 friend VCL_DLLPUBLIC SvStream& ReadWallpaper( SvStream& rIStm, Wallpaper& rWallpaper );
119 friend VCL_DLLPUBLIC SvStream& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper );
122 #endif // INCLUDED_VCL_WALL_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */