bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / inc / ViewClipboard.hxx
blob0a33e16512b04a631ac6ab6426a64f5eb1a9cc5f
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_INC_VIEWCLIPBOARD_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_VIEWCLIPBOARD_HXX
23 #include <sal/types.h>
25 class SdPage;
26 class SdTransferable;
28 namespace sd {
30 class View;
32 /** Handle clipboard related tasks for the draw view.
34 class ViewClipboard
36 public:
37 ViewClipboard (::sd::View& rView);
38 virtual ~ViewClipboard();
40 /** Handle the drop of a drag-and-drop action where the transferable
41 contains a set of pages.
43 void HandlePageDrop (const SdTransferable& rTransferable);
45 protected:
46 ::sd::View& mrView;
48 /** Return the first master page of the given transferable. When the
49 bookmark list of the transferable contains at least one non-master
50 page then NULL is returned.
52 static SdPage* GetFirstMasterPage (const SdTransferable& rTransferable);
54 /** Assign the (first) master page of the given transferable to the
55 (...) slide.
57 void AssignMasterPage (
58 const SdTransferable& rTransferable,
59 SdPage* pMasterPage);
61 /** Return an index of a page after which the pages of the transferable
62 are to be inserted into the target document.
64 virtual sal_uInt16 DetermineInsertPosition (
65 const SdTransferable& rTransferable);
67 /** Insert the slides in the given transferable behind the last selected
68 slide or, when the selection is empty, behind the last slide.
69 @param rTransferable
70 This transferable defines which pages to insert.
71 @param nInsertPosition
72 The pages of the transferable will be inserted behind the page
73 with this index.
74 @return
75 Returns the number of inserted slides.
77 virtual sal_uInt16 InsertSlides (
78 const SdTransferable& rTransferable,
79 sal_uInt16 nInsertPosition);
82 } // end of namespace ::sd
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */