xref: /aoo41x/main/sd/source/ui/inc/ViewClipboard.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_VIEW_CLIPBOARD_HXX
29 #define SD_VIEW_CLIPBOARD_HXX
30 
31 #include <tools/solar.h>
32 
33 class SdPage;
34 class SdTransferable;
35 
36 namespace sd {
37 
38 class View;
39 
40 
41 /** Handle clipboard related tasks for the draw view.
42 */
43 class ViewClipboard
44 {
45 public:
46     ViewClipboard (::sd::View& rView);
47     virtual ~ViewClipboard (void);
48 
49     /** Handle the drop of a drag-and-drop action where the transferable
50         contains a set of pages.
51     */
52     virtual void HandlePageDrop (const SdTransferable& rTransferable);
53 
54 protected:
55     ::sd::View& mrView;
56 
57     /** Return the first master page of the given transferable.  When the
58         bookmark list of the transferable contains at least one non-master
59         page then NULL is returned.
60     */
61     SdPage* GetFirstMasterPage (const SdTransferable& rTransferable);
62 
63     /** Assign the (first) master page of the given transferable to the
64         (...) slide.
65     */
66     virtual void AssignMasterPage (
67         const SdTransferable& rTransferable,
68         SdPage* pMasterPage);
69 
70     /** Return an index of a page after which the pages of the transferable
71         are to be inserted into the target document.
72     */
73     virtual sal_uInt16 DetermineInsertPosition (
74         const SdTransferable& rTransferable);
75 
76     /** Insert the slides in the given transferable behind the last selected
77         slide or, when the selection is empty, behind the last slide.
78         @param rTransferable
79             This transferable defines which pages to insert.
80         @param nInsertPosition
81             The pages of the transferable will be inserted behind the page
82             with this index.
83         @return
84             Returns the number of inserted slides.
85     */
86     virtual sal_uInt16 InsertSlides (
87         const SdTransferable& rTransferable,
88         sal_uInt16 nInsertPosition);
89 };
90 
91 } // end of namespace ::sd
92 
93 #endif
94