bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / slidesorter / inc / view / SlsPageObjectPainter.hxx
blob4cd1deaeec5c7602c45c114ce1f2a12b6688c544
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_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>
25 #include <memory>
27 namespace sd { namespace slidesorter { namespace cache {
28 class PageCache;
29 } } }
31 namespace sd { namespace slidesorter { class SlideSorter; } }
33 namespace sd { namespace slidesorter { namespace view {
35 class Layouter;
36 class PageObjectLayouter;
37 class FramePainter;
39 class PageObjectPainter
41 public:
42 PageObjectPainter (const SlideSorter& rSlideSorter);
43 ~PageObjectPainter();
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
58 accordingly.
59 @rpDescriptor
60 Defines the page for which to return the preview.
61 @pReferenceDevice
62 When not <NULL/> then this reference device is used to created a
63 compatible bitmap.
64 @return
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;
71 private:
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;
83 void PaintPreview (
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);
99 void PaintBorder (
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(
109 const Size& rSize,
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
123 #endif
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */