bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / slidesorter / inc / view / SlsPageObjectPainter.hxx
blobc47a1eb88c33cba50216ebd8948bd7be119189e3
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 "SlideSorter.hxx"
24 #include "model/SlsPageDescriptor.hxx"
25 #include "view/SlsLayouter.hxx"
26 #include "view/SlsTheme.hxx"
27 #include <boost/scoped_ptr.hpp>
29 namespace sd { namespace slidesorter { namespace cache {
30 class PageCache;
31 } } }
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 ::boost::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 Bitmap GetPreviewBitmap (
68 const model::SharedPageDescriptor& rpDescriptor,
69 const OutputDevice* pReferenceDevice) const;
71 private:
72 const Layouter& mrLayouter;
73 ::boost::shared_ptr<cache::PageCache> mpCache;
74 ::boost::shared_ptr<controller::Properties> mpProperties;
75 ::boost::shared_ptr<view::Theme> mpTheme;
76 ::boost::shared_ptr<vcl::Font> mpPageNumberFont;
77 ::boost::scoped_ptr<FramePainter> mpShadowPainter;
78 ::boost::scoped_ptr<FramePainter> mpFocusBorderPainter;
79 Bitmap maNormalBackground;
80 Bitmap maSelectionBackground;
81 Bitmap maFocusedSelectionBackground;
82 Bitmap maFocusedBackground;
83 Bitmap maMouseOverBackground;
84 Bitmap maMouseOverFocusedBackground;
85 Bitmap maMouseOverSelectedBackground;
86 Bitmap maMouseOverSelectedAndFocusedBackground;
88 void PaintBackground (
89 PageObjectLayouter *pPageObjectLayouter,
90 OutputDevice& rDevice,
91 const model::SharedPageDescriptor& rpDescriptor) const;
92 void PaintPreview (
93 PageObjectLayouter *pPageObjectLayouter,
94 OutputDevice& rDevice,
95 const model::SharedPageDescriptor& rpDescriptor) const;
96 void PaintPageNumber (
97 PageObjectLayouter *pPageObjectLayouter,
98 OutputDevice& rDevice,
99 const model::SharedPageDescriptor& rpDescriptor) const;
100 static void PaintTransitionEffect (
101 PageObjectLayouter *pPageObjectLayouter,
102 OutputDevice& rDevice,
103 const model::SharedPageDescriptor& rpDescriptor);
104 static void PaintCustomAnimationEffect (
105 PageObjectLayouter *pPageObjectLayouter,
106 OutputDevice& rDevice,
107 const model::SharedPageDescriptor& rpDescriptor);
108 void PaintBorder (
109 OutputDevice& rDevice,
110 const Theme::GradientColorType eColorType,
111 const Rectangle& rBox) const;
112 void PaintBackgroundDetail(
113 PageObjectLayouter *pPageObjectLayouter,
114 OutputDevice& rDevice,
115 const model::SharedPageDescriptor& rpDescriptor) const;
117 static Bitmap CreateMarkedPreview(
118 const Size& rSize,
119 const Bitmap& rPreview,
120 const BitmapEx& rOverlay,
121 const OutputDevice* pReferenceDevice);
123 /** Update the local pointer to the page object layouter to the
124 one owned by the general layouter.
125 Return <TRUE/> when after the call we have a valid page object layouter.
127 bool UpdatePageObjectLayouter();
130 } } } // end of namespace sd::slidesorter::view
132 #endif
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */