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/color.hxx>
24 #include <tools/gen.hxx>
25 #include <vcl/dllapi.h>
26 #include <o3tl/cow_wrapper.hxx>
32 enum class WallpaperStyle
46 ApplicationGradient
// defines a gradient that internally covers the whole application
47 // and uses a color derived from the face color
50 class VCL_DLLPUBLIC Wallpaper
53 typedef o3tl::cow_wrapper
<ImplWallpaper
> ImplType
;
55 SAL_DLLPRIVATE
void ImplSetCachedBitmap( BitmapEx
& rBmp
) const;
56 SAL_DLLPRIVATE
const BitmapEx
* ImplGetCachedBitmap() const;
57 SAL_DLLPRIVATE
void ImplReleaseCachedBitmap() const;
60 ImplType mpImplWallpaper
;
62 SAL_DLLPRIVATE
static Gradient
ImplGetApplicationGradient();
66 Wallpaper( const Wallpaper
& rWallpaper
);
67 Wallpaper( Wallpaper
&& rWallpaper
);
68 Wallpaper( const Color
& rColor
);
69 explicit Wallpaper( const BitmapEx
& rBmpEx
);
70 Wallpaper( const Gradient
& rGradient
);
73 void SetColor( const Color
& rColor
);
74 const Color
& GetColor() const;
76 void SetStyle( WallpaperStyle eStyle
);
77 WallpaperStyle
GetStyle() const;
79 void SetBitmap( const BitmapEx
& rBitmap
);
80 BitmapEx
GetBitmap() const;
81 bool IsBitmap() const;
83 void SetGradient( const Gradient
& rGradient
);
84 Gradient
GetGradient() const;
85 bool IsGradient() const;
87 void SetRect( const tools::Rectangle
& rRect
);
88 tools::Rectangle
GetRect() const;
92 bool IsScrollable() const;
94 Wallpaper
& operator=( const Wallpaper
& rWallpaper
);
95 Wallpaper
& operator=( Wallpaper
&& rWallpaper
);
97 bool operator==( const Wallpaper
& rWallpaper
) const;
98 bool operator!=( const Wallpaper
& rWallpaper
) const
99 { return !(Wallpaper::operator==( rWallpaper
)); }
101 friend VCL_DLLPUBLIC SvStream
& ReadWallpaper( SvStream
& rIStm
, Wallpaper
& rWallpaper
);
102 friend VCL_DLLPUBLIC SvStream
& WriteWallpaper( SvStream
& rOStm
, const Wallpaper
& rWallpaper
);
105 #endif // INCLUDED_VCL_WALL_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */