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 "model/SlsSharedPageDescriptor.hxx"
24 #include "view/SlsILayerPainter.hxx"
25 #include "controller/SlsTransferableData.hxx"
28 #include <tools/gen.hxx>
29 #include <vcl/bitmapex.hxx>
30 #include <boost/scoped_ptr.hpp>
31 #include <boost/enable_shared_from_this.hpp>
36 namespace sd
{ namespace slidesorter
{
40 namespace sd
{ namespace slidesorter
{ namespace controller
{
44 namespace sd
{ namespace slidesorter
{ namespace view
{
48 /** The insertion indicator is painted as a vertical or horizonal bar
49 in the space between slides.
51 class InsertionIndicatorOverlay
52 : public ILayerPainter
,
53 public ::boost::enable_shared_from_this
<InsertionIndicatorOverlay
>
56 InsertionIndicatorOverlay (SlideSorter
& rSlideSorter
);
57 virtual ~InsertionIndicatorOverlay();
59 virtual void SetLayerInvalidator (const SharedILayerInvalidator
& rpInvalidator
) SAL_OVERRIDE
;
61 void Create (const SdTransferable
* pTransferable
);
63 /** Given a position in model coordinates this method calculates the
64 insertion marker both as an index in the document and as a location
65 used for drawing the insertion indicator.
67 void SetLocation (const Point
& rPosition
);
72 OutputDevice
& rDevice
,
73 const Rectangle
& rRepaintArea
) SAL_OVERRIDE
;
75 bool IsVisible() const { return mbIsVisible
;}
79 Rectangle
GetBoundingBox() const;
82 SlideSorter
& mrSlideSorter
;
84 const sal_Int32 mnLayerIndex
;
85 SharedILayerInvalidator mpLayerInvalidator
;
86 // Center of the insertion indicator.
90 ::boost::scoped_ptr
<FramePainter
> mpShadowPainter
;
92 void SetPositionAndSize (const Rectangle
& rBoundingBox
);
93 Point
PaintRepresentatives (
94 OutputDevice
& rContent
,
95 const Size
& rPreviewSize
,
96 const sal_Int32 nOffset
,
97 const ::std::vector
<controller::TransferableData::Representative
>& rPages
) const;
99 OutputDevice
& rDevice
,
100 const sal_Int32 nSelectionCount
,
101 const Size
& rPreviewSize
,
102 const Point
& rFirstPageOffset
) const;
103 /** Setup the insertion indicator by creating the icon. It consists of
104 scaled down previews of some of the selected pages.
107 const ::std::vector
<controller::TransferableData::Representative
>& rPages
,
108 const sal_Int32 nSelectionCount
);
111 } } } // end of namespace ::sd::slidesorter::view
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */