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 _SV_WALL_HXX
21 : #define _SV_WALL_HXX
22 :
23 : #include <tools/solar.h>
24 : #include <vcl/dllapi.h>
25 : #include <tools/color.hxx>
26 : #include <tools/gen.hxx>
27 :
28 : class Gradient;
29 : class BitmapEx;
30 : class ImplWallpaper;
31 :
32 : // -------------------
33 : // - Wallpaper-Types -
34 : // -------------------
35 :
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
50 :
51 : #ifndef ENUM_WALLPAPERSTYLE_DECLARED
52 : #define ENUM_WALLPAPERSTYLE_DECLARED
53 :
54 : enum WallpaperStyle
55 : {
56 : WALLPAPER_NULL,
57 : WALLPAPER_TILE,
58 : WALLPAPER_CENTER,
59 : WALLPAPER_SCALE,
60 : WALLPAPER_TOPLEFT,
61 : WALLPAPER_TOP,
62 : WALLPAPER_TOPRIGHT,
63 : WALLPAPER_LEFT,
64 : WALLPAPER_RIGHT,
65 : WALLPAPER_BOTTOMLEFT,
66 : WALLPAPER_BOTTOM,
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
71 : };
72 :
73 : #endif
74 :
75 : // -------------
76 : // - Wallpaper -
77 : // -------------
78 :
79 : class VCL_DLLPUBLIC Wallpaper
80 : {
81 : private:
82 : ImplWallpaper* mpImplWallpaper;
83 :
84 : SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
85 : SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
86 :
87 : public:
88 0 : SAL_DLLPRIVATE ImplWallpaper* ImplGetImpWallpaper() const { return mpImplWallpaper; }
89 :
90 :
91 : public:
92 : Wallpaper();
93 : Wallpaper( const Wallpaper& rWallpaper );
94 : Wallpaper( const Color& rColor );
95 : explicit Wallpaper( const BitmapEx& rBmpEx );
96 : Wallpaper( const Gradient& rGradient );
97 : ~Wallpaper();
98 :
99 : void SetColor( const Color& rColor );
100 : const Color& GetColor() const;
101 :
102 : void SetStyle( WallpaperStyle eStyle );
103 : WallpaperStyle GetStyle() const;
104 :
105 : void SetBitmap( const BitmapEx& rBitmap );
106 : BitmapEx GetBitmap() const;
107 : sal_Bool IsBitmap() const;
108 :
109 : void SetGradient( const Gradient& rGradient );
110 : Gradient GetGradient() const;
111 : sal_Bool IsGradient() const;
112 :
113 : void SetRect( const Rectangle& rRect );
114 : Rectangle GetRect() const;
115 : sal_Bool IsRect() const;
116 :
117 : sal_Bool IsFixed() const;
118 : sal_Bool IsScrollable() const;
119 :
120 : Wallpaper& operator=( const Wallpaper& rWallpaper );
121 : sal_Bool operator==( const Wallpaper& rWallpaper ) const;
122 0 : sal_Bool operator!=( const Wallpaper& rWallpaper ) const
123 0 : { return !(Wallpaper::operator==( rWallpaper )); }
124 : sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
125 : { return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
126 :
127 : friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
128 : friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper );
129 : };
130 :
131 : #endif // _SV_WALL_HXX
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|