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