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