1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include "svtools/svtdllapi.h"
24 #include <tools/globname.hxx>
25 #include <tools/gen.hxx>
26 #include <sot/formats.hxx>
27 #include <cppuhelper/implbase1.hxx>
28 #include <cppuhelper/implbase4.hxx>
29 #include <com/sun/star/frame/XTerminateListener.hpp>
30 #include <com/sun/star/lang/XUnoTunnel.hpp>
31 #include <com/sun/star/datatransfer/XTransferable.hpp>
32 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
33 #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
34 #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
35 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
36 #include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp>
37 #include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp>
38 #include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
39 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
40 #include <com/sun/star/embed/Aspects.hpp>
41 #include <com/sun/star/io/XInputStream.hpp>
47 class SotStorageStreamRef
;
56 #define DND_ACTION_NONE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE
57 #define DND_ACTION_COPY ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY
58 #define DND_ACTION_MOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE
59 #define DND_ACTION_COPYMOVE ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
60 #define DND_ACTION_LINK ::com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK
62 #define DND_POINTER_NONE 0
63 #define DND_IMAGE_NONE 0
65 struct TransferableObjectDescriptor
67 SvGlobalName maClassName
;
68 sal_uInt16 mnViewAspect
;
71 sal_uInt32 mnOle2Misc
;
73 OUString maDisplayName
;
76 TransferableObjectDescriptor()
77 : mnViewAspect(::com::sun::star::embed::Aspects::MSOLE_CONTENT
)
82 SVT_DLLPUBLIC
friend SvStream
& operator>>( SvStream
& rIStm
, TransferableObjectDescriptor
& rObjDesc
);
83 SVT_DLLPUBLIC
friend SvStream
& operator<<( SvStream
& rOStm
, const TransferableObjectDescriptor
& rObjDesc
);
86 struct AcceptDropEvent
90 const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent maDragEvent
;
95 mnAction( DND_ACTION_NONE
),
96 mbLeaving( sal_False
),
97 mbDefault( sal_False
) {}
99 AcceptDropEvent( sal_Int8 nAction
,
100 const Point
& rPosPixel
,
101 const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& rDragEvent
,
102 sal_Bool bLeaving
= sal_False
) :
104 maPosPixel( rPosPixel
),
105 maDragEvent( rDragEvent
),
106 mbLeaving( bLeaving
),
107 mbDefault( sal_False
) {}
110 struct ExecuteDropEvent
114 const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent maDropEvent
;
118 mnAction( DND_ACTION_NONE
),
119 mbDefault( sal_False
) {}
121 ExecuteDropEvent( sal_Int8 nAction
,
122 const Point
& rPosPixel
,
123 const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& rDropEvent
) :
125 maPosPixel( rPosPixel
),
126 maDropEvent( rDropEvent
),
127 mbDefault( sal_False
) {}
130 class SVT_DLLPUBLIC TransferableHelper
: public ::cppu::WeakImplHelper4
< ::com::sun::star::datatransfer::XTransferable
,
131 ::com::sun::star::datatransfer::clipboard::XClipboardOwner
,
132 ::com::sun::star::datatransfer::dnd::XDragSourceListener
,
133 ::com::sun::star::lang::XUnoTunnel
>
137 // nested class to implement the XTerminateListener interface
138 class TerminateListener
: public ::cppu::WeakImplHelper1
< ::com::sun::star::frame::XTerminateListener
>
142 TransferableHelper
& mrParent
;
147 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw( ::com::sun::star::uno::RuntimeException
);
149 // XTerminateListener
150 virtual void SAL_CALL
queryTermination( const ::com::sun::star::lang::EventObject
& aEvent
) throw( ::com::sun::star::frame::TerminationVetoException
, ::com::sun::star::uno::RuntimeException
);
151 virtual void SAL_CALL
notifyTermination( const ::com::sun::star::lang::EventObject
& aEvent
) throw( ::com::sun::star::uno::RuntimeException
);
155 TerminateListener( TransferableHelper
& rDropTargetHelper
);
156 virtual ~TerminateListener();
159 friend class TransferableHelper::TerminateListener
;
163 ::com::sun::star::uno::Any maAny
;
164 OUString maLastFormat
;
165 mutable ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxClipboard
;
166 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XTerminateListener
> mxTerminateListener
;
167 DataFlavorExVector
* mpFormats
;
168 TransferableObjectDescriptor
* mpObjDesc
;
171 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
>&
172 getOwnClipboard() const { return mxClipboard
; }
177 virtual ::com::sun::star::uno::Any SAL_CALL
getTransferData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) throw(::com::sun::star::datatransfer::UnsupportedFlavorException
, ::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
);
178 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
> SAL_CALL
getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException
);
179 virtual sal_Bool SAL_CALL
isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) throw(::com::sun::star::uno::RuntimeException
);
182 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
184 // XDragSourceListener
185 virtual void SAL_CALL
dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& dsde
) throw(::com::sun::star::uno::RuntimeException
);
186 virtual void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw(::com::sun::star::uno::RuntimeException
);
187 virtual void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& dse
) throw(::com::sun::star::uno::RuntimeException
);
188 virtual void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw(::com::sun::star::uno::RuntimeException
);
189 virtual void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw(::com::sun::star::uno::RuntimeException
);
194 virtual void SAL_CALL
lostOwnership( const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
>& xClipboard
, const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& xTrans
) throw(::com::sun::star::uno::RuntimeException
);
197 // derivees need to access lostOwnership in case hey override it
198 // on windows, changing the access rights to a method gives unresolved externals, so we introduce
199 // this impl-method here 'til the next incompatible update
200 inline void implCallOwnLostOwnership(
201 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
>& _rxClipboard
,
202 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& _rxTrans
205 TransferableHelper::lostOwnership( _rxClipboard
, _rxTrans
);
211 SVT_DLLPRIVATE
void ImplFlush();
215 virtual ~TransferableHelper();
217 void AddFormat( SotFormatStringId nFormat
);
218 void AddFormat( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
219 void RemoveFormat( SotFormatStringId nFormat
);
220 void RemoveFormat( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
221 sal_Bool
HasFormat( SotFormatStringId nFormat
);
222 inline sal_Bool
HasFormat( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) { return isDataFlavorSupported( rFlavor
); }
225 sal_Bool
SetAny( const ::com::sun::star::uno::Any
& rAny
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
226 sal_Bool
SetString( const OUString
& rString
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
227 sal_Bool
SetBitmap( const Bitmap
& rBitmap
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
228 sal_Bool
SetGDIMetaFile( const GDIMetaFile
& rMtf
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
229 sal_Bool
SetGraphic( const Graphic
& rGraphic
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
230 sal_Bool
SetImageMap( const ImageMap
& rIMap
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
231 sal_Bool
SetTransferableObjectDescriptor( const TransferableObjectDescriptor
& rDesc
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
232 sal_Bool
SetINetBookmark( const INetBookmark
& rBmk
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
233 sal_Bool
SetINetImage( const INetImage
& rINtImg
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
234 sal_Bool
SetObject( void* pUserObject
, sal_uInt32 nUserObjectId
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
238 virtual void AddSupportedFormats() = 0;
239 virtual sal_Bool
GetData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) = 0;
240 virtual sal_Bool
WriteObject( SotStorageStreamRef
& rxOStm
, void* pUserObject
, sal_uInt32 nUserObjectId
, const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
241 virtual void DragFinished( sal_Int8 nDropAction
);
242 virtual void ObjectReleased();
246 TransferableHelper();
248 void PrepareOLE( const TransferableObjectDescriptor
& rObjDesc
);
250 void CopyToClipboard( Window
*pWindow
) const;
251 void CopyToSelection( Window
*pWindow
) const;
252 void StartDrag( Window
* pWindow
, sal_Int8 nDragSourceActions
,
253 sal_Int32 nDragPointer
= DND_POINTER_NONE
,
254 sal_Int32 nDragImage
= DND_IMAGE_NONE
);
256 static void ClearSelection( Window
*pWindow
);
258 static ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> GetSystemClipboard();
259 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
263 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rId
) throw( ::com::sun::star::uno::RuntimeException
);
266 struct TransferableDataHelper_Impl
;
268 class SVT_DLLPUBLIC TransferableDataHelper
270 friend class DropTargetHelper
;
274 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
> mxTransfer
;
275 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxClipboard
;
276 DataFlavorExVector
* mpFormats
;
277 TransferableObjectDescriptor
* mpObjDesc
;
278 TransferableDataHelper_Impl
* mpImpl
;
285 static void FillDataFlavorExVector( const ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
>& rDataFlavorSeq
,
286 DataFlavorExVector
& rDataFlavorExVector
);
288 TransferableDataHelper();
289 TransferableDataHelper( const TransferableDataHelper
& rDataHelper
);
290 TransferableDataHelper( const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& rxTransferable
);
291 ~TransferableDataHelper();
293 TransferableDataHelper
& operator=( const TransferableDataHelper
& rDataHelper
);
295 const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& GetTransferable() const { return mxTransfer
; }
296 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
> GetXTransferable() const;
298 sal_Bool
HasFormat( SotFormatStringId nFormat
) const;
299 sal_Bool
HasFormat( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) const;
301 sal_uInt32
GetFormatCount() const;
303 SotFormatStringId
GetFormat( sal_uInt32 nFormat
) const;
304 ::com::sun::star::datatransfer::DataFlavor
GetFormatDataFlavor( sal_uInt32 nFormat
) const;
306 DataFlavorExVector
& GetDataFlavorExVector() const {return *mpFormats
; }
308 sal_Bool
StartClipboardListening( );
309 void StopClipboardListening( );
311 void Rebind( const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::XTransferable
>& _rxNewData
);
315 ::com::sun::star::uno::Any
GetAny( SotFormatStringId nFormat
) const;
316 ::com::sun::star::uno::Any
GetAny( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
) const;
318 sal_Bool
GetString( SotFormatStringId nFormat
, String
& rStr
);
319 sal_Bool
GetString( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, String
& rStr
);
321 sal_Bool
GetString( SotFormatStringId nFormat
, OUString
& rStr
);
322 sal_Bool
GetString( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, OUString
& rStr
);
324 sal_Bool
GetBitmap( SotFormatStringId nFormat
, Bitmap
& rBmp
);
325 sal_Bool
GetBitmap( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, Bitmap
& rBmp
);
327 sal_Bool
GetGDIMetaFile( SotFormatStringId nFormat
, GDIMetaFile
& rMtf
);
328 sal_Bool
GetGDIMetaFile( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, GDIMetaFile
& rMtf
);
330 sal_Bool
GetGraphic( SotFormatStringId nFormat
, Graphic
& rGraphic
);
331 sal_Bool
GetGraphic( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, Graphic
& rGraphic
);
333 sal_Bool
GetImageMap( SotFormatStringId nFormat
, ImageMap
& rIMap
);
334 sal_Bool
GetImageMap( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, ImageMap
& rImap
);
336 sal_Bool
GetTransferableObjectDescriptor( SotFormatStringId nFormat
, TransferableObjectDescriptor
& rDesc
);
337 sal_Bool
GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, TransferableObjectDescriptor
& rDesc
);
339 sal_Bool
GetINetBookmark( SotFormatStringId nFormat
, INetBookmark
& rBmk
);
340 sal_Bool
GetINetBookmark( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, INetBookmark
& rBmk
);
342 sal_Bool
GetINetImage( SotFormatStringId nFormat
, INetImage
& rINtImg
);
343 sal_Bool
GetINetImage( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, INetImage
& rINtImg
);
345 sal_Bool
GetFileList( SotFormatStringId nFormat
, FileList
& rFileList
);
346 sal_Bool
GetFileList( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, FileList
& rFileList
);
348 sal_Bool
GetSequence( SotFormatStringId nFormat
, ::com::sun::star::uno::Sequence
< sal_Int8
>& rSeq
);
349 sal_Bool
GetSequence( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, ::com::sun::star::uno::Sequence
< sal_Int8
>& rSeq
);
351 sal_Bool
GetSotStorageStream( SotFormatStringId nFormat
, SotStorageStreamRef
& rStreamRef
);
352 sal_Bool
GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, SotStorageStreamRef
& rStreamRef
);
354 sal_Bool
GetInputStream( SotFormatStringId nFormat
, ::com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>& xStream
);
355 sal_Bool
GetInputStream( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, ::com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>& xStream
);
357 sal_Bool
GetInterface( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
, ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rIf
);
361 static TransferableDataHelper
CreateFromSystemClipboard( Window
* pWindow
);
362 static TransferableDataHelper
CreateFromSelection( Window
* pWindow
);
363 static sal_Bool
IsEqual( const ::com::sun::star::datatransfer::DataFlavor
& rInternalFlavor
,
364 const ::com::sun::star::datatransfer::DataFlavor
& rRequestFlavor
,
365 sal_Bool bCompareParameters
= sal_False
);
368 class SVT_DLLPUBLIC DragSourceHelper
372 // nested class to implement the XDragGestureListener interface
373 class DragGestureListener
: public ::cppu::WeakImplHelper1
< ::com::sun::star::datatransfer::dnd::XDragGestureListener
>
377 DragSourceHelper
& mrParent
;
382 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
384 // XDragGestureListener
385 virtual void SAL_CALL
dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& rDGE
) throw( ::com::sun::star::uno::RuntimeException
);
389 DragGestureListener( DragSourceHelper
& rDragSourceHelper
);
390 ~DragGestureListener();
393 friend class DragSourceHelper::DragGestureListener
;
397 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer
> mxDragGestureRecognizer
;
398 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragGestureListener
> mxDragGestureListener
;
402 DragSourceHelper
& operator=( const DragSourceHelper
& rDragSourceHelper
);
403 sal_Bool
operator==( const DragSourceHelper
& rDragSourceHelper
) const;
407 // to be overridden by the application
408 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
);
410 DragSourceHelper( Window
* pWindow
);
411 virtual ~DragSourceHelper();
414 class SVT_DLLPUBLIC DropTargetHelper
418 // nested class to implement the XDropTargetListener interface
419 class DropTargetListener
: public ::cppu::WeakImplHelper1
< ::com::sun::star::datatransfer::dnd::XDropTargetListener
>
423 DropTargetHelper
& mrParent
;
424 AcceptDropEvent
* mpLastDragOverEvent
;
429 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
431 // XDropTargetListener
432 virtual void SAL_CALL
drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
433 virtual void SAL_CALL
dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw(::com::sun::star::uno::RuntimeException
);
434 virtual void SAL_CALL
dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw(::com::sun::star::uno::RuntimeException
);
435 virtual void SAL_CALL
dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
436 virtual void SAL_CALL
dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(::com::sun::star::uno::RuntimeException
);
440 DropTargetListener( DropTargetHelper
& rDropTargetHelper
);
441 ~DropTargetListener();
444 friend class DropTargetHelper::DropTargetListener
;
448 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTarget
> mxDropTarget
;
449 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetListener
> mxDropTargetListener
;
450 DataFlavorExVector
* mpFormats
;
454 DropTargetHelper
& operator=( const DropTargetHelper
& rDropTargetHelper
);
455 sal_Bool
operator==( const DropTargetHelper
& rDropTargetHelper
) const;
457 void ImplConstruct();
459 // called by our own implementation of XDropTargetListener (DropTargetListener instance)
460 void ImplBeginDrag( const ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
>& rSupportedDataFlavors
);
465 // to be overridden by the application
466 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
467 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
469 DropTargetHelper( Window
* pWindow
);
470 DropTargetHelper( const ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTarget
>& rxDropTarget
);
472 virtual ~DropTargetHelper();
474 // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
475 sal_Bool
IsDropFormatSupported( SotFormatStringId nFormat
);
476 sal_Bool
IsDropFormatSupported( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
478 DataFlavorExVector
& GetDataFlavorExVector() const {return *mpFormats
; }
482 struct TransferDataContainer_Impl
;
484 class SVT_DLLPUBLIC TransferDataContainer
: public TransferableHelper
486 TransferDataContainer_Impl
* pImpl
;
490 virtual void AddSupportedFormats();
491 virtual sal_Bool
GetData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
492 virtual void DragFinished( sal_Int8 nDropAction
);
496 TransferDataContainer();
497 ~TransferDataContainer();
499 void CopyINetBookmark( const INetBookmark
& rBkmk
);
500 void CopyINetImage( const INetImage
& rINtImg
);
501 void CopyImageMap( const ImageMap
& rImgMap
);
502 void CopyGraphic( const Graphic
& rGrf
);
503 void CopyString( const String
& rStr
);
504 void CopyString( sal_uInt16 nFmt
, const String
& rStr
);
505 void CopyAny( sal_uInt16 nFmt
, const ::com::sun::star::uno::Any
& rAny
);
507 void CopyByteString( sal_uLong nFormatId
, const OString
& rStr
);
508 void CopyAnyData( sal_uLong nFormatId
, const sal_Char
* pData
, sal_uLong nLen
);
510 sal_Bool
HasAnyData() const;
512 using TransferableHelper::StartDrag
;
513 void StartDrag( Window
* pWindow
, sal_Int8 nDragSourceActions
,
514 const Link
& rCallbck
,
515 sal_Int32 nDragPointer
= DND_POINTER_NONE
,
516 sal_Int32 nDragImage
= DND_IMAGE_NONE
);
521 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */