LCOV - code coverage report
Current view: top level - libreoffice/vcl/unx/generic/dtrans - X11_selection.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 17 0.0 %
Date: 2012-12-27 Functions: 0 13 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 _DTRANS_X11_SELECTION_HXX_
      21             : #define _DTRANS_X11_SELECTION_HXX_
      22             : 
      23             : #include <cppuhelper/compbase3.hxx>
      24             : #include <cppuhelper/compbase4.hxx>
      25             : #include <com/sun/star/datatransfer/XTransferable.hpp>
      26             : #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
      27             : #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
      28             : #include <com/sun/star/awt/XDisplayConnection.hpp>
      29             : #include <com/sun/star/lang/XInitialization.hpp>
      30             : #include <com/sun/star/lang/XServiceInfo.hpp>
      31             : #include <com/sun/star/script/XInvocation.hpp>
      32             : #include <com/sun/star/frame/XDesktop2.hpp>
      33             : #include <osl/thread.h>
      34             : 
      35             : #include <osl/conditn.hxx>
      36             : 
      37             : #include <boost/unordered_map.hpp>
      38             : #include <list>
      39             : 
      40             : #include "tools/prex.h"
      41             : #include <X11/Xlib.h>
      42             : #include "tools/postx.h"
      43             : 
      44             : #define XDND_IMPLEMENTATION_NAME "com.sun.star.datatransfer.dnd.XdndSupport"
      45             : #define XDND_DROPTARGET_IMPLEMENTATION_NAME "com.sun.star.datatransfer.dnd.XdndDropTarget"
      46             : 
      47             : using namespace ::com::sun::star::uno;
      48             : 
      49             : namespace x11 {
      50             : 
      51             :     class PixmapHolder; // in bmp.hxx
      52             : 
      53             : // ------------------------------------------------------------------------
      54             :     rtl_TextEncoding getTextPlainEncoding( const ::rtl::OUString& rMimeType );
      55             : 
      56           0 :     class SelectionAdaptor
      57             :     {
      58             :     public:
      59             :         virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
      60             :         virtual void clearTransferable() = 0;
      61             :         virtual void fireContentsChanged() = 0;
      62             :         virtual com::sun::star::uno::Reference< XInterface > getReference() = 0;
      63             :         // returns a reference that will keep the SelectionAdaptor alive until the
      64             :         // refernce is released
      65             : 
      66             :     protected:
      67           0 :         ~SelectionAdaptor() {}
      68             :     };
      69             : 
      70             :     class DropTarget :
      71             :         public ::cppu::WeakComponentImplHelper3<
      72             :             ::com::sun::star::datatransfer::dnd::XDropTarget,
      73             :             ::com::sun::star::lang::XInitialization,
      74             :             ::com::sun::star::lang::XServiceInfo
      75             :         >
      76             :     {
      77             :     public:
      78             :         ::osl::Mutex                m_aMutex;
      79             :         bool                        m_bActive;
      80             :         sal_Int8                    m_nDefaultActions;
      81             :         XLIB_Window                 m_aTargetWindow;
      82             :         class SelectionManager*     m_pSelectionManager;
      83             :         com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
      84             :                                     m_xSelectionManager;
      85             :         ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
      86             :                             m_aListeners;
      87             : 
      88             :         DropTarget();
      89             :         virtual ~DropTarget();
      90             : 
      91             :         // convenience functions that loop over listeners
      92             :         void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtde ) throw();
      93             :         void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw();
      94             :         void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw();
      95             :         void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw();
      96             : 
      97             :         // XInitialization
      98             :         virtual void        SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
      99             : 
     100             :         // XDropTarget
     101             :         virtual void        SAL_CALL addDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
     102             :         virtual void        SAL_CALL removeDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
     103             :         virtual sal_Bool    SAL_CALL isActive() throw();
     104             :         virtual void        SAL_CALL setActive( sal_Bool active ) throw();
     105             :         virtual sal_Int8    SAL_CALL getDefaultActions() throw();
     106             :         virtual void        SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
     107             : 
     108             :         // XServiceInfo
     109             :         virtual ::rtl::OUString SAL_CALL getImplementationName() throw();
     110             :         virtual sal_Bool    SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
     111             :         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
     112             :                             SAL_CALL getSupportedServiceNames() throw();
     113             :     };
     114             : 
     115             :     class SelectionManagerHolder :
     116             :         public ::cppu::WeakComponentImplHelper3<
     117             :             ::com::sun::star::datatransfer::dnd::XDragSource,
     118             :             ::com::sun::star::lang::XInitialization,
     119             :             ::com::sun::star::lang::XServiceInfo
     120             :         >
     121             :     {
     122             :         ::osl::Mutex m_aMutex;
     123             :         com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
     124             :             m_xRealDragSource;
     125             :     public:
     126             :         SelectionManagerHolder();
     127             :         virtual ~SelectionManagerHolder();
     128             : 
     129             :         // XServiceInfo
     130             :         virtual ::rtl::OUString SAL_CALL getImplementationName() throw();
     131             :         virtual sal_Bool    SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
     132             :         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
     133             :                             SAL_CALL getSupportedServiceNames() throw();
     134             : 
     135             :         // XInitialization
     136             :         virtual void        SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
     137             : 
     138             :         // XDragSource
     139             :         virtual sal_Bool    SAL_CALL isDragImageSupported() throw();
     140             :         virtual sal_Int32   SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
     141             :         virtual void        SAL_CALL startDrag(
     142             :             const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
     143             :             sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
     144             :             const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
     145             :             const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
     146             :             ) throw();
     147             : 
     148             :     };
     149             : 
     150             : 
     151             :     class SelectionManager :
     152             :         public ::cppu::WeakImplHelper4<
     153             :             ::com::sun::star::datatransfer::dnd::XDragSource,
     154             :             ::com::sun::star::lang::XInitialization,
     155             :             ::com::sun::star::awt::XEventHandler,
     156             :             ::com::sun::star::frame::XTerminateListener
     157             :         >,
     158             :         public SelectionAdaptor
     159             :     {
     160             :         static ::boost::unordered_map< ::rtl::OUString, SelectionManager*, ::rtl::OUStringHash >& getInstances();
     161             : 
     162             :         // for INCR type selection transfer
     163             :         // INCR protocol is used if the data cannot
     164             :         // be transported at once but in parts
     165             :         // IncrementalTransfer holds the bytes to be transmitted
     166             :         // as well a the current position
     167             :         // INCR triggers the delivery of the next part by deleting the
     168             :         // property used to transfer the data
     169           0 :         struct IncrementalTransfer
     170             :         {
     171             :             Sequence< sal_Int8 >            m_aData;
     172             :             int                             m_nBufferPos;
     173             :             XLIB_Window                         m_aRequestor;
     174             :             Atom                            m_aProperty;
     175             :             Atom                            m_aTarget;
     176             :             int                             m_nFormat;
     177             :             int                             m_nTransferStartTime;
     178             :         };
     179             :         int m_nIncrementalThreshold;
     180             : 
     181             :         // a struct to hold the data associated with a selection
     182           0 :         struct Selection
     183             :         {
     184             :             enum State
     185             :             {
     186             :                 Inactive, WaitingForResponse, WaitingForData, IncrementalTransfer
     187             :             };
     188             : 
     189             :             State                       m_eState;
     190             :             SelectionAdaptor*           m_pAdaptor;
     191             :             Atom                        m_aAtom;
     192             :             ::osl::Condition            m_aDataArrived;
     193             :             Sequence< sal_Int8 >        m_aData;
     194             :             Sequence< ::com::sun::star::datatransfer::DataFlavor >
     195             :                                         m_aTypes;
     196             :             std::vector< Atom >         m_aNativeTypes;
     197             :             // this is used for caching
     198             :             // m_aTypes is invalid after 2 seconds
     199             :             // m_aNativeTypes contains the corresponding original atom
     200             :             Atom                        m_aRequestedType;
     201             :             // m_aRequestedType is only valid while WaitingForResponse and WaitingFotData
     202             :             int                         m_nLastTimestamp;
     203             :             bool                        m_bHaveUTF16;
     204             :             Atom                        m_aUTF8Type;
     205             :             bool                        m_bHaveCompound;
     206             :             bool                        m_bOwner;
     207             :             XLIB_Window                 m_aLastOwner;
     208             :             PixmapHolder*               m_pPixmap;
     209             :             // m_nOrigXLIB_Timestamp contains the XLIB_Timestamp at which the seclection
     210             :             // was acquired; needed for XLIB_TimeSTAMP target
     211             :             XLIB_Time                        m_nOrigTimestamp;
     212             : 
     213           0 :             Selection() : m_eState( Inactive ),
     214             :                           m_pAdaptor( NULL ),
     215             :                           m_aAtom( None ),
     216             :                           m_aRequestedType( None ),
     217             :                           m_nLastTimestamp( 0 ),
     218             :                           m_bHaveUTF16( false ),
     219             :                           m_aUTF8Type( None ),
     220             :                           m_bHaveCompound( false ),
     221             :                           m_bOwner( false ),
     222             :                           m_aLastOwner( None ),
     223             :                           m_pPixmap( NULL ),
     224           0 :                           m_nOrigTimestamp( CurrentTime )
     225           0 :                 {}
     226             :         };
     227             : 
     228             :         // a struct to hold data associated with a XDropTarget
     229             :         struct DropTargetEntry
     230             :         {
     231             :             DropTarget*     m_pTarget;
     232             :             XLIB_Window     m_aRootWindow;
     233             : 
     234           0 :             DropTargetEntry() : m_pTarget( NULL ), m_aRootWindow( None ) {}
     235           0 :             DropTargetEntry( DropTarget* pTarget ) :
     236             :                     m_pTarget( pTarget ),
     237           0 :                     m_aRootWindow( None )
     238           0 :                 {}
     239             :             DropTargetEntry( const DropTargetEntry& rEntry ) :
     240             :                     m_pTarget( rEntry.m_pTarget ),
     241             :                     m_aRootWindow( rEntry.m_aRootWindow )
     242             :                 {}
     243           0 :             ~DropTargetEntry() {}
     244             : 
     245           0 :             DropTarget* operator->() const { return m_pTarget; }
     246           0 :             DropTargetEntry& operator=(const DropTargetEntry& rEntry)
     247           0 :                 { m_pTarget = rEntry.m_pTarget; m_aRootWindow = rEntry.m_aRootWindow; return *this; }
     248             :         };
     249             : 
     250             :         // internal data
     251             :         Display*                    m_pDisplay;
     252             :         oslThread                   m_aThread;
     253             :         oslThread                   m_aDragExecuteThread;
     254             :         ::osl::Condition            m_aDragRunning;
     255             :         XLIB_Window                 m_aWindow;
     256             :         com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop2 > m_xDesktop;
     257             :         com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection >
     258             :                                     m_xDisplayConnection;
     259             :         com::sun::star::uno::Reference< com::sun::star::script::XInvocation >
     260             :                                     m_xBitmapConverter;
     261             :         sal_Int32                   m_nSelectionTimeout;
     262             :         XLIB_Time                   m_nSelectionTimestamp;
     263             : 
     264             : 
     265             :         // members used for Xdnd
     266             : 
     267             :         // drop only
     268             : 
     269             :         // contains the XdndEnterEvent of a drop action running
     270             :         // with one of our targets. The data.l[0] member
     271             :         // (conatining the drag source XLIB_Window) is set
     272             :         // to None while that is not the case
     273             :         XClientMessageEvent         m_aDropEnterEvent;
     274             :         // set to false on XdndEnter
     275             :         // set to true on first XdndPosition or XdndLeave
     276             :         bool                        m_bDropEnterSent;
     277             :         XLIB_Window                 m_aCurrentDropWindow;
     278             :         // XLIB_Time code of XdndDrop
     279             :         XLIB_Time                   m_nDropTime;
     280             :         sal_Int8                    m_nLastDropAction;
     281             :         // XTransferable for Xdnd with foreign drag source
     282             :         com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
     283             :                                     m_xDropTransferable;
     284             :         int                         m_nLastX, m_nLastY;
     285             :         XLIB_Time                   m_nDropTimestamp;
     286             :         // set to true when calling drop()
     287             :         // if another XdndEnter is received this shows that
     288             :         // someone forgot to call dropComplete - we should reset
     289             :         // and react to the new drop
     290             :         bool                        m_bDropWaitingForCompletion;
     291             : 
     292             :         // drag only
     293             : 
     294             :         // None if no Dnd action is running with us as source
     295             :         XLIB_Window                 m_aDropWindow;
     296             :         // either m_aDropXLIB_Window or its XdndProxy
     297             :         XLIB_Window                 m_aDropProxy;
     298             :         XLIB_Window                 m_aDragSourceWindow;
     299             :         // XTransferable for Xdnd when we are drag source
     300             :         com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
     301             :                                     m_xDragSourceTransferable;
     302             :         com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
     303             :                                     m_xDragSourceListener;
     304             :         // root coordinates
     305             :         int                         m_nLastDragX, m_nLastDragY;
     306             :         Sequence< ::com::sun::star::datatransfer::DataFlavor >
     307             :                                     m_aDragFlavors;
     308             :         // the rectangle the pointer must leave until a new XdndPosition should
     309             :         // be sent. empty unless the drop target told to fill
     310             :         int                         m_nNoPosX, m_nNoPosY, m_nNoPosWidth, m_nNoPosHeight;
     311             :         unsigned int                m_nDragButton;
     312             :         sal_Int8                    m_nUserDragAction;
     313             :         sal_Int8                    m_nTargetAcceptAction;
     314             :         sal_Int8                    m_nSourceActions;
     315             :         bool                        m_bLastDropAccepted;
     316             :         bool                        m_bDropSuccess;
     317             :         bool                        m_bDropSent;
     318             :         time_t                      m_nDropTimeout;
     319             :         bool                        m_bWaitingForPrimaryConversion;
     320             :         XLIB_Time                   m_nDragTimestamp;
     321             : 
     322             :         // drag cursors
     323             :         XLIB_Cursor                 m_aMoveCursor;
     324             :         XLIB_Cursor                 m_aCopyCursor;
     325             :         XLIB_Cursor                 m_aLinkCursor;
     326             :         XLIB_Cursor                 m_aNoneCursor;
     327             :         XLIB_Cursor                 m_aCurrentCursor;
     328             : 
     329             : 
     330             :         // drag and drop
     331             : 
     332             :         int                         m_nCurrentProtocolVersion;
     333             :         ::boost::unordered_map< XLIB_Window, DropTargetEntry >
     334             :                                     m_aDropTargets;
     335             : 
     336             : 
     337             :         // some special atoms that are needed often
     338             :         Atom                        m_nCLIPBOARDAtom;
     339             :         Atom                        m_nTARGETSAtom;
     340             :         Atom                        m_nTIMESTAMPAtom;
     341             :         Atom                        m_nTEXTAtom;
     342             :         Atom                        m_nINCRAtom;
     343             :         Atom                        m_nCOMPOUNDAtom;
     344             :         Atom                        m_nMULTIPLEAtom;
     345             :         Atom                        m_nUTF16Atom;
     346             :         Atom                        m_nImageBmpAtom;
     347             :         Atom                        m_nXdndAware;
     348             :         Atom                        m_nXdndEnter;
     349             :         Atom                        m_nXdndLeave;
     350             :         Atom                        m_nXdndPosition;
     351             :         Atom                        m_nXdndStatus;
     352             :         Atom                        m_nXdndDrop;
     353             :         Atom                        m_nXdndFinished;
     354             :         Atom                        m_nXdndSelection;
     355             :         Atom                        m_nXdndTypeList;
     356             :         Atom                        m_nXdndProxy;
     357             :         Atom                        m_nXdndActionCopy;
     358             :         Atom                        m_nXdndActionMove;
     359             :         Atom                        m_nXdndActionLink;
     360             :         Atom                        m_nXdndActionAsk;
     361             :         Atom                        m_nXdndActionPrivate;
     362             : 
     363             :         // caching for atoms
     364             :         ::boost::unordered_map< Atom, ::rtl::OUString >
     365             :                                     m_aAtomToString;
     366             :         ::boost::unordered_map< ::rtl::OUString, Atom, ::rtl::OUStringHash >
     367             :                                     m_aStringToAtom;
     368             : 
     369             :         // the registered selections
     370             :         ::boost::unordered_map< Atom, Selection* >
     371             :                                     m_aSelections;
     372             :         // IncrementalTransfers in progress
     373             :         boost::unordered_map< XLIB_Window, boost::unordered_map< Atom, IncrementalTransfer > >
     374             :                                     m_aIncrementals;
     375             : 
     376             :         // do not use X11 multithreading capabilities
     377             :         // since this leads to deadlocks in different Xlib implentations
     378             :         // (XFree as well as Xsun) use an own mutex instead
     379             :         ::osl::Mutex                m_aMutex;
     380             :         bool                        m_bShutDown;
     381             : 
     382             :         SelectionManager();
     383             :         ~SelectionManager();
     384             : 
     385             :         SelectionAdaptor* getAdaptor( Atom selection );
     386             :         PixmapHolder* getPixmapHolder( Atom selection );
     387             : 
     388             :         // handle various events
     389             :         bool handleSelectionRequest( XSelectionRequestEvent& rRequest );
     390             :         bool handleSendPropertyNotify( XPropertyEvent& rNotify );
     391             :         bool handleReceivePropertyNotify( XPropertyEvent& rNotify );
     392             :         bool handleSelectionNotify( XSelectionEvent& rNotify );
     393             :         bool handleDragEvent( XEvent& rMessage );
     394             :         bool handleDropEvent( XClientMessageEvent& rMessage );
     395             : 
     396             :         // dnd helpers
     397             :         void sendDragStatus( Atom nDropAction );
     398             :         void sendDropPosition( bool bForce, XLIB_Time eventXLIB_Time );
     399             :         bool updateDragAction( int modifierState );
     400             :         int getXdndVersion( XLIB_Window aXLIB_Window, XLIB_Window& rProxy );
     401             :         XLIB_Cursor createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY );
     402             :         // coordinates on root XLIB_Window
     403             :         void updateDragWindow( int nX, int nY, XLIB_Window aRoot );
     404             : 
     405             :         bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData );
     406             :         // returns true if conversion was successful
     407             :         bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
     408             :                           Atom nType,
     409             :                           Atom nSelection,
     410             :                           int & rFormat,
     411             :                           Sequence< sal_Int8 >& rData );
     412             :         bool sendData( SelectionAdaptor* pAdaptor, XLIB_Window requestor, Atom target, Atom property, Atom selection );
     413             : 
     414             :         // thread dispatch loop
     415             :         public:
     416             :         // public for extern "C" stub
     417             :         static void run( void* );
     418             :         private:
     419             :         void dispatchEvent( int millisec );
     420             :         // drag thread dispatch
     421             :         public:
     422             :         // public for extern "C" stub
     423             :         static void runDragExecute( void* );
     424             :         private:
     425             :         void dragDoDispatch();
     426             :         bool handleXEvent( XEvent& rEvent );
     427             : 
     428             :         // compound text conversion
     429             :         ::rtl::OString convertToCompound( const ::rtl::OUString& rText );
     430             :         ::rtl::OUString convertFromCompound( const char* pText, int nLen = -1 );
     431             : 
     432             :         sal_Int8 getUserDragAction() const;
     433             :         sal_Int32 getSelectionTimeout();
     434             :     public:
     435             :         static SelectionManager& get( const ::rtl::OUString& rDisplayName = ::rtl::OUString() );
     436             : 
     437           0 :         Display * getDisplay() { return m_pDisplay; };
     438             :         XLIB_Window getWindow() { return m_aWindow; };
     439             : 
     440             : 
     441             :         void registerHandler( Atom selection, SelectionAdaptor& rAdaptor );
     442             :         void deregisterHandler( Atom selection );
     443             :         bool requestOwnership( Atom selection );
     444             : 
     445             :         // allow for synchronization over one mutex for XClipboard
     446           0 :         osl::Mutex& getMutex() { return m_aMutex; }
     447             : 
     448             : 
     449             :         Atom getAtom( const ::rtl::OUString& rString );
     450             :         const ::rtl::OUString& getString( Atom nAtom );
     451             : 
     452             :         // type conversion
     453             :         // note: convertTypeToNative does NOT clear the list, so you can append
     454             :         // multiple types to the same list
     455             :         void convertTypeToNative( const ::rtl::OUString& rType, Atom selection, int& rFormat, ::std::list< Atom >& rConversions, bool bPushFront = false );
     456             :         ::rtl::OUString convertTypeFromNative( Atom nType, Atom selection, int& rFormat );
     457             :         void getNativeTypeList( const Sequence< com::sun::star::datatransfer::DataFlavor >& rTypes, std::list< Atom >& rOutTypeList, Atom targetselection );
     458             : 
     459             :         // methods for transferable
     460             :         bool getPasteDataTypes( Atom selection, Sequence< ::com::sun::star::datatransfer::DataFlavor >& rTypes );
     461             :         bool getPasteData( Atom selection, const ::rtl::OUString& rType, Sequence< sal_Int8 >& rData );
     462             : 
     463             :         // for XDropTarget to register/deregister itself
     464             :         void registerDropTarget( XLIB_Window aXLIB_Window, DropTarget* pTarget );
     465             :         void deregisterDropTarget( XLIB_Window aXLIB_Window );
     466             : 
     467             :         // for XDropTarget{Drag|Drop}Context
     468             :         void accept( sal_Int8 dragOperation, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp );
     469             :         void reject( XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp );
     470             :         void dropComplete( sal_Bool success, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp );
     471             : 
     472             :         // for XDragSourceContext
     473             :         sal_Int32 getCurrentCursor();
     474             :         void setCursor( sal_Int32 cursor, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp );
     475             :         void setImage( sal_Int32 image, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp );
     476             :         void transferablesFlavorsChanged();
     477             : 
     478             :         void shutdown() throw();
     479             : 
     480             :         // XInitialization
     481             :         virtual void        SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
     482             : 
     483             :         // XEventHandler
     484             :         virtual sal_Bool    SAL_CALL handleEvent( const Any& event ) throw();
     485             : 
     486             :         // XDragSource
     487             :         virtual sal_Bool    SAL_CALL isDragImageSupported() throw();
     488             :         virtual sal_Int32   SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
     489             :         virtual void        SAL_CALL startDrag(
     490             :             const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
     491             :             sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
     492             :             const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
     493             :             const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
     494             :             ) throw();
     495             : 
     496             :         // SelectionAdaptor for XdndSelection Drag (we are drag source)
     497             :         virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
     498             :         virtual void clearTransferable() throw();
     499             :         virtual void fireContentsChanged() throw();
     500             :         virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
     501             : 
     502             :         // XEventListener
     503             :         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
     504             : 
     505             :         // XTerminateListener
     506             :         virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent )
     507             :                 throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException );
     508             :         virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent )
     509             :                 throw( ::com::sun::star::uno::RuntimeException );
     510             :     };
     511             : 
     512             : // ------------------------------------------------------------------------
     513             : 
     514             :     ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL Xdnd_getSupportedServiceNames();
     515             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_createInstance(
     516             :         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
     517             : 
     518             :     ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL Xdnd_dropTarget_getSupportedServiceNames();
     519             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_dropTarget_createInstance(
     520             :         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
     521             : 
     522             : // ------------------------------------------------------------------------
     523             : 
     524             : }
     525             : 
     526             : #endif
     527             : 
     528             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10