Update git submodules
[LibreOffice.git] / sd / source / ui / slidesorter / inc / view / SlsPageObjectPainter.hxx
blob747c09500cfffa225aa085fae458b049f95ba918
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 #pragma once
22 #include <model/SlsSharedPageDescriptor.hxx>
23 #include <view/SlsTheme.hxx>
24 #include <memory>
26 namespace sd::slidesorter::cache { class PageCache; }
27 namespace sd::slidesorter { class SlideSorter; }
29 namespace sd::slidesorter::view {
31 class Layouter;
32 class PageObjectLayouter;
33 class FramePainter;
35 class PageObjectPainter
37 public:
38 PageObjectPainter (const SlideSorter& rSlideSorter);
39 ~PageObjectPainter();
41 void PaintPageObject (
42 OutputDevice& rDevice,
43 const model::SharedPageDescriptor& rpDescriptor);
45 /** Called when the theme changes, either because it is replaced with
46 another or because the system colors have changed. So, even when
47 the given theme is the same object as the one already in use by this
48 painter everything that depends on the theme is updated.
50 void SetTheme (const std::shared_ptr<view::Theme>& rpTheme);
52 /** Return a preview bitmap for the given page descriptor. When the
53 page is excluded from the show then the preview is marked
54 accordingly.
55 @rpDescriptor
56 Defines the page for which to return the preview.
57 @pReferenceDevice
58 When not <NULL/> then this reference device is used to created a
59 compatible bitmap.
60 @return
61 The returned bitmap may have a different size then the preview area.
63 BitmapEx GetPreviewBitmap (
64 const model::SharedPageDescriptor& rpDescriptor,
65 const OutputDevice* pReferenceDevice) const;
67 private:
68 const Layouter& mrLayouter;
69 std::shared_ptr<cache::PageCache> mpCache;
70 std::shared_ptr<view::Theme> mpTheme;
71 std::shared_ptr<vcl::Font> mpPageNumberFont;
72 std::unique_ptr<FramePainter> mpShadowPainter;
73 std::unique_ptr<FramePainter> mpFocusBorderPainter;
75 void PaintBackground (
76 PageObjectLayouter *pPageObjectLayouter,
77 OutputDevice& rDevice,
78 const model::SharedPageDescriptor& rpDescriptor) const;
79 void PaintPreview (
80 PageObjectLayouter *pPageObjectLayouter,
81 OutputDevice& rDevice,
82 const model::SharedPageDescriptor& rpDescriptor) const;
83 void PaintPageNumber (
84 PageObjectLayouter *pPageObjectLayouter,
85 OutputDevice& rDevice,
86 const model::SharedPageDescriptor& rpDescriptor) const;
87 static void PaintTransitionEffect (
88 PageObjectLayouter *pPageObjectLayouter,
89 OutputDevice& rDevice,
90 const model::SharedPageDescriptor& rpDescriptor);
91 static void PaintCustomAnimationEffect (
92 PageObjectLayouter *pPageObjectLayouter,
93 OutputDevice& rDevice,
94 const model::SharedPageDescriptor& rpDescriptor);
95 void PaintBorder (
96 OutputDevice& rDevice,
97 const Theme::GradientColorType eColorType,
98 const ::tools::Rectangle& rBox) const;
99 void PaintBackgroundDetail(
100 PageObjectLayouter *pPageObjectLayouter,
101 OutputDevice& rDevice,
102 const model::SharedPageDescriptor& rpDescriptor) const;
104 static BitmapEx CreateMarkedPreview(
105 const Size& rSize,
106 const BitmapEx& rPreview,
107 const BitmapEx& rOverlay,
108 const OutputDevice* pReferenceDevice);
110 /** Update the local pointer to the page object layouter to the
111 one owned by the general layouter.
112 Return <TRUE/> when after the call we have a valid page object layouter.
114 bool UpdatePageObjectLayouter();
117 } // end of namespace sd::slidesorter::view
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */