Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_WALL_HXX
21 : #define INCLUDED_VCL_WALL_HXX
22 :
23 : #include <tools/color.hxx>
24 : #include <tools/gen.hxx>
25 : #include <vcl/dllapi.h>
26 :
27 : class Gradient;
28 : class BitmapEx;
29 : class ImplWallpaper;
30 :
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
45 :
46 : #ifndef ENUM_WALLPAPERSTYLE_DECLARED
47 : #define ENUM_WALLPAPERSTYLE_DECLARED
48 :
49 : enum WallpaperStyle
50 : {
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
66 : };
67 :
68 : #endif
69 :
70 : class VCL_DLLPUBLIC Wallpaper
71 : {
72 : private:
73 : ImplWallpaper* mpImplWallpaper;
74 :
75 : SAL_DLLPRIVATE void ImplMakeUnique( bool bReleaseCache = true );
76 : SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
77 :
78 : public:
79 0 : SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
80 :
81 :
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();
89 :
90 : void SetColor( const Color& rColor );
91 : const Color& GetColor() const;
92 :
93 : void SetStyle( WallpaperStyle eStyle );
94 : WallpaperStyle GetStyle() const;
95 :
96 : void SetBitmap( const BitmapEx& rBitmap );
97 : BitmapEx GetBitmap() const;
98 : bool IsBitmap() const;
99 :
100 : void SetGradient( const Gradient& rGradient );
101 : Gradient GetGradient() const;
102 : bool IsGradient() const;
103 :
104 : void SetRect( const Rectangle& rRect );
105 : Rectangle GetRect() const;
106 : bool IsRect() const;
107 :
108 : bool IsFixed() const;
109 : bool IsScrollable() const;
110 :
111 : Wallpaper& operator=( const Wallpaper& rWallpaper );
112 : bool operator==( const Wallpaper& rWallpaper ) const;
113 0 : bool operator!=( const Wallpaper& rWallpaper ) const
114 0 : { return !(Wallpaper::operator==( rWallpaper )); }
115 : bool IsSameInstance( const Wallpaper& rWallpaper ) const
116 : { return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
117 :
118 : friend VCL_DLLPUBLIC SvStream& ReadWallpaper( SvStream& rIStm, Wallpaper& rWallpaper );
119 : friend VCL_DLLPUBLIC SvStream& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper );
120 : };
121 :
122 : #endif // INCLUDED_VCL_WALL_HXX
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|