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_SLSINSERTIONINDICATOROVERLAY_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSINSERTIONINDICATOROVERLAY_HXX
23 #include <view/SlsILayerPainter.hxx>
24 #include <controller/SlsTransferableData.hxx>
26 #include <tools/gen.hxx>
27 #include <vcl/bitmapex.hxx>
34 namespace sd
{ namespace slidesorter
{
38 namespace sd
{ namespace slidesorter
{ namespace view
{
42 /** The insertion indicator is painted as a vertical or horizontal bar
43 in the space between slides.
45 class InsertionIndicatorOverlay
46 : public ILayerPainter
,
47 public std::enable_shared_from_this
<InsertionIndicatorOverlay
>
50 InsertionIndicatorOverlay (SlideSorter
& rSlideSorter
);
51 virtual ~InsertionIndicatorOverlay() COVERITY_NOEXCEPT_FALSE override
;
53 virtual void SetLayerInvalidator (const SharedILayerInvalidator
& rpInvalidator
) override
;
55 void Create (const SdTransferable
* pTransferable
);
57 /** Given a position in model coordinates this method calculates the
58 insertion marker both as an index in the document and as a location
59 used for drawing the insertion indicator.
61 void SetLocation (const Point
& rPosition
);
66 OutputDevice
& rDevice
,
67 const ::tools::Rectangle
& rRepaintArea
) override
;
69 bool IsVisible() const { return mbIsVisible
;}
73 ::tools::Rectangle
GetBoundingBox() const;
76 SlideSorter
& mrSlideSorter
;
78 SharedILayerInvalidator mpLayerInvalidator
;
79 // Center of the insertion indicator.
82 std::unique_ptr
<FramePainter
> mpShadowPainter
;
84 Point
PaintRepresentatives (
85 OutputDevice
& rContent
,
86 const Size
& rPreviewSize
,
87 const sal_Int32 nOffset
,
88 const ::std::vector
<controller::TransferableData::Representative
>& rPages
) const;
90 OutputDevice
& rDevice
,
91 const sal_Int32 nSelectionCount
,
92 const Size
& rPreviewSize
,
93 const Point
& rFirstPageOffset
) const;
94 /** Setup the insertion indicator by creating the icon. It consists of
95 scaled down previews of some of the selected pages.
98 const ::std::vector
<controller::TransferableData::Representative
>& rPages
,
99 const sal_Int32 nSelectionCount
);
102 } } } // end of namespace ::sd::slidesorter::view
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */