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:
175 
176  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >&
177  getOwnClipboard() const { return mxClipboard; }
178 
179 private:
180 
181  // XTransferable
182  virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& rFlavor ) override;
183  virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override;
184  virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& rFlavor ) override;
185 
186  // Transferable2
187  virtual css::uno::Any SAL_CALL getTransferData2(
188  const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
189  virtual sal_Bool SAL_CALL isComplex() override;
190 
191  // XEventListener
192  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
193 
194  // XDragSourceListener
195  virtual void SAL_CALL dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent& dsde ) override;
196  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
197  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DragSourceEvent& dse ) override;
198  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
199  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
200 
201 private:
202 
203  // XClipboardOwner
204  virtual void SAL_CALL lostOwnership( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard, const css::uno::Reference< css::datatransfer::XTransferable >& xTrans ) override;
205 
206 protected:
207  // derivees need to access lostOwnership in case hey override it
208  // on windows, changing the access rights to a method gives unresolved externals, so we introduce
209  // this impl-method here 'til the next incompatible update
211  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& _rxClipboard,
212  const css::uno::Reference< css::datatransfer::XTransferable >& _rxTrans
213  )
214  {
215  TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
216  }
217 
218 
219 private:
220 
221  VCL_DLLPRIVATE void ImplFlush();
222 
223 protected:
224 
225  void AddFormat( SotClipboardFormatId nFormat );
226  void AddFormat( const css::datatransfer::DataFlavor& rFlavor );
227  void RemoveFormat( SotClipboardFormatId nFormat );
228  void RemoveFormat( const css::datatransfer::DataFlavor& rFlavor );
229  bool HasFormat( SotClipboardFormatId nFormat );
230  void ClearFormats();
231 
232  bool SetAny( const css::uno::Any& rAny );
233  bool SetString( const OUString& rString, const css::datatransfer::DataFlavor& rFlavor );
234  bool SetBitmapEx( const BitmapEx& rBitmap, const css::datatransfer::DataFlavor& rFlavor );
235  bool SetGDIMetaFile( const GDIMetaFile& rMtf );
236  bool SetGraphic( const Graphic& rGraphic );
237  bool SetImageMap( const ImageMap& rIMap );
239  bool SetINetBookmark( const INetBookmark& rBmk, const css::datatransfer::DataFlavor& rFlavor );
240  bool SetINetImage( const INetImage& rINtImg, const css::datatransfer::DataFlavor& rFlavor );
241  bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
242 
243 protected:
244 
245  virtual void AddSupportedFormats() = 0;
246  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0;
247  virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
248  virtual void DragFinished( sal_Int8 nDropAction );
249  virtual void ObjectReleased();
250 
251 public:
252 
253  void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
254 
255  void CopyToClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard> &rClipboard) const;
256  void CopyToSelection(const css::uno::Reference<css::datatransfer::clipboard::XClipboard> &rClipboard) const;
257 
258  // convenience versions of the above which extract the XClipboard from the pWindow
259  void CopyToClipboard( vcl::Window *pWindow ) const;
260  void CopyToSelection( vcl::Window *pWindow ) const;
261 
262  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions );
263 
264  static void ClearSelection( vcl::Window *pWindow );
265 
266  static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
267 
268 public:
269 
270  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
271 };
272 
274 
276 {
277  friend class DropTargetHelper;
278 
279  css::uno::Reference< css::datatransfer::XTransferable > mxTransfer;
280  css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
282  std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
283  std::unique_ptr<TransferableDataHelper_Impl> mxImpl;
284 
285  void InitFormats();
286 
287 public:
288 
289  static void FillDataFlavorExVector( const css::uno::Sequence< css::datatransfer::DataFlavor >& rDataFlavorSeq,
290  DataFlavorExVector& rDataFlavorExVector );
291 
293  TransferableDataHelper( const TransferableDataHelper& rDataHelper );
294  TransferableDataHelper( TransferableDataHelper&& rDataHelper ) noexcept;
295  TransferableDataHelper( const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable );
297 
298  TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
299  TransferableDataHelper& operator=( TransferableDataHelper&& rDataHelper );
300 
301  const css::uno::Reference< css::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
302  css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const;
303 
304  bool HasFormat( SotClipboardFormatId nFormat ) const;
305  bool HasFormat( const css::datatransfer::DataFlavor& rFlavor ) const;
306 
307  sal_uInt32 GetFormatCount() const;
308 
309  SotClipboardFormatId GetFormat( sal_uInt32 nFormat ) const;
310  css::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
311 
313 
314  bool StartClipboardListening( );
315  void StopClipboardListening( );
316 
317  void Rebind( const css::uno::Reference< css::datatransfer::XTransferable >& _rxNewData );
318 
319  css::uno::Any GetAny( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const;
320  css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const;
321 
322  bool GetString( SotClipboardFormatId nFormat, OUString& rStr );
323  bool GetString( const css::datatransfer::DataFlavor& rFlavor, OUString& rStr );
324 
325  bool GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmp );
326  bool GetBitmapEx( const css::datatransfer::DataFlavor& rFlavor, BitmapEx& rBmp );
327 
336  bool GetGDIMetaFile( SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions = 0 );
337  bool GetGDIMetaFile( const css::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
338 
339  bool GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic );
340  bool GetGraphic( const css::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
341 
342  bool GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap );
343  bool GetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
344 
345  bool GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc );
346  bool GetTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc );
347 
348  bool GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk );
349  bool GetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
350 
351  bool GetINetImage( SotClipboardFormatId nFormat, INetImage& rINtImg );
352  bool GetINetImage( const css::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
353 
354  bool GetFileList( SotClipboardFormatId nFormat, FileList& rFileList );
355  bool GetFileList( FileList& rFileList );
356 
357  css::uno::Sequence<sal_Int8> GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc );
358  css::uno::Sequence<sal_Int8> GetSequence( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
359 
360  bool GetSotStorageStream( SotClipboardFormatId nFormat, tools::SvRef<SotStorageStream>& rStreamRef );
361  bool GetSotStorageStream( const css::datatransfer::DataFlavor& rFlavor, tools::SvRef<SotStorageStream>& rStreamRef );
362 
363  css::uno::Reference<css::io::XInputStream> GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc );
364  css::uno::Reference<css::io::XInputStream> GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
365 
366  static TransferableDataHelper CreateFromSystemClipboard( vcl::Window * pWindow );
367  static TransferableDataHelper CreateFromSelection( vcl::Window * pWindow );
368  static bool IsEqual( const css::datatransfer::DataFlavor& rInternalFlavor,
369  const css::datatransfer::DataFlavor& rRequestFlavor );
370 };
371 
373 {
374 private:
375 
376  // nested class to implement the XDragGestureListener interface
377  class DragGestureListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDragGestureListener >
378  {
379  private:
380 
382 
383  private:
384 
385  // XEventListener
386  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
387 
388  // XDragGestureListener
389  virtual void SAL_CALL dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& rDGE ) override;
390 
391  public:
392 
393  DragGestureListener( DragSourceHelper& rDragSourceHelper );
394  virtual ~DragGestureListener() override;
395  };
396 
398 
399 private:
400  osl::Mutex maMutex;
401  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
402 
403  css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
404 
405  DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper ) = delete;
406  bool operator==( const DragSourceHelper& rDragSourceHelper ) const = delete;
407 
408 public:
409 
410  // to be overridden by the application
411  virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
412 
413  DragSourceHelper( vcl::Window* pWindow );
414  void dispose();
415  virtual ~DragSourceHelper();
416 };
417 
419 {
420 private:
421 
422  // nested class to implement the XDropTargetListener interface
423  class DropTargetListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDropTargetListener >
424  {
425  private:
426 
428  std::unique_ptr<AcceptDropEvent> mpLastDragOverEvent;
429 
430  // XEventListener
431  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
432 
433  // XDropTargetListener
434  virtual void SAL_CALL drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override;
435  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override;
436  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ) override;
437  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
438  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
439 
440  public:
441 
442  DropTargetListener( DropTargetHelper& rDropTargetHelper );
443  virtual ~DropTargetListener() override;
444  };
445 
447 
448 private:
449  osl::Mutex maMutex;
450  css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget;
451 
452  css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
454 
455  DropTargetHelper() = delete;
456  DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper ) = delete;
457  bool operator==( const DropTargetHelper& rDropTargetHelper ) const = delete;
458 
459  void ImplConstruct();
460 
461  // called by our own implementation of XDropTargetListener (DropTargetListener instance)
462  void ImplBeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors );
463  void ImplEndDrag();
464 
465 public:
466 
467  // to be overridden by the application
468  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
469  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
470 
471  DropTargetHelper( vcl::Window* pWindow );
472  DropTargetHelper( const css::uno::Reference< css::datatransfer::dnd::XDropTarget >& rxDropTarget );
473 
474  void dispose();
475  virtual ~DropTargetHelper();
476 
477  // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
479 
481 
482 };
483 
485 
487 {
488  std::unique_ptr<TransferDataContainer_Impl> pImpl;
489 
490  virtual void AddSupportedFormats() override;
491  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
492  virtual void DragFinished( sal_Int8 nDropAction ) override;
493 
494 public:
495 
497  virtual ~TransferDataContainer() override;
498 
499  void CopyINetBookmark( const INetBookmark& rBkmk );
500  void CopyString( const OUString& rStr );
501  void CopyString( SotClipboardFormatId nFmt, const OUString& rStr );
502 
503  void CopyByteString( SotClipboardFormatId nFormatId, const OString& rStr );
504  void CopyAnyData( SotClipboardFormatId nFormatId, const sal_Char* pData, sal_uLong nLen );
505 
506  bool HasAnyData() const;
507 
509  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions,
510  const Link<sal_Int8,void>& rCallbck );
511 };
512 
513 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemClipboard();
514 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemPrimarySelection();
515 
516 #endif
517 
518 /* 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:862
VCL_DLLPRIVATE void ImplFlush()
Definition: transfer.cxx:528
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:674
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:426
virtual void SAL_CALL dragOver(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:503
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:401
bool SetTransferableObjectDescriptor(const TransferableObjectDescriptor &rDesc)
Definition: transfer.cxx:760
bool IsDropFormatSupported(SotClipboardFormatId nFormat)
Definition: transfer2.cxx:296
bool HasFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:631
DataFlavorExVector maFormats
Definition: transfer.hxx:281
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:906
virtual void DragFinished(sal_Int8 nDropAction)
Definition: transfer.cxx:913
virtual sal_Bool SAL_CALL isComplex() override
Definition: transfer.cxx:402
css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget
Definition: transfer.hxx:450
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:773
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:876
OUString GetString(int nId)
void AddFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:548
DataFlavorExVector maFormats
Definition: transfer.hxx:170
osl::Mutex maMutex
Definition: transfer.hxx:400
char sal_Char
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:480
#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:290
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:283
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:282
std::unique_ptr< TransferDataContainer_Impl > pImpl
Definition: transfer.hxx:488
virtual void SAL_CALL dragEnter(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:493
virtual void SAL_CALL dropActionChanged(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:508
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:732
void RemoveFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:608
void implCallOwnLostOwnership(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &_rxClipboard, const css::uno::Reference< css::datatransfer::XTransferable > &_rxTrans)
Definition: transfer.hxx:210
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:1049
unsigned char sal_Bool
virtual ~DropTargetHelper()
Definition: transfer2.cxx:254
void PrepareOLE(const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:923
const css::uno::Reference< css::datatransfer::clipboard::XClipboard > & getOwnClipboard() const
Definition: transfer.hxx:177
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
Definition: transfer.cxx:994
static void ClearSelection(vcl::Window *pWindow)
Definition: transfer.cxx:1035
void CopyToClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
osl::Mutex maMutex
Definition: transfer.hxx:449
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:171
virtual void SAL_CALL dragExit(const css::datatransfer::dnd::DragSourceEvent &dse) override
Definition: transfer.cxx:498
virtual void SAL_CALL dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
Definition: transfer.cxx:478
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:451
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
Definition: transfer.cxx:513
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
Definition: transfer.cxx:409
bool SetImageMap(const ImageMap &rIMap)
Definition: transfer.cxx:748
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:168
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener
Definition: transfer.hxx:452
virtual void ObjectReleased()
Definition: transfer.cxx:918
std::unique_ptr< AcceptDropEvent > mpLastDragOverEvent
Definition: transfer.hxx:428
DragSourceHelper & operator=(const DragSourceHelper &rDragSourceHelper)=delete
Point maPosPixel
Definition: transfer.hxx:92
css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener
Definition: transfer.hxx:403
virtual ~DragSourceHelper()
Definition: transfer2.cxx:92
css::uno::Reference< css::datatransfer::XTransferable > mxTransfer
Definition: transfer.hxx:279
css::uno::Any maAny
Definition: transfer.hxx:166
#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:453
void CopyToSelection(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:280
bool SetAny(const css::uno::Any &rAny)
Definition: transfer.cxx:645
sal_Int8 mnAction
Definition: transfer.hxx:91
bool SetString(const OUString &rString, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:652
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:285
bool SetGDIMetaFile(const GDIMetaFile &rMtf)
Definition: transfer.cxx:718
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:312