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 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 VCL_DLLPRIVATE 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 CreateFromClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& rClipboard);
367  static TransferableDataHelper CreateFromSystemClipboard( vcl::Window * pWindow );
368  static TransferableDataHelper CreateFromSelection( vcl::Window * pWindow );
369  static bool IsEqual( const css::datatransfer::DataFlavor& rInternalFlavor,
370  const css::datatransfer::DataFlavor& rRequestFlavor );
371 };
372 
374 {
375 private:
376 
377  // nested class to implement the XDragGestureListener interface
378  class SAL_DLLPRIVATE DragGestureListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDragGestureListener >
379  {
380  private:
381 
383 
384  private:
385 
386  // XEventListener
387  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
388 
389  // XDragGestureListener
390  virtual void SAL_CALL dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent& rDGE ) override;
391 
392  public:
393 
394  DragGestureListener( DragSourceHelper& rDragSourceHelper );
395  virtual ~DragGestureListener() override;
396  };
397 
399 
400 private:
401  osl::Mutex maMutex;
402  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer;
403 
404  css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener;
405 
406  DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper ) = delete;
407  bool operator==( const DragSourceHelper& rDragSourceHelper ) const = delete;
408 
409 public:
410 
411  // to be overridden by the application
412  virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
413 
414  DragSourceHelper( vcl::Window* pWindow );
415  void dispose();
416  virtual ~DragSourceHelper();
417 };
418 
420 {
421 private:
422 
423  // nested class to implement the XDropTargetListener interface
424  class SAL_DLLPRIVATE DropTargetListener : public cppu::WeakImplHelper< css::datatransfer::dnd::XDropTargetListener >
425  {
426  private:
427 
429  std::unique_ptr<AcceptDropEvent> mpLastDragOverEvent;
430 
431  // XEventListener
432  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
433 
434  // XDropTargetListener
435  virtual void SAL_CALL drop( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) override;
436  virtual void SAL_CALL dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) override;
437  virtual void SAL_CALL dragExit( const css::datatransfer::dnd::DropTargetEvent& dte ) override;
438  virtual void SAL_CALL dragOver( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
439  virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) override;
440 
441  public:
442 
443  DropTargetListener( DropTargetHelper& rDropTargetHelper );
444  virtual ~DropTargetListener() override;
445  };
446 
448 
449 private:
450  osl::Mutex maMutex;
451  css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget;
452 
453  css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
455 
456  DropTargetHelper() = delete;
457  DropTargetHelper& operator=( const DropTargetHelper& rDropTargetHelper ) = delete;
458  bool operator==( const DropTargetHelper& rDropTargetHelper ) const = delete;
459 
460  void ImplConstruct();
461 
462  // called by our own implementation of XDropTargetListener (DropTargetListener instance)
463  void ImplBeginDrag( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors );
464  void ImplEndDrag();
465 
466 public:
467 
468  // to be overridden by the application
469  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
470  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
471 
472  DropTargetHelper( vcl::Window* pWindow );
473  DropTargetHelper( const css::uno::Reference< css::datatransfer::dnd::XDropTarget >& rxDropTarget );
474 
475  void dispose();
476  virtual ~DropTargetHelper();
477 
478  // typically called by the application in ::AcceptDrop and ::ExecuteDrop and (see above)
479  bool IsDropFormatSupported(SotClipboardFormatId nFormat) const;
480 
482 
483 };
484 
486 
488 {
489  std::unique_ptr<TransferDataContainer_Impl> pImpl;
490 
491  virtual void AddSupportedFormats() override;
492  virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) 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 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  virtual void DragFinished( sal_Int8 nDropAction ) override;
512 };
513 
514 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemClipboard();
515 css::uno::Reference<css::datatransfer::clipboard::XClipboard> VCL_DLLPUBLIC GetSystemPrimarySelection();
516 
517 #endif
518 
519 /* 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:860
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:402
bool SetTransferableObjectDescriptor(const TransferableObjectDescriptor &rDesc)
Definition: transfer.cxx:758
exports com.sun.star. embed
bool HasFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:631
DataFlavorExVector maFormats
Definition: transfer.hxx:281
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemClipboard()
Definition: transfer2.cxx:462
virtual bool WriteObject(tools::SvRef< SotStorageStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:904
virtual void DragFinished(sal_Int8 nDropAction)
Definition: transfer.cxx:911
virtual sal_Bool SAL_CALL isComplex() override
Definition: transfer.cxx:402
css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget
Definition: transfer.hxx:451
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:771
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
Definition: transfer.cxx:874
void AddFormat(SotClipboardFormatId nFormat)
Definition: transfer.cxx:548
DataFlavorExVector maFormats
Definition: transfer.hxx:170
osl::Mutex maMutex
Definition: transfer.hxx:401
const DataFlavorExVector & GetDataFlavorExVector() const
Definition: transfer.hxx:481
#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:262
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:489
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:292
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:206
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:730
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
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
Definition: transfer2.cxx:286
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: transfer.cxx:1047
unsigned char sal_Bool
virtual ~DropTargetHelper()
Definition: transfer2.cxx:256
void PrepareOLE(const TransferableObjectDescriptor &rObjDesc)
Definition: transfer.cxx:921
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:992
static void ClearSelection(vcl::Window *pWindow)
Definition: transfer.cxx:1033
void CopyToClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
osl::Mutex maMutex
Definition: transfer.hxx:450
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:746
css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard
Definition: transfer.hxx:168
css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener
Definition: transfer.hxx:453
virtual void ObjectReleased()
Definition: transfer.cxx:916
std::unique_ptr< AcceptDropEvent > mpLastDragOverEvent
Definition: transfer.hxx:429
DragSourceHelper & operator=(const DragSourceHelper &rDragSourceHelper)=delete
Point maPosPixel
Definition: transfer.hxx:92
css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener
Definition: transfer.hxx:404
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: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:495
DataFlavorExVector maFormats
Definition: transfer.hxx:454
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:716
const css::datatransfer::dnd::DropTargetDragEvent maDragEvent
Definition: transfer.hxx:93
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc)=0
OUString GetString(double f, bool bLeadingSign, sal_uInt16 nMaxDig)
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