xref: /trunk/main/sc/source/ui/inc/drwtrans.hxx (revision 0ba51277dcadf5446227c21ffd366f1895b67f0a)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
22cdf0e10cSrcweir #ifndef SC_DRWTRANS_HXX
23cdf0e10cSrcweir #define SC_DRWTRANS_HXX
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
26cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
27cdf0e10cSrcweir #include <svtools/transfer.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <sfx2/objsh.hxx>
30cdf0e10cSrcweir #include "global.hxx"
31cdf0e10cSrcweir #include "charthelper.hxx"
32cdf0e10cSrcweir #include "rangelst.hxx"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SdrModel;
35cdf0e10cSrcweir class ScDocShell;
36cdf0e10cSrcweir class INetBookmark;
37cdf0e10cSrcweir class SdrObject;
38cdf0e10cSrcweir class SdrView;
39cdf0e10cSrcweir class ScDrawView;
40cdf0e10cSrcweir class SdrOle2Obj;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class ScDrawTransferObj : public TransferableHelper
43cdf0e10cSrcweir {
44cdf0e10cSrcweir private:
45cdf0e10cSrcweir     SdrModel*                       pModel;
46cdf0e10cSrcweir     TransferableDataHelper          aOleData;
47cdf0e10cSrcweir     TransferableObjectDescriptor    aObjDesc;
48cdf0e10cSrcweir //REMOVE        SvEmbeddedObjectRef             aDocShellRef;
49cdf0e10cSrcweir //REMOVE        SvEmbeddedObjectRef             aDrawPersistRef;
50cdf0e10cSrcweir     SfxObjectShellRef               aDocShellRef;
51cdf0e10cSrcweir     SfxObjectShellRef               aDrawPersistRef;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir                                     // extracted from model in ctor:
54cdf0e10cSrcweir     Size                            aSrcSize;
55cdf0e10cSrcweir     INetBookmark*                   pBookmark;
56cdf0e10cSrcweir     sal_Bool                            bGraphic;
57cdf0e10cSrcweir     sal_Bool                            bGrIsBit;
58cdf0e10cSrcweir     sal_Bool                            bOleObj;
59cdf0e10cSrcweir                                     // source information for drag&drop:
60*0ba51277Smseidel                                     // (view is needed to handle drawing objects)
61cdf0e10cSrcweir     SdrView*                        pDragSourceView;
62cdf0e10cSrcweir     sal_uInt16                          nDragSourceFlags;
63cdf0e10cSrcweir     sal_Bool                            bDragWasInternal;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     sal_uInt32                      nSourceDocID;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     ScRangeListVector               m_aProtectedChartRangesVector;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     void                InitDocShell();
71cdf0e10cSrcweir //REMOVE        SvInPlaceObjectRef  GetSingleObject();
72cdf0e10cSrcweir     SdrOle2Obj* GetSingleObject();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir public:
75cdf0e10cSrcweir             ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell,
76cdf0e10cSrcweir                                 const TransferableObjectDescriptor& rDesc );
77cdf0e10cSrcweir     virtual ~ScDrawTransferObj();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     virtual void        AddSupportedFormats();
80cdf0e10cSrcweir     virtual sal_Bool    GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
81cdf0e10cSrcweir     virtual sal_Bool    WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
82cdf0e10cSrcweir                                         const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
83cdf0e10cSrcweir     virtual void        ObjectReleased();
84cdf0e10cSrcweir     virtual void        DragFinished( sal_Int8 nDropAction );
85cdf0e10cSrcweir 
GetModel()86cdf0e10cSrcweir     SdrModel*           GetModel()  { return pModel; }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     void                SetDrawPersist( const SfxObjectShellRef& rRef );
89cdf0e10cSrcweir     void                SetDragSource( ScDrawView* pView );
90cdf0e10cSrcweir     void                SetDragSourceObj( SdrObject* pObj, SCTAB nTab );
91cdf0e10cSrcweir     void                SetDragSourceFlags( sal_uInt16 nFlags );
92cdf0e10cSrcweir     void                SetDragWasInternal();
93cdf0e10cSrcweir 
GetDragSourceView()94cdf0e10cSrcweir     SdrView*            GetDragSourceView()             { return pDragSourceView; }
GetDragSourceFlags() const95cdf0e10cSrcweir     sal_uInt16              GetDragSourceFlags() const      { return nDragSourceFlags; }
96cdf0e10cSrcweir 
SetSourceDocID(sal_uInt32 nVal)97cdf0e10cSrcweir     void                SetSourceDocID( sal_uInt32 nVal )
98cdf0e10cSrcweir                             { nSourceDocID = nVal; }
GetSourceDocID() const99cdf0e10cSrcweir     sal_uInt32          GetSourceDocID() const      { return nSourceDocID; }
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin );
102cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException );
103cdf0e10cSrcweir     static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
104cdf0e10cSrcweir 
GetProtectedChartRangesVector() const105cdf0e10cSrcweir     const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; }
106cdf0e10cSrcweir };
107cdf0e10cSrcweir 
108cdf0e10cSrcweir #endif
109*0ba51277Smseidel 
110*0ba51277Smseidel /* vim: set noet sw=4 ts=4: */
111