xref: /aoo4110/main/sd/source/ui/inc/ViewClipboard.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_VIEW_CLIPBOARD_HXX
25 #define SD_VIEW_CLIPBOARD_HXX
26 
27 #include <tools/solar.h>
28 
29 class SdPage;
30 class SdTransferable;
31 
32 namespace sd {
33 
34 class View;
35 
36 
37 /** Handle clipboard related tasks for the draw view.
38 */
39 class ViewClipboard
40 {
41 public:
42     ViewClipboard (::sd::View& rView);
43     virtual ~ViewClipboard (void);
44 
45     /** Handle the drop of a drag-and-drop action where the transferable
46         contains a set of pages.
47     */
48     virtual void HandlePageDrop (const SdTransferable& rTransferable);
49 
50 protected:
51     ::sd::View& mrView;
52 
53     /** Return the first master page of the given transferable.  When the
54         bookmark list of the transferable contains at least one non-master
55         page then NULL is returned.
56     */
57     SdPage* GetFirstMasterPage (const SdTransferable& rTransferable);
58 
59     /** Assign the (first) master page of the given transferable to the
60         (...) slide.
61     */
62     virtual void AssignMasterPage (
63         const SdTransferable& rTransferable,
64         SdPage* pMasterPage);
65 
66     /** Return an index of a page after which the pages of the transferable
67         are to be inserted into the target document.
68     */
69     virtual sal_uInt16 DetermineInsertPosition (
70         const SdTransferable& rTransferable);
71 
72     /** Insert the slides in the given transferable behind the last selected
73         slide or, when the selection is empty, behind the last slide.
74         @param rTransferable
75             This transferable defines which pages to insert.
76         @param nInsertPosition
77             The pages of the transferable will be inserted behind the page
78             with this index.
79         @return
80             Returns the number of inserted slides.
81     */
82     virtual sal_uInt16 InsertSlides (
83         const SdTransferable& rTransferable,
84         sal_uInt16 nInsertPosition);
85 };
86 
87 } // end of namespace ::sd
88 
89 #endif
90