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_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSPAGEOBJECTPAINTER_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSPAGEOBJECTPAINTER_HXX
23 #include <model/SlsSharedPageDescriptor.hxx>
24 #include <view/SlsTheme.hxx>
27 namespace sd
{ namespace slidesorter
{ namespace cache
{
31 namespace sd
{ namespace slidesorter
{ class SlideSorter
; } }
33 namespace sd
{ namespace slidesorter
{ namespace view
{
36 class PageObjectLayouter
;
39 class PageObjectPainter
42 PageObjectPainter (const SlideSorter
& rSlideSorter
);
45 void PaintPageObject (
46 OutputDevice
& rDevice
,
47 const model::SharedPageDescriptor
& rpDescriptor
);
49 /** Called when the theme changes, either because it is replaced with
50 another or because the system colors have changed. So, even when
51 the given theme is the same object as the one already in use by this
52 painter everything that depends on the theme is updated.
54 void SetTheme (const std::shared_ptr
<view::Theme
>& rpTheme
);
56 /** Return a preview bitmap for the given page descriptor. When the
57 page is excluded from the show then the preview is marked
60 Defines the page for which to return the preview.
62 When not <NULL/> then this reference device is used to created a
65 The returned bitmap may have a different size then the preview area.
67 BitmapEx
GetPreviewBitmap (
68 const model::SharedPageDescriptor
& rpDescriptor
,
69 const OutputDevice
* pReferenceDevice
) const;
72 const Layouter
& mrLayouter
;
73 std::shared_ptr
<cache::PageCache
> mpCache
;
74 std::shared_ptr
<view::Theme
> mpTheme
;
75 std::shared_ptr
<vcl::Font
> mpPageNumberFont
;
76 std::unique_ptr
<FramePainter
> mpShadowPainter
;
77 std::unique_ptr
<FramePainter
> mpFocusBorderPainter
;
79 void PaintBackground (
80 PageObjectLayouter
*pPageObjectLayouter
,
81 OutputDevice
& rDevice
,
82 const model::SharedPageDescriptor
& rpDescriptor
) const;
84 PageObjectLayouter
*pPageObjectLayouter
,
85 OutputDevice
& rDevice
,
86 const model::SharedPageDescriptor
& rpDescriptor
) const;
87 void PaintPageNumber (
88 PageObjectLayouter
*pPageObjectLayouter
,
89 OutputDevice
& rDevice
,
90 const model::SharedPageDescriptor
& rpDescriptor
) const;
91 static void PaintTransitionEffect (
92 PageObjectLayouter
*pPageObjectLayouter
,
93 OutputDevice
& rDevice
,
94 const model::SharedPageDescriptor
& rpDescriptor
);
95 static void PaintCustomAnimationEffect (
96 PageObjectLayouter
*pPageObjectLayouter
,
97 OutputDevice
& rDevice
,
98 const model::SharedPageDescriptor
& rpDescriptor
);
100 OutputDevice
& rDevice
,
101 const Theme::GradientColorType eColorType
,
102 const ::tools::Rectangle
& rBox
) const;
103 void PaintBackgroundDetail(
104 PageObjectLayouter
*pPageObjectLayouter
,
105 OutputDevice
& rDevice
,
106 const model::SharedPageDescriptor
& rpDescriptor
) const;
108 static BitmapEx
CreateMarkedPreview(
110 const BitmapEx
& rPreview
,
111 const BitmapEx
& rOverlay
,
112 const OutputDevice
* pReferenceDevice
);
114 /** Update the local pointer to the page object layouter to the
115 one owned by the general layouter.
116 Return <TRUE/> when after the call we have a valid page object layouter.
118 bool UpdatePageObjectLayouter();
121 } } } // end of namespace sd::slidesorter::view
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */