cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / inc / ViewClipboard.hxx
blobd39fdb8f0bbba798c8b16ccdc19827d735b804b1
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 #pragma once
22 #include <sal/types.h>
24 class SdPage;
25 class SdTransferable;
27 namespace sd
29 class View;
31 /** Handle clipboard related tasks for the draw view.
33 class ViewClipboard
35 ::sd::View& mrView;
37 public:
38 ViewClipboard(::sd::View& rView);
39 virtual ~ViewClipboard();
41 /** Handle the drop of a drag-and-drop action where the transferable
42 contains a set of pages.
44 void HandlePageDrop(const SdTransferable& rTransferable);
46 protected:
47 /** Return the first master page of the given transferable. When the
48 bookmark list of the transferable contains at least one non-master
49 page then NULL is returned.
51 static SdPage* GetFirstMasterPage(const SdTransferable& rTransferable);
53 /** Assign the (first) master page of the given transferable to the
54 (...) slide.
56 void AssignMasterPage(const SdTransferable& rTransferable, SdPage const* pMasterPage);
58 /** Return an index of a page after which the pages of the transferable
59 are to be inserted into the target document.
61 virtual sal_uInt16 DetermineInsertPosition();
63 /** Insert the slides in the given transferable behind the last selected
64 slide or, when the selection is empty, behind the last slide.
65 @param rTransferable
66 This transferable defines which pages to insert.
67 @param nInsertPosition
68 The pages of the transferable will be inserted behind the page
69 with this index.
70 @return
71 Returns the number of inserted slides.
73 sal_uInt16 InsertSlides(const SdTransferable& rTransferable, sal_uInt16 nInsertPosition);
76 } // end of namespace ::sd
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */