LibreOffice Module vcl (master)  1
transfer.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_TRANSFER_HXX
21 #define INCLUDED_VCL_TRANSFER_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <tools/globname.hxx>
25 #include <tools/gen.hxx>
26 #include <tools/solar.h>
27 #include <sot/formats.hxx>
28 #include <sot/exchange.hxx>
29 #include <cppuhelper/implbase.hxx>
30 #include <com/sun/star/frame/XTerminateListener.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/lang/XUnoTunnel.hpp>
33 #include <com/sun/star/datatransfer/XTransferable2.hpp>
34 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
35 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
36 #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
37 #include <com/sun/star/datatransfer/dnd/XDragGestureListener.hpp>
38 #include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp>
39 #include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp>
40 #include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp>
41 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
42 #include <com/sun/star/embed/Aspects.hpp>
43 #include <memory>
44 
45 namespace com { namespace sun { namespace star { namespace datatransfer { namespace dnd { class XDragGestureRecognizer; } } } } }
46 namespace com { namespace sun { namespace star { namespace io { class XInputStream; } } } }
47 namespace com { namespace sun { namespace star { namespace datatransfer { namespace dnd { class XDropTarget; } } } } }
48 
49 namespace tools { template <typename T> class SvRef; }
50 template <typename Arg, typename Ret> class Link;
51 
52 class BitmapEx;
53 class GDIMetaFile;
54 class Graphic;
55 class ImageMap;
56 class INetBookmark;
57 class INetImage;
58 class FileList;
59 class SotStorageStream;
60 namespace vcl { class Window; }
61 
62 // Drag&Drop defines
63 
64 #define DND_ACTION_NONE css::datatransfer::dnd::DNDConstants::ACTION_NONE
65 #define DND_ACTION_COPY css::datatransfer::dnd::DNDConstants::ACTION_COPY
66 #define DND_ACTION_MOVE css::datatransfer::dnd::DNDConstants::ACTION_MOVE
67 #define DND_ACTION_COPYMOVE css::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
68 #define DND_ACTION_LINK css::datatransfer::dnd::DNDConstants::ACTION_LINK
69 
70 #define DND_POINTER_NONE 0
71 #define DND_IMAGE_NONE 0
72 
74 {
76  sal_uInt16 mnViewAspect;
79  OUString maTypeName;
80  OUString maDisplayName;
81 
83  : mnViewAspect(css::embed::Aspects::MSOLE_CONTENT)
84  {}
85 
87 };
88 
90 {
93  const css::datatransfer::dnd::DropTargetDragEvent maDragEvent;
94  bool mbLeaving;
95  bool mbDefault;
96 
98  mnAction( DND_ACTION_NONE ),
99  mbLeaving( false ),
100  mbDefault( false ) {}
101 
103  const Point& rPosPixel,
104  const css::datatransfer::dnd::DropTargetDragEvent& rDragEvent ) :
105  mnAction( nAction ),
106  maPosPixel( rPosPixel ),
107  maDragEvent( rDragEvent ),
108  mbLeaving( false ),
109  mbDefault( false ) {}
110 };
111 
113 {
116  const css::datatransfer::dnd::DropTargetDropEvent maDropEvent;
117  bool mbDefault;
118 
120  const Point& rPosPixel,
121  const css::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
122  mnAction( nAction ),
123  maPosPixel( rPosPixel ),
124  maDropEvent( rDropEvent ),
125  mbDefault( false ) {}
126 };
127 
128 class VCL_DLLPUBLIC TransferableHelper : public cppu::WeakImplHelper< css::datatransfer::XTransferable2,
129  css::datatransfer::clipboard::XClipboardOwner,
130  css::datatransfer::dnd::XDragSourceListener,
131  css::lang::XUnoTunnel >
132 {
133 private:
134 
135  // nested class to implement the XTerminateListener interface
136  class TerminateListener : public cppu::WeakImplHelper< css::frame::XTerminateListener, css::lang::XServiceInfo >
137  {
138  private:
139 
141 
142  private:
143 
144  // XEventListener
145  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
146 
147  // XTerminateListener
148  virtual void SAL_CALL queryTermination( const css::lang::EventObject& aEvent ) override;
149  virtual void SAL_CALL notifyTermination( const css::lang::EventObject& aEvent ) override;
150 
151  // XServiceInfo
152  virtual OUString SAL_CALL getImplementationName() override;
153  virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override;
154  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
155 
156  public:
157 
158  TerminateListener( TransferableHelper& rDropTargetHelper );
159  virtual ~TerminateListener() override;
160  };
161 
163 
164 private:
165 
166  css::uno::Any maAny;
167  OUString maLastFormat;
168  mutable css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
169  css::uno::Reference< css::frame::XTerminateListener > mxTerminateListener;
171  std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
172 
173 protected:
174  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >&
175  getOwnClipboard() const { return mxClipboard; }
176 
177 private:
178 
179  // XTransferable
180  virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& rFlavor ) override;
181  virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override;
182  virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& rFlavor ) override;
183 
184  // Transferable2
185  virtual css::uno::Any SAL_CALL getTransferData2(
186  const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
187  virtual sal_Bool SAL_CALL isComplex() override;
188 
189  // XEventListener
190  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
191 
192  // XDragSourceListener
193  virtual void SAL_CALL dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent& dsde ) override;
194  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
195  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DragSourceEvent& dse ) override;
196  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
197  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
198 
199 private:
200 
201  // XClipboardOwner
202  virtual void SAL_CALL lostOwnership( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard, const css::uno::Reference< css::datatransfer::XTransferable >& xTrans ) override;
203 
204 protected:
205  // derivees need to access lostOwnership in case hey override it
206  // on windows, changing the access rights to a method gives unresolved externals, so we introduce
207  // this impl-method here 'til the next incompatible update
209  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& _rxClipboard,
210  const css::uno::Reference< css::datatransfer::XTransferable >& _rxTrans
211  )
212  {
213  TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
214  }
215 
216 
217 private:
218 
219  VCL_DLLPRIVATE void ImplFlush();
220 
221 protected:
222 
223  void AddFormat( SotClipboardFormatId nFormat );
224  void AddFormat( const css::datatransfer::DataFlavor& rFlavor );
225  void RemoveFormat( SotClipboardFormatId nFormat );
226  void RemoveFormat( const css::datatransfer::DataFlavor& rFlavor );
227  bool HasFormat( SotClipboardFormatId nFormat );
228  void ClearFormats();
229 
230  bool SetAny( const css::uno::Any& rAny );
231  bool SetString( const OUString& rString, const css::datatransfer::DataFlavor& rFlavor );
232  bool SetBitmapEx( const BitmapEx& rBitmap, const css::datatransfer::DataFlavor& rFlavor );
233  bool SetGDIMetaFile( const GDIMetaFile& rMtf );
234  bool SetGraphic( const Graphic& rGraphic );
235  bool SetImageMap( const ImageMap& rIMap );
237  bool SetINetBookmark( const INetBookmark& rBmk, const css::datatransfer::DataFlavor& rFlavor );
238  bool SetINetImage( const INetImage& rINtImg, const css::datatransfer::DataFlavor& rFlavor );
239  bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
240 
241 protected:
242 
243  virtual void AddSupportedFormats() = 0;
244  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0;
245  virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
246  virtual void DragFinished( sal_Int8 nDropAction );
247  virtual void ObjectReleased();
248 
249 public:
250 
251  void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
252 
253  void CopyToClipboard( vcl::Window *pWindow ) const;
254  void CopyToSelection( vcl::Window *pWindow ) const;
255  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions );
256 
257  static void ClearSelection( vcl::Window *pWindow );
258 
259  static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
260 
261 public:
262 
263  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
264 };
265 
267 
269 {
270  friend class DropTargetHelper;
271 
272  css::uno::Reference< css::datatransfer::XTransferable > mxTransfer;
273  css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
275  std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
276  std::unique_ptr<TransferableDataHelper_Impl> mxImpl;
277 
278  void InitFormats();
279 
280 public:
281 
282  static void FillDataFlavorExVector( const css::uno::Sequence< css::datatransfer::DataFlavor >& rDataFlavorSeq,
283  DataFlavorExVector& rDataFlavorExVector );
284 
286  TransferableDataHelper( const TransferableDataHelper& rDataHelper );
287  TransferableDataHelper( TransferableDataHelper&& rDataHelper ) noexcept;
288  TransferableDataHelper( const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable );
290 
291  TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
292  TransferableDataHelper& operator=( TransferableDataHelper&& rDataHelper );
293 
294  const css::uno::Reference< css::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
295  css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const;
296 
297  bool HasFormat( SotClipboardFormatId nFormat ) const;
298  bool HasFormat( const css::datatransfer::DataFlavor& rFlavor ) const;
299 
300  sal_uInt32 GetFormatCount() const;
301 
302  SotClipboardFormatId GetFormat( sal_uInt32 nFormat ) const;
303  css::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
304 
306 
307  bool StartClipboardListening( );
308  void StopClipboardListening( );
309 
310  void Rebind( const css::uno::Reference< css::datatransfer::XTransferable >& _rxNewData );
311 
312  css::uno::Any GetAny( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const;
313  css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const;
314 
315  bool GetString( SotClipboardFormatId nFormat, OUString& rStr );
316  bool GetString( const css::datatransfer::DataFlavor& rFlavor, OUString& rStr );
317 
318  bool GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmp );
319  bool GetBitmapEx( const css::datatransfer::DataFlavor& rFlavor, BitmapEx& rBmp );
320 
329  bool GetGDIMetaFile( SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions = 0 );
330  bool GetGDIMetaFile( const css::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
331 
332  bool GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic );
333  bool GetGraphic( const css::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
334 
335  bool GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap );
336  bool GetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
337 
338  bool GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc );
339  bool GetTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc );
340 
341  bool GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk );
342  bool GetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
343 
344  bool GetINetImage( SotClipboardFormatId nFormat, INetImage& rINtImg );
345  bool GetINetImage( const css::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
346 
347  bool GetFileList( SotClipboardFormatId nFormat, FileList& rFileList );
348  bool GetFileList( FileList& rFileList );
349 
350  css::uno::Sequence<sal_Int8> GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc );
351  css::uno::Sequence<sal_Int8> GetSequence( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
352 
353  bool GetSotStorageStream( SotClipboardFormatId nFormat, tools::SvRef<SotStorageStream>& rStreamRef );
354  bool GetSotStorageStream( const css::datatransfer::DataFlavor& rFlavor, tools::SvRef<SotStorageStream>& rStreamRef );
355 
356  css::uno::Reference<css::io::XInputStream> GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc );
357  css::uno::Reference<css::io::XInputStream> GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
358 
359  static TransferableDataHelper CreateFromSystemClipboard( vcl::Window * pWindow );
360  static TransferableDataHelper CreateFromSelection( vcl::Window * pWindow );
361  static bool IsEqual( const css::datatransfer::DataFlavor& rInternalFlavor,
362  const css::datatransfer::DataFlavor& rRequestFlavor );
363 };
364 
366 {
367 private:
368 
369  // nested class to implement the XDragGestureListener interface
370  class DragGestureListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDragGestureListener >
371  {
372  private:
373 
375 
376  private:
377 
378  // XEventListener
379  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
380 
381  // XDragGestureListener
382  virtual void SAL_CALL dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& rDGE ) override;
383 
384  public:
385 
386  DragGestureListener( DragSourceHelper& rDragSourceHelper );
387  virtual ~DragGestureListener() override;
388  };
389 
391 
392 private:
393  osl::Mutex maMutex;
394  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
395 
396  css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
397 
398  DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper ) = delete;
399  bool operator==( const DragSourceHelper& rDragSourceHelper ) const = delete;
400 
401 public:
402 
403  // to be overridden by the application
404  virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
405 
406  DragSourceHelper( vcl::Window* pWindow );
407  void dispose();
408  virtual ~DragSourceHelper();
409 };
410 
412 {
413 private:
414 
415  // nested class to implement the XDropTargetListener interface
416  class DropTargetListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDropTargetListener >
417  {
418  private:
419 
421  std::unique_ptr<AcceptDropEvent> mpLastDragOverEvent;
422 
423  // XEventListener
424  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
425 
426  // XDropTargetListener
427  virtual void SAL_CALL drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override;
428  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override;
429  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ) override;
430  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
431  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
432 
433  public:
434 
435  DropTargetListener( DropTargetHelper& rDropTargetHelper );
436  virtual ~DropTargetListener() override;
437  };
438 
440 
441 private:
442  osl::Mutex maMutex;
443  css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget;
444 
445  css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
447 
448  DropTargetHelper() = delete;
449  DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper ) = delete;
450  bool operator==( const DropTargetHelper& rDropTargetHelper ) const = delete;
451 
452  void ImplConstruct();
453 
454  // called by our own implementation of XDropTargetListener (DropTargetListener instance)
455  void ImplBeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors );
456  void ImplEndDrag();
457 
458 public:
459 
460  // to be overridden by the application
461  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
462  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
463 
464  DropTargetHelper( vcl::Window* pWindow );
465  DropTargetHelper( const css::uno::Reference< css::datatransfer::dnd::XDropTarget >& rxDropTarget );
466 
467  void dispose();
468  virtual ~DropTargetHelper();
469 
470  // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
472 
474 
475 };
476 
478 
480 {
481  std::unique_ptr<TransferDataContainer_Impl> pImpl;
482 
483 protected:
484 
485  virtual void AddSupportedFormats() override;
486  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
487  virtual void DragFinished( sal_Int8 nDropAction ) override;
488 
489 public:
490 
492  virtual ~TransferDataContainer() override;
493 
494  void CopyINetBookmark( const INetBookmark& rBkmk );
495  void CopyString( const OUString& rStr );
496  void CopyString( SotClipboardFormatId nFmt, const OUString& rStr );
497 
498  void CopyByteString( SotClipboardFormatId nFormatId, const OString& rStr );
499  void CopyAnyData( SotClipboardFormatId nFormatId, const sal_Char* pData, sal_uLong nLen );
500 
501  bool HasAnyData() const;
502 
504  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions,
505  const Link<sal_Int8,void>& rCallbck );
506 };
507 
508 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemClipboard();
509 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemPrimarySelection();
510 
511 #endif
512 
513 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: transfer.cxx:242
bool SetINetImage(const INetImage &rINtImg, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:850
VCL_DLLPRIVATE void ImplFlush()
Definition: transfer.cxx:516
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
Definition: transfer.hxx:116
DropTargetHelper()=delete
css::uno::Reference< css::frame::XTerminateListener > mxTerminateListener
Definition: transfer.hxx:169
bool SetBitmapEx(const BitmapEx &rBitmap, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:662
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:414
virtual void SAL_CALL dragOver(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:491
virtual void AddSupportedFormats()=0
signed char sal_Int8
OUString maLastFormat
Definition: transfer.hxx:167
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
::std::vector< DataFlavorEx > DataFlavorExVector
sal_uIntPtr sal_uLong
css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer
Definition: transfer.hxx:394
bool SetTransferableObjectDescriptor(const TransferableObjectDescriptor &rDesc)
Definition: transfer.cxx:748
bool IsDropFormatSupported(SotClipboardFormatId nFormat)
Definition: transfer2.cxx:296
bool HasFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:619
DataFlavorExVector maFormats
Definition: transfer.hxx:274
OUString getImplementationName()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemClipboard()
Definition: transfer2.cxx:461
virtual bool WriteObject(tools::SvRef< SotStorageStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:894
virtual void DragFinished(sal_Int8 nDropAction)
Definition: transfer.cxx:901
virtual sal_Bool SAL_CALL isComplex() override
Definition: transfer.cxx:390
css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget
Definition: transfer.hxx:443
void ImplBeginDrag(const css::uno::Sequence< css::datatransfer::DataFlavor > &rSupportedDataFlavors)
Definition: transfer2.cxx:271
DragSourceHelper(vcl::Window *pWindow)
Definition: transfer2.cxx:69
bool SetINetBookmark(const INetBookmark &rBmk, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:761
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:864
OUString GetString(int nId)
void AddFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:536
DataFlavorExVector maFormats
Definition: transfer.hxx:170
osl::Mutex maMutex
Definition: transfer.hxx:393
char sal_Char
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:473
#define DND_ACTION_NONE
Definition: transfer.hxx:64
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual css::uno::Any SAL_CALL getTransferData2(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) override
Definition: transfer.cxx:278
void ImplConstruct()
Definition: transfer2.cxx:260
VCL_DLLPUBLIC friend SvStream & WriteTransferableObjectDescriptor(SvStream &rOStm, const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:81
SotClipboardFormatId
std::unique_ptr< TransferableDataHelper_Impl > mxImpl
Definition: transfer.hxx:276
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:275
std::unique_ptr< TransferDataContainer_Impl > pImpl
Definition: transfer.hxx:481
virtual void SAL_CALL dragEnter(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:481
virtual void SAL_CALL dropActionChanged(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:496
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: transfer2.cxx:290
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:203
ExecuteDropEvent(sal_Int8 nAction, const Point &rPosPixel, const css::datatransfer::dnd::DropTargetDropEvent &rDropEvent)
Definition: transfer.hxx:119
sal_Int8 mnAction
Definition: transfer.hxx:114
bool SetGraphic(const Graphic &rGraphic)
Definition: transfer.cxx:720
void RemoveFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:596
void implCallOwnLostOwnership(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &_rxClipboard, const css::uno::Reference< css::datatransfer::XTransferable > &_rxTrans)
Definition: transfer.hxx:208
css::uno::Sequence< OUString > getSupportedServiceNames()
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
Definition: transfer2.cxx:284
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: transfer.cxx:1030
unsigned char sal_Bool
virtual ~DropTargetHelper()
Definition: transfer2.cxx:254
void PrepareOLE(const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:911
void CopyToClipboard(vcl::Window *pWindow) const
Definition: transfer.cxx:920
const css::uno::Reference< css::datatransfer::clipboard::XClipboard > & getOwnClipboard() const
Definition: transfer.hxx:175
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
Definition: transfer.cxx:975
static void ClearSelection(vcl::Window *pWindow)
Definition: transfer.cxx:1016
osl::Mutex maMutex
Definition: transfer.hxx:442
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:171
virtual void SAL_CALL dragExit(const css::datatransfer::dnd::DragSourceEvent &dse) override
Definition: transfer.cxx:486
virtual void SAL_CALL dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
Definition: transfer.cxx:466
virtual void SAL_CALL lostOwnership(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &xClipboard, const css::uno::Reference< css::datatransfer::XTransferable > &xTrans) override
Definition: transfer.cxx:439
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
Definition: transfer.cxx:501
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
Definition: transfer.cxx:397
bool SetImageMap(const ImageMap &rIMap)
Definition: transfer.cxx:736
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:168
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener
Definition: transfer.hxx:445
virtual void ObjectReleased()
Definition: transfer.cxx:906
std::unique_ptr< AcceptDropEvent > mpLastDragOverEvent
Definition: transfer.hxx:421
DragSourceHelper & operator=(const DragSourceHelper &rDragSourceHelper)=delete
Point maPosPixel
Definition: transfer.hxx:92
css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener
Definition: transfer.hxx:396
virtual ~DragSourceHelper()
Definition: transfer2.cxx:92
css::uno::Reference< css::datatransfer::XTransferable > mxTransfer
Definition: transfer.hxx:272
css::uno::Any maAny
Definition: transfer.hxx:166
void CopyToSelection(vcl::Window *pWindow) const
Definition: transfer.cxx:949
#define VCL_DLLPRIVATE
Definition: dllapi.h:31
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemPrimarySelection()
Definition: transfer2.cxx:473
DataFlavorExVector maFormats
Definition: transfer.hxx:446
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:273
bool SetAny(const css::uno::Any &rAny)
Definition: transfer.cxx:633
sal_Int8 mnAction
Definition: transfer.hxx:91
bool SetString(const OUString &rString, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:640
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:273
bool SetGDIMetaFile(const GDIMetaFile &rMtf)
Definition: transfer.cxx:706
const css::datatransfer::dnd::DropTargetDragEvent maDragEvent
Definition: transfer.hxx:93
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc)=0
DropTargetHelper & operator=(const DropTargetHelper &rDropTargetHelper)=delete
AcceptDropEvent(sal_Int8 nAction, const Point &rPosPixel, const css::datatransfer::dnd::DropTargetDragEvent &rDragEvent)
Definition: transfer.hxx:102
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:305