bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / slidesorter / view / SlsFramePainter.hxx
blob1fbb22db620d04bec4e19067a31bb5a1553f90a6
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_SD_SOURCE_UI_SLIDESORTER_VIEW_SLSFRAMEPAINTER_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_VIEW_SLSFRAMEPAINTER_HXX
23 #include <vcl/bitmapex.hxx>
25 namespace sd { namespace slidesorter { namespace view {
27 class FramePainter
29 public:
30 explicit FramePainter (const BitmapEx& rBitmap);
31 ~FramePainter();
33 /** Paint a border around the given box by using a set of bitmaps for
34 the corners and sides.
36 void PaintFrame (OutputDevice&rDevice, const ::tools::Rectangle& rBox) const;
38 /** Special functionality that takes the color from the center
39 bitmap and replaces that color in all bitmaps by the given new
40 color. Alpha values are not modified.
41 The center bitmap is erased.
43 void AdaptColor (const Color aNewColor);
45 private:
46 /** Bitmap with offset that is used when the bitmap is painted. The bitmap
48 class OffsetBitmap {
49 public:
50 BitmapEx maBitmap;
51 Point maOffset;
53 /** Create one of the eight shadow bitmaps from one that combines
54 them all. This larger bitmap is expected to have dimension NxN
55 with N=1+2*M. Of this larger bitmap there are created four
56 corner bitmaps of size 2*M x 2*M and four side bitmaps of sizes
57 1xM (top and bottom) and Mx1 (left and right). The corner
58 bitmaps have each one quadrant of size MxM that is painted under
59 the interior of the frame.
60 @param rBitmap
61 The larger bitmap of which the eight shadow bitmaps are cut
62 out from.
63 @param nHorizontalPosition
64 Valid values are -1 (left), 0 (center), and +1 (right).
65 @param nVerticalPosition
66 Valid values are -1 (top), 0 (center), and +1 (bottom).
68 OffsetBitmap (
69 const BitmapEx& rBitmap,
70 const sal_Int32 nHorizontalPosition,
71 const sal_Int32 nVerticalPosition);
73 /** Use the given device to paint the bitmap at the location that is
74 the sum of the given anchor and the internal offset.
76 void PaintCorner (OutputDevice& rDevice, const Point& rAnchor) const;
78 /** Use the given device to paint the bitmap stretched between the
79 two given locations. Offsets of the adjacent corner bitmaps and
80 the offset of the side bitmap are used to determine the area
81 that is to be filled with the side bitmap.
83 void PaintSide (
84 OutputDevice& rDevice,
85 const Point& rAnchor1,
86 const Point& rAnchor2,
87 const OffsetBitmap& rCornerBitmap1,
88 const OffsetBitmap& rCornerBitmap2) const;
90 /** Fill the given rectangle with the bitmap.
92 void PaintCenter (
93 OutputDevice& rDevice,
94 const ::tools::Rectangle& rBox) const;
96 OffsetBitmap maTopLeft;
97 OffsetBitmap maTop;
98 OffsetBitmap maTopRight;
99 OffsetBitmap maLeft;
100 OffsetBitmap maRight;
101 OffsetBitmap maBottomLeft;
102 OffsetBitmap maBottom;
103 OffsetBitmap maBottomRight;
104 OffsetBitmap maCenter;
105 bool mbIsValid;
108 } } } // end of namespace sd::slidesorter::view
110 #endif
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */