bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / slidesorter / inc / view / SlsInsertionIndicatorOverlay.hxx
blob5f604726a172b8e0068abffa65a0ee31b661a2be
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_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"
26 #include "sdxfer.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>
32 #include <vector>
34 class OutputDevice;
36 namespace sd { namespace slidesorter {
37 class SlideSorter;
38 } }
40 namespace sd { namespace slidesorter { namespace controller {
41 class Transferable;
42 } } }
44 namespace sd { namespace slidesorter { namespace view {
46 class FramePainter;
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>
55 public:
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);
69 Size GetSize() const;
71 virtual void Paint (
72 OutputDevice& rDevice,
73 const Rectangle& rRepaintArea) SAL_OVERRIDE;
75 bool IsVisible() const { return mbIsVisible;}
76 void Hide();
77 void Show();
79 Rectangle GetBoundingBox() const;
81 private:
82 SlideSorter& mrSlideSorter;
83 bool mbIsVisible;
84 const sal_Int32 mnLayerIndex;
85 SharedILayerInvalidator mpLayerInvalidator;
86 // Center of the insertion indicator.
87 Point maLocation;
88 BitmapEx maIcon;
89 Point maIconOffset;
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;
98 void PaintPageCount (
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.
106 void Create (
107 const ::std::vector<controller::TransferableData::Representative>& rPages,
108 const sal_Int32 nSelectionCount);
111 } } } // end of namespace ::sd::slidesorter::view
113 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */