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 #include <mutex>
45 
46 namespace com::sun::star::datatransfer::dnd { class XDragGestureRecognizer; }
47 namespace com::sun::star::io { class XInputStream; }
48 namespace com::sun::star::datatransfer::dnd { class XDropTarget; }
49 
50 namespace tools { template <typename T> class SvRef; }
51 template <typename Arg, typename Ret> class Link;
52 
53 class BitmapEx;
54 class GDIMetaFile;
55 class Graphic;
56 class ImageMap;
57 class INetBookmark;
58 class INetImage;
59 class FileList;
60 class SotStorageStream;
61 class SotTempStream;
62 namespace vcl { class Window; }
63 
64 // Drag&Drop defines
65 
66 #define DND_ACTION_NONE css::datatransfer::dnd::DNDConstants::ACTION_NONE
67 #define DND_ACTION_COPY css::datatransfer::dnd::DNDConstants::ACTION_COPY
68 #define DND_ACTION_MOVE css::datatransfer::dnd::DNDConstants::ACTION_MOVE
69 #define DND_ACTION_COPYMOVE css::datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE
70 #define DND_ACTION_LINK css::datatransfer::dnd::DNDConstants::ACTION_LINK
71 
72 #define DND_POINTER_NONE 0
73 #define DND_IMAGE_NONE 0
74 
76 {
78  sal_uInt16 mnViewAspect;
81  OUString maTypeName;
82  OUString maDisplayName;
83 
85  : mnViewAspect(css::embed::Aspects::MSOLE_CONTENT)
86  {}
87 
89 };
90 
92 {
94  const css::datatransfer::dnd::DropTargetDragEvent maDragEvent;
96  bool mbLeaving;
97  bool mbDefault;
98 
100  mnAction( DND_ACTION_NONE ),
101  mbLeaving( false ),
102  mbDefault( false ) {}
103 
105  const Point& rPosPixel,
106  const css::datatransfer::dnd::DropTargetDragEvent& rDragEvent ) :
107  maPosPixel( rPosPixel ),
108  maDragEvent( rDragEvent ),
109  mnAction( nAction ),
110  mbLeaving( false ),
111  mbDefault( false ) {}
112 };
113 
115 {
117  const css::datatransfer::dnd::DropTargetDropEvent maDropEvent;
119  bool mbDefault;
120 
122  const Point& rPosPixel,
123  const css::datatransfer::dnd::DropTargetDropEvent& rDropEvent ) :
124  maPosPixel( rPosPixel ),
125  maDropEvent( rDropEvent ),
126  mnAction( nAction ),
127  mbDefault( false ) {}
128 };
129 
130 class VCL_DLLPUBLIC TransferableHelper : public cppu::WeakImplHelper< css::datatransfer::XTransferable2,
131  css::datatransfer::clipboard::XClipboardOwner,
132  css::datatransfer::dnd::XDragSourceListener,
133  css::lang::XUnoTunnel >
134 {
135 private:
136 
137  // nested class to implement the XTerminateListener interface
138  class VCL_DLLPRIVATE TerminateListener final : public cppu::WeakImplHelper< css::frame::XTerminateListener, css::lang::XServiceInfo >
139  {
140  private:
141 
143 
144  private:
145 
146  // XEventListener
147  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
148 
149  // XTerminateListener
150  virtual void SAL_CALL queryTermination( const css::lang::EventObject& aEvent ) override;
151  virtual void SAL_CALL notifyTermination( const css::lang::EventObject& aEvent ) override;
152 
153  // XServiceInfo
154  virtual OUString SAL_CALL getImplementationName() override;
155  virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override;
156  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
157 
158  public:
159 
160  TerminateListener( TransferableHelper& rDropTargetHelper );
161  virtual ~TerminateListener() override;
162  };
163 
165 
166 private:
167 
168  css::uno::Any maAny;
169  OUString maLastFormat;
170  mutable css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
171  css::uno::Reference< css::frame::XTerminateListener > mxTerminateListener;
173  std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
174 
175 protected:
177 
178  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >&
179  getOwnClipboard() const { return mxClipboard; }
180 
181 public:
182 
183  // XTransferable
184  virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& rFlavor ) override;
185  virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override;
186  virtual sal_Bool SAL_CALL isDataFlavorSupported( const css::datatransfer::DataFlavor& rFlavor ) override;
187 
188  // Transferable2
189  virtual css::uno::Any SAL_CALL getTransferData2(
190  const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
191  virtual sal_Bool SAL_CALL isComplex() override;
192 
193 private:
194 
195  // XEventListener
196  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
197 
198  // XDragSourceListener
199  virtual void SAL_CALL dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent& dsde ) override;
200  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
201  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DragSourceEvent& dse ) override;
202  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
203  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DragSourceDragEvent& dsde ) override;
204 
205  // XClipboardOwner
206  virtual void SAL_CALL lostOwnership( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard, const css::uno::Reference< css::datatransfer::XTransferable >& xTrans ) override;
207 
208 protected:
209  // derivees need to access lostOwnership in case hey override it
210  // on windows, changing the access rights to a method gives unresolved externals, so we introduce
211  // this impl-method here 'til the next incompatible update
213  const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& _rxClipboard,
214  const css::uno::Reference< css::datatransfer::XTransferable >& _rxTrans
215  )
216  {
217  TransferableHelper::lostOwnership( _rxClipboard, _rxTrans );
218  }
219 
220 
221 private:
222 
223  VCL_DLLPRIVATE void ImplFlush();
224 
225 protected:
226 
227  void AddFormat( SotClipboardFormatId nFormat );
228  void AddFormat( const css::datatransfer::DataFlavor& rFlavor );
229  void RemoveFormat( SotClipboardFormatId nFormat );
230  void RemoveFormat( const css::datatransfer::DataFlavor& rFlavor );
231  bool HasFormat( SotClipboardFormatId nFormat );
232  void ClearFormats();
233 
234  bool SetAny( const css::uno::Any& rAny );
235  bool SetString( const OUString& rString, const css::datatransfer::DataFlavor& rFlavor );
236  bool SetBitmapEx( const BitmapEx& rBitmap, const css::datatransfer::DataFlavor& rFlavor );
237  bool SetGDIMetaFile( const GDIMetaFile& rMtf );
238  bool SetGraphic( const Graphic& rGraphic );
239  bool SetImageMap( const ImageMap& rIMap );
241  bool SetINetBookmark( const INetBookmark& rBmk, const css::datatransfer::DataFlavor& rFlavor );
242  bool SetINetImage( const INetImage& rINtImg, const css::datatransfer::DataFlavor& rFlavor );
243  bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
244 
245 protected:
246 
247  virtual void AddSupportedFormats() = 0;
248  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0;
249  virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor );
250  virtual void DragFinished( sal_Int8 nDropAction );
251  virtual void ObjectReleased();
252 
253  void CopyToSelection(const css::uno::Reference<css::datatransfer::clipboard::XClipboard> &rClipboard) const;
254 public:
255 
256  void PrepareOLE( const TransferableObjectDescriptor& rObjDesc );
257 
258  void CopyToClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard> &rClipboard) const;
259 
260  // convenience versions of the above which extract the XClipboard from the pWindow
261  void CopyToClipboard( vcl::Window *pWindow ) const;
262  void CopyToPrimarySelection() const;
263 
264  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions );
265 
266  static void ClearPrimarySelection();
267 
268  static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
269 
270 public:
271 
272  virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
273 };
274 
276 
278 {
279  friend class DropTargetHelper;
280 
281  css::uno::Reference< css::datatransfer::XTransferable > mxTransfer;
282  css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard;
284  std::unique_ptr<TransferableObjectDescriptor> mxObjDesc;
285  std::unique_ptr<TransferableDataHelper_Impl> mxImpl;
286 
287  void InitFormats();
288 
289 public:
290 
291  static void FillDataFlavorExVector( const css::uno::Sequence< css::datatransfer::DataFlavor >& rDataFlavorSeq,
292  DataFlavorExVector& rDataFlavorExVector );
293 
295  TransferableDataHelper( const TransferableDataHelper& rDataHelper );
296  TransferableDataHelper( TransferableDataHelper&& rDataHelper ) noexcept;
297  TransferableDataHelper( const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable );
299 
300  TransferableDataHelper& operator=( const TransferableDataHelper& rDataHelper );
301  TransferableDataHelper& operator=( TransferableDataHelper&& rDataHelper );
302 
303  const css::uno::Reference< css::datatransfer::XTransferable >& GetTransferable() const { return mxTransfer; }
304  css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const;
305 
306  bool HasFormat( SotClipboardFormatId nFormat ) const;
307  bool HasFormat( const css::datatransfer::DataFlavor& rFlavor ) const;
308 
309  sal_uInt32 GetFormatCount() const;
310 
311  SotClipboardFormatId GetFormat( sal_uInt32 nFormat ) const;
312  css::datatransfer::DataFlavor GetFormatDataFlavor( sal_uInt32 nFormat ) const;
313 
315 
316  bool StartClipboardListening( );
317  void StopClipboardListening( );
318 
319  void Rebind( const css::uno::Reference< css::datatransfer::XTransferable >& _rxNewData );
320 
321  css::uno::Any GetAny( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const;
322  css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const;
323 
324  bool GetString( SotClipboardFormatId nFormat, OUString& rStr );
325  bool GetString( const css::datatransfer::DataFlavor& rFlavor, OUString& rStr );
326 
327  bool GetBitmapEx( SotClipboardFormatId nFormat, BitmapEx& rBmp );
328  bool GetBitmapEx( const css::datatransfer::DataFlavor& rFlavor, BitmapEx& rBmp );
329 
338  bool GetGDIMetaFile( SotClipboardFormatId nFormat, GDIMetaFile& rMtf, size_t nMaxActions = 0 );
339  bool GetGDIMetaFile( const css::datatransfer::DataFlavor& rFlavor, GDIMetaFile& rMtf );
340 
341  bool GetGraphic( SotClipboardFormatId nFormat, Graphic& rGraphic );
342  bool GetGraphic( const css::datatransfer::DataFlavor& rFlavor, Graphic& rGraphic );
343 
344  bool GetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap );
345  bool GetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rImap );
346 
347  bool GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc );
348  bool GetTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc );
349 
350  bool GetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk );
351  bool GetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk );
352 
353  bool GetINetImage( SotClipboardFormatId nFormat, INetImage& rINtImg );
354  bool GetINetImage( const css::datatransfer::DataFlavor& rFlavor, INetImage& rINtImg );
355 
356  bool GetFileList( SotClipboardFormatId nFormat, FileList& rFileList );
357  bool GetFileList( FileList& rFileList );
358 
359  css::uno::Sequence<sal_Int8> GetSequence( SotClipboardFormatId nFormat, const OUString& rDestDoc );
360  css::uno::Sequence<sal_Int8> GetSequence( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
361 
362  bool GetSotStorageStream( SotClipboardFormatId nFormat, tools::SvRef<SotTempStream>& rStreamRef );
363  bool GetSotStorageStream( const css::datatransfer::DataFlavor& rFlavor, tools::SvRef<SotTempStream>& rStreamRef );
364 
365  css::uno::Reference<css::io::XInputStream> GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc );
366  css::uno::Reference<css::io::XInputStream> GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
367 
368  static TransferableDataHelper CreateFromClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& rClipboard);
369  static TransferableDataHelper CreateFromSystemClipboard( vcl::Window * pWindow );
370  static TransferableDataHelper CreateFromPrimarySelection();
371  static bool IsEqual( const css::datatransfer::DataFlavor& rInternalFlavor,
372  const css::datatransfer::DataFlavor& rRequestFlavor );
373 };
374 
376 {
377 private:
378 
379  // nested class to implement the XDragGestureListener interface
380  class SAL_DLLPRIVATE DragGestureListener final : public cppu::WeakImplHelper< css::datatransfer::dnd::XDragGestureListener >
381  {
382  private:
383 
385 
386  private:
387 
388  // XEventListener
389  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
390 
391  // XDragGestureListener
392  virtual void SAL_CALL dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& rDGE ) override;
393 
394  public:
395 
396  DragGestureListener( DragSourceHelper& rDragSourceHelper );
397  virtual ~DragGestureListener() override;
398  };
399 
401 
402 private:
403  std::mutex maMutex;
404  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
405 
406  css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
407 
408  DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper ) = delete;
409  bool operator==( const DragSourceHelper& rDragSourceHelper ) const = delete;
410 
411 public:
412 
413  // to be overridden by the application
414  virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
415 
416  DragSourceHelper( vcl::Window* pWindow );
417  void dispose();
418  virtual ~DragSourceHelper();
419 };
420 
422 {
423 private:
424 
425  // nested class to implement the XDropTargetListener interface
426  class SAL_DLLPRIVATE DropTargetListener final : public cppu::WeakImplHelper< css::datatransfer::dnd::XDropTargetListener >
427  {
428  private:
429 
431  std::unique_ptr<AcceptDropEvent> mpLastDragOverEvent;
432 
433  // XEventListener
434  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
435 
436  // XDropTargetListener
437  virtual void SAL_CALL drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override;
438  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override;
439  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ) override;
440  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
441  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
442 
443  public:
444 
445  DropTargetListener( DropTargetHelper& rDropTargetHelper );
446  virtual ~DropTargetListener() override;
447  };
448 
450 
451 private:
452  std::mutex maMutex;
453  css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget;
454 
455  css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
457 
458  DropTargetHelper() = delete;
459  DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper ) = delete;
460  bool operator==( const DropTargetHelper& rDropTargetHelper ) const = delete;
461 
462  void ImplConstruct();
463 
464  // called by our own implementation of XDropTargetListener (DropTargetListener instance)
465  void ImplBeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors );
466  void ImplEndDrag();
467 
468 public:
469 
470  // to be overridden by the application
471  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
472  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
473 
474  DropTargetHelper( vcl::Window* pWindow );
475  DropTargetHelper( const css::uno::Reference< css::datatransfer::dnd::XDropTarget >& rxDropTarget );
476 
477  void dispose();
478  virtual ~DropTargetHelper();
479 
480  // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
481  bool IsDropFormatSupported(SotClipboardFormatId nFormat) const;
482 
484 
485 };
486 
488 
490 {
491  std::unique_ptr<TransferDataContainer_Impl> pImpl;
492 
493  virtual void AddSupportedFormats() override;
494  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
495 
496 public:
497 
499  virtual ~TransferDataContainer() override;
500 
501  void CopyINetBookmark( const INetBookmark& rBkmk );
502  void CopyString( const OUString& rStr );
503  void CopyString( SotClipboardFormatId nFmt, const OUString& rStr );
504 
505  void CopyByteString( SotClipboardFormatId nFormatId, const OString& rStr );
506  void CopyAnyData( SotClipboardFormatId nFormatId, const char* pData, sal_uLong nLen );
507 
508  bool HasAnyData() const;
509 
511  void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions,
512  const Link<sal_Int8,void>& rCallbck );
513  virtual void DragFinished( sal_Int8 nDropAction ) override;
514 };
515 
516 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemClipboard();
517 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemPrimarySelection();
518 
519 #endif
520 
521 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
Definition: drawmode.cxx:224
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: transfer.cxx:245
bool SetINetImage(const INetImage &rINtImg, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:859
VCL_DLLPRIVATE void ImplFlush()
Definition: transfer.cxx:524
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
Definition: transfer.hxx:117
DropTargetHelper()=delete
css::uno::Reference< css::frame::XTerminateListener > mxTerminateListener
Definition: transfer.hxx:171
bool SetBitmapEx(const BitmapEx &rBitmap, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:670
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:431
virtual void SAL_CALL dragOver(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:508
virtual void AddSupportedFormats()=0
signed char sal_Int8
OUString maLastFormat
Definition: transfer.hxx:169
#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:404
bool SetTransferableObjectDescriptor(const TransferableObjectDescriptor &rDesc)
Definition: transfer.cxx:758
exports com.sun.star. embed
bool HasFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:627
DataFlavorExVector maFormats
Definition: transfer.hxx:283
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemClipboard()
Definition: transfer2.cxx:460
virtual void DragFinished(sal_Int8 nDropAction)
Definition: transfer.cxx:910
virtual sal_Bool SAL_CALL isComplex() override
Definition: transfer.cxx:407
css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget
Definition: transfer.hxx:453
void ImplBeginDrag(const css::uno::Sequence< css::datatransfer::DataFlavor > &rSupportedDataFlavors)
Definition: transfer2.cxx:271
DragSourceHelper(vcl::Window *pWindow)
Definition: transfer2.cxx:71
bool SetINetBookmark(const INetBookmark &rBmk, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:771
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:873
OUString GetString(int nId)
void AddFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:544
DataFlavorExVector maFormats
Definition: transfer.hxx:172
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:483
#define DND_ACTION_NONE
Definition: transfer.hxx:66
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:293
void ImplConstruct()
Definition: transfer2.cxx:260
VCL_DLLPUBLIC friend SvStream & WriteTransferableObjectDescriptor(SvStream &rOStm, const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:84
virtual bool WriteObject(tools::SvRef< SotTempStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:903
SotClipboardFormatId
std::unique_ptr< TransferableDataHelper_Impl > mxImpl
Definition: transfer.hxx:285
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:284
std::unique_ptr< TransferDataContainer_Impl > pImpl
Definition: transfer.hxx:491
virtual void SAL_CALL dragEnter(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:498
virtual void SAL_CALL dropActionChanged(const css::datatransfer::dnd::DragSourceDragEvent &dsde) override
Definition: transfer.cxx:513
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: transfer2.cxx:290
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:202
ExecuteDropEvent(sal_Int8 nAction, const Point &rPosPixel, const css::datatransfer::dnd::DropTargetDropEvent &rDropEvent)
Definition: transfer.hxx:121
sal_Int8 mnAction
Definition: transfer.hxx:118
bool SetGraphic(const Graphic &rGraphic)
Definition: transfer.cxx:727
void RemoveFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:604
void implCallOwnLostOwnership(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &_rxClipboard, const css::uno::Reference< css::datatransfer::XTransferable > &_rxTrans)
Definition: transfer.hxx:212
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
Definition: transfer2.cxx:284
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: transfer.cxx:1034
unsigned char sal_Bool
virtual ~DropTargetHelper()
Definition: transfer2.cxx:254
void PrepareOLE(const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:920
const css::uno::Reference< css::datatransfer::clipboard::XClipboard > & getOwnClipboard() const
Definition: transfer.hxx:179
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
Definition: transfer.cxx:985
void CopyToClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
std::unique_ptr< TransferableObjectDescriptor > mxObjDesc
Definition: transfer.hxx:173
virtual void SAL_CALL dragExit(const css::datatransfer::dnd::DragSourceEvent &dse) override
Definition: transfer.cxx:503
virtual void SAL_CALL dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
Definition: transfer.cxx:483
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:456
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
Definition: transfer.cxx:518
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
Definition: transfer.cxx:414
bool SetImageMap(const ImageMap &rIMap)
Definition: transfer.cxx:746
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:170
void CopyToPrimarySelection() const
Definition: transfer.cxx:980
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener
Definition: transfer.hxx:455
virtual void ObjectReleased()
Definition: transfer.cxx:915
std::unique_ptr< AcceptDropEvent > mpLastDragOverEvent
Definition: transfer.hxx:431
DragSourceHelper & operator=(const DragSourceHelper &rDragSourceHelper)=delete
Point maPosPixel
Definition: transfer.hxx:93
css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener
Definition: transfer.hxx:406
bool IsDropFormatSupported(SotClipboardFormatId nFormat) const
Definition: transfer2.cxx:296
virtual ~DragSourceHelper()
Definition: transfer2.cxx:93
css::uno::Reference< css::datatransfer::XTransferable > mxTransfer
Definition: transfer.hxx:281
css::uno::Any maAny
Definition: transfer.hxx:168
#define VCL_DLLPRIVATE
Definition: dllapi.h:31
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemPrimarySelection()
Definition: transfer2.cxx:493
std::mutex maMutex
Definition: transfer.hxx:403
DataFlavorExVector maFormats
Definition: transfer.hxx:456
void CopyToSelection(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
Definition: transfer.cxx:961
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:282
bool SetAny(const css::uno::Any &rAny)
Definition: transfer.cxx:641
sal_Int8 mnAction
Definition: transfer.hxx:95
static void ClearPrimarySelection()
Definition: transfer.cxx:1026
bool SetString(const OUString &rString, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:648
std::mutex maMutex
Definition: transfer.hxx:452
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &rFlavor) override
Definition: transfer.cxx:288
bool SetGDIMetaFile(const GDIMetaFile &rMtf)
Definition: transfer.cxx:712
const css::datatransfer::dnd::DropTargetDragEvent maDragEvent
Definition: transfer.hxx:94
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:104
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:314