1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/solar.h>
24 #include <vcl/dllapi.h>
25 #include <tools/color.hxx>
26 #include <tools/gen.hxx>
32 // -------------------
33 // - Wallpaper-Types -
34 // -------------------
36 #define WALLPAPER_NULL WallpaperStyle_NULL
37 #define WALLPAPER_TILE WallpaperStyle_TILE
38 #define WALLPAPER_CENTER WallpaperStyle_CENTER
39 #define WALLPAPER_SCALE WallpaperStyle_SCALE
40 #define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
41 #define WALLPAPER_TOP WallpaperStyle_TOP
42 #define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
43 #define WALLPAPER_LEFT WallpaperStyle_LEFT
44 #define WALLPAPER_RIGHT WallpaperStyle_RIGHT
45 #define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
46 #define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
47 #define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
48 #define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
49 #define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
51 #ifndef ENUM_WALLPAPERSTYLE_DECLARED
52 #define ENUM_WALLPAPERSTYLE_DECLARED
67 WALLPAPER_BOTTOMRIGHT
,
68 WALLPAPER_APPLICATIONGRADIENT
, // defines a gradient that internally covers the whole application
69 // and uses a color derived from the face color
70 WALLPAPER_FORCE_EQUAL_SIZE
= 0x7fffffff
79 class VCL_DLLPUBLIC Wallpaper
82 ImplWallpaper
* mpImplWallpaper
;
84 SAL_DLLPRIVATE
void ImplMakeUnique( sal_Bool bReleaseCache
= sal_True
);
85 SAL_DLLPRIVATE Gradient
ImplGetApplicationGradient() const;
88 SAL_DLLPRIVATE ImplWallpaper
* ImplGetImpWallpaper() const { return mpImplWallpaper
; }
93 Wallpaper( const Wallpaper
& rWallpaper
);
94 Wallpaper( const Color
& rColor
);
95 explicit Wallpaper( const BitmapEx
& rBmpEx
);
96 Wallpaper( const Gradient
& rGradient
);
99 void SetColor( const Color
& rColor
);
100 const Color
& GetColor() const;
102 void SetStyle( WallpaperStyle eStyle
);
103 WallpaperStyle
GetStyle() const;
105 void SetBitmap( const BitmapEx
& rBitmap
);
106 BitmapEx
GetBitmap() const;
107 sal_Bool
IsBitmap() const;
109 void SetGradient( const Gradient
& rGradient
);
110 Gradient
GetGradient() const;
111 sal_Bool
IsGradient() const;
113 void SetRect( const Rectangle
& rRect
);
114 Rectangle
GetRect() const;
115 sal_Bool
IsRect() const;
117 sal_Bool
IsFixed() const;
118 sal_Bool
IsScrollable() const;
120 Wallpaper
& operator=( const Wallpaper
& rWallpaper
);
121 sal_Bool
operator==( const Wallpaper
& rWallpaper
) const;
122 sal_Bool
operator!=( const Wallpaper
& rWallpaper
) const
123 { return !(Wallpaper::operator==( rWallpaper
)); }
124 sal_Bool
IsSameInstance( const Wallpaper
& rWallpaper
) const
125 { return (mpImplWallpaper
== rWallpaper
.mpImplWallpaper
); }
127 friend VCL_DLLPUBLIC SvStream
& operator>>( SvStream
& rIStm
, Wallpaper
& rWallpaper
);
128 friend VCL_DLLPUBLIC SvStream
& operator<<( SvStream
& rOStm
, const Wallpaper
& rWallpaper
);
131 #endif // INCLUDED_VCL_WALL_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */