xref: /AOO41X/main/sc/source/ui/inc/seltrans.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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 SC_SELTRANS_HXX
25 #define SC_SELTRANS_HXX
26 
27 #include <svtools/transfer.hxx>
28 
29 class ScTabView;
30 class ScTransferObj;
31 class ScDrawTransferObj;
32 
33 enum ScSelectionTransferMode
34 {
35     SC_SELTRANS_INVALID,
36     SC_SELTRANS_CELL,
37     SC_SELTRANS_CELLS,
38     SC_SELTRANS_DRAW_BITMAP,
39     SC_SELTRANS_DRAW_GRAPHIC,
40     SC_SELTRANS_DRAW_BOOKMARK,
41     SC_SELTRANS_DRAW_OLE,
42     SC_SELTRANS_DRAW_OTHER
43 };
44 
45 class ScSelectionTransferObj : public TransferableHelper
46 {
47 private:
48     ScTabView*              pView;
49     ScSelectionTransferMode eMode;
50     ScTransferObj*          pCellData;
51     ScDrawTransferObj*      pDrawData;
52 
53                 ScSelectionTransferObj( ScTabView* pSource, ScSelectionTransferMode eNewMode );
54     void        CreateCellData();
55     void        CreateDrawData();
56 
57 public:
58             // creates an object if the view has a valid selection,
59             // returns NULL otherwise
60     static ScSelectionTransferObj* CreateFromView( ScTabView* pSource );
61 
62     virtual     ~ScSelectionTransferObj();
63 
64     void        ForgetView();
65     sal_Bool        StillValid();
GetView() const66     ScTabView*  GetView() const     { return pView; }
67 
68     ScTransferObj*      GetCellData();
69     ScDrawTransferObj*  GetDrawData();
70 
71     virtual void        AddSupportedFormats();
72     virtual sal_Bool    GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
73     virtual void        ObjectReleased();
74 };
75 
76 #endif
77 
78