LCOV - code coverage report
Current view: top level - vcl/source/components - dtranscomp.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 88 126 69.8 %
Date: 2012-08-25 Functions: 34 47 72.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 57 134 42.5 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include "osl/mutex.hxx"
      31                 :            : 
      32                 :            : #include "vcl/svapp.hxx"
      33                 :            : 
      34                 :            : #include "svdata.hxx"
      35                 :            : #include "salinst.hxx"
      36                 :            : 
      37                 :            : #include "com/sun/star/lang/XServiceInfo.hpp"
      38                 :            : #include "com/sun/star/lang/XSingleServiceFactory.hpp"
      39                 :            : #include "com/sun/star/lang/XInitialization.hpp"
      40                 :            : #include "com/sun/star/lang/DisposedException.hpp"
      41                 :            : #include "com/sun/star/datatransfer/XTransferable.hpp"
      42                 :            : #include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
      43                 :            : #include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp"
      44                 :            : #include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp"
      45                 :            : #include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp"
      46                 :            : #include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
      47                 :            : #include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
      48                 :            : #include "com/sun/star/datatransfer/dnd/DNDConstants.hpp"
      49                 :            : 
      50                 :            : #include "cppuhelper/compbase1.hxx"
      51                 :            : #include "cppuhelper/compbase2.hxx"
      52                 :            : #include "cppuhelper/compbase3.hxx"
      53                 :            : #include "cppuhelper/implbase1.hxx"
      54                 :            : 
      55                 :            : using rtl::OUString;
      56                 :            : using namespace com::sun::star;
      57                 :            : using namespace com::sun::star::uno;
      58                 :            : using namespace com::sun::star::lang;
      59                 :            : 
      60                 :            : // -----------------------------------------------------------------------
      61                 :            : 
      62                 :            : namespace vcl
      63                 :            : {
      64                 :            : // generic implementation to satisfy SalInstance
      65                 :            : class GenericClipboard :
      66                 :            :         public cppu::WeakComponentImplHelper3 <
      67                 :            :         datatransfer::clipboard::XClipboardEx,
      68                 :            :         datatransfer::clipboard::XClipboardNotifier,
      69                 :            :         XServiceInfo
      70                 :            :         >
      71                 :            : {
      72                 :            :     osl::Mutex                                                              m_aMutex;
      73                 :            :     Reference< ::com::sun::star::datatransfer::XTransferable >              m_aContents;
      74                 :            :     Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
      75                 :            :     std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
      76                 :            : 
      77                 :            :     void fireChangedContentsEvent();
      78                 :            :     void clearContents();
      79                 :            : 
      80                 :            : public:
      81                 :            : 
      82                 :       1158 :     GenericClipboard() : cppu::WeakComponentImplHelper3<
      83                 :            :         datatransfer::clipboard::XClipboardEx,
      84                 :            :         datatransfer::clipboard::XClipboardNotifier,
      85                 :            :         XServiceInfo
      86 [ +  - ][ +  - ]:       1158 :         >( m_aMutex )
      87                 :       1158 :     {}
      88                 :            :     virtual ~GenericClipboard();
      89                 :            : 
      90                 :            :     /*
      91                 :            :      * XServiceInfo
      92                 :            :      */
      93                 :            : 
      94                 :            :     virtual rtl::OUString SAL_CALL getImplementationName() throw( RuntimeException );
      95                 :            :     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( RuntimeException );
      96                 :            :     virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( RuntimeException );
      97                 :            : 
      98                 :            :     static rtl::OUString getImplementationName_static();
      99                 :            :     static Sequence< rtl::OUString > getSupportedServiceNames_static();
     100                 :            : 
     101                 :            :     /*
     102                 :            :      * XClipboard
     103                 :            :      */
     104                 :            : 
     105                 :            :     virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
     106                 :            :         throw(RuntimeException);
     107                 :            : 
     108                 :            :     virtual void SAL_CALL setContents(
     109                 :            :         const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
     110                 :            :         const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
     111                 :            :         throw(RuntimeException);
     112                 :            : 
     113                 :            :     virtual ::rtl::OUString SAL_CALL getName()
     114                 :            :         throw(RuntimeException);
     115                 :            : 
     116                 :            :     /*
     117                 :            :      * XClipboardEx
     118                 :            :      */
     119                 :            : 
     120                 :            :     virtual sal_Int8 SAL_CALL getRenderingCapabilities()
     121                 :            :         throw(RuntimeException);
     122                 :            : 
     123                 :            :     /*
     124                 :            :      * XClipboardNotifier
     125                 :            :      */
     126                 :            :     virtual void SAL_CALL addClipboardListener(
     127                 :            :         const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
     128                 :            :         throw(RuntimeException);
     129                 :            : 
     130                 :            :     virtual void SAL_CALL removeClipboardListener(
     131                 :            :         const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
     132                 :            :         throw(RuntimeException);
     133                 :            : };
     134                 :            : 
     135         [ +  - ]:       1158 : GenericClipboard::~GenericClipboard()
     136                 :            : {
     137         [ -  + ]:       2316 : }
     138                 :            : 
     139                 :          0 : rtl::OUString GenericClipboard::getImplementationName_static()
     140                 :            : {
     141                 :          0 :     return rtl::OUString( "com.sun.star.datatransfer.VCLGenericClipboard"  );
     142                 :            : }
     143                 :            : 
     144                 :          0 : Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames_static()
     145                 :            : {
     146                 :          0 :     Sequence< OUString > aRet(1);
     147         [ #  # ]:          0 :     aRet[0] = OUString("com.sun.star.datatransfer.clipboard.SystemClipboard");
     148                 :          0 :     return aRet;
     149                 :            : }
     150                 :            : 
     151                 :          0 : rtl::OUString GenericClipboard::getImplementationName() throw( RuntimeException )
     152                 :            : {
     153                 :          0 :     return getImplementationName_static();
     154                 :            : }
     155                 :            : 
     156                 :          0 : Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames() throw( RuntimeException )
     157                 :            : {
     158                 :          0 :     return getSupportedServiceNames_static();
     159                 :            : }
     160                 :            : 
     161                 :          0 : sal_Bool GenericClipboard::supportsService( const ::rtl::OUString& ServiceName ) throw( RuntimeException )
     162                 :            : {
     163         [ #  # ]:          0 :     Sequence< OUString > aServices( getSupportedServiceNames() );
     164                 :          0 :     sal_Int32 nServices = aServices.getLength();
     165         [ #  # ]:          0 :     for( sal_Int32 i = 0; i < nServices; i++ )
     166                 :            :     {
     167 [ #  # ][ #  # ]:          0 :         if( aServices[i] == ServiceName )
     168                 :          0 :             return sal_True;
     169                 :            :     }
     170         [ #  # ]:          0 :     return sal_False;
     171                 :            : }
     172                 :            : 
     173                 :       3878 : Reference< ::com::sun::star::datatransfer::XTransferable > GenericClipboard::getContents() throw( RuntimeException )
     174                 :            : {
     175                 :       3878 :     return m_aContents;
     176                 :            : }
     177                 :            : 
     178                 :         86 : void GenericClipboard::setContents(
     179                 :            :         const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
     180                 :            :         const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
     181                 :            :     throw( RuntimeException )
     182                 :            : {
     183         [ +  - ]:         86 :     osl::ClearableMutexGuard aGuard( m_aMutex );
     184                 :         86 :     Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner );
     185                 :         86 :     Reference< datatransfer::XTransferable > xOldContents( m_aContents );
     186         [ +  - ]:         86 :     m_aContents = xTrans;
     187         [ +  - ]:         86 :     m_aOwner = xClipboardOwner;
     188                 :            : 
     189         [ +  - ]:         86 :     std::list< Reference< datatransfer::clipboard::XClipboardListener > > xListeners( m_aListeners );
     190         [ +  - ]:         86 :     datatransfer::clipboard::ClipboardEvent aEv;
     191         [ +  - ]:         86 :     aEv.Contents = m_aContents;
     192                 :            : 
     193         [ +  - ]:         86 :     aGuard.clear();
     194                 :            : 
     195 [ +  + ][ +  - ]:         86 :     if( xOldOwner.is() && xOldOwner != xClipboardOwner )
         [ +  - ][ +  + ]
     196 [ +  - ][ +  - ]:         46 :         xOldOwner->lostOwnership( this, xOldContents );
                 [ +  - ]
     197         [ -  + ]:        172 :     for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it =
     198                 :        172 :          xListeners.begin(); it != xListeners.end() ; ++it )
     199                 :            :     {
     200 [ #  # ][ #  # ]:          0 :         (*it)->changedContents( aEv );
     201 [ +  - ][ +  - ]:         86 :     }
     202                 :         86 : }
     203                 :            : 
     204                 :          0 : rtl::OUString GenericClipboard::getName() throw( RuntimeException )
     205                 :            : {
     206                 :          0 :     return rtl::OUString( "CLIPBOARD"  );
     207                 :            : }
     208                 :            : 
     209                 :          0 : sal_Int8 GenericClipboard::getRenderingCapabilities() throw( RuntimeException )
     210                 :            : {
     211                 :          0 :     return 0;
     212                 :            : }
     213                 :            : 
     214                 :       2264 : void GenericClipboard::addClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener )
     215                 :            :     throw( RuntimeException )
     216                 :            : {
     217         [ +  - ]:       2264 :     osl::ClearableMutexGuard aGuard( m_aMutex );
     218                 :            : 
     219 [ +  - ][ +  - ]:       2264 :     m_aListeners.push_back( listener );
     220                 :       2264 : }
     221                 :            : 
     222                 :       2264 : void GenericClipboard::removeClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener )
     223                 :            :     throw( RuntimeException )
     224                 :            : {
     225         [ +  - ]:       2264 :     osl::ClearableMutexGuard aGuard( m_aMutex );
     226                 :            : 
     227 [ +  - ][ +  - ]:       2264 :     m_aListeners.remove( listener );
     228                 :       2264 : }
     229                 :            : 
     230                 :            : // ------------------------------------------------------------------------
     231                 :            : 
     232                 :            : class ClipboardFactory : public ::cppu::WeakComponentImplHelper1<
     233                 :            :     com::sun::star::lang::XSingleServiceFactory
     234                 :            : >
     235                 :            : {
     236                 :            :     osl::Mutex m_aMutex;
     237                 :            : public:
     238                 :            :     ClipboardFactory();
     239                 :            :     virtual ~ClipboardFactory();
     240                 :            : 
     241                 :            :     /*
     242                 :            :      *  XSingleServiceFactory
     243                 :            :      */
     244                 :            :     virtual Reference< XInterface > SAL_CALL createInstance() throw();
     245                 :            :     virtual Reference< XInterface > SAL_CALL createInstanceWithArguments( const Sequence< Any >& rArgs ) throw();
     246                 :            : };
     247                 :            : 
     248                 :            : // ------------------------------------------------------------------------
     249                 :            : 
     250                 :         62 : ClipboardFactory::ClipboardFactory() :
     251                 :            :         cppu::WeakComponentImplHelper1<
     252                 :            :     com::sun::star::lang::XSingleServiceFactory
     253         [ +  - ]:         62 : >( m_aMutex )
     254                 :            : {
     255                 :         62 : }
     256                 :            : 
     257                 :            : // ------------------------------------------------------------------------
     258                 :            : 
     259         [ +  - ]:         62 : ClipboardFactory::~ClipboardFactory()
     260                 :            : {
     261         [ -  + ]:        124 : }
     262                 :            : 
     263                 :            : // ------------------------------------------------------------------------
     264                 :            : 
     265                 :       1149 : Reference< XInterface > ClipboardFactory::createInstance() throw()
     266                 :            : {
     267                 :       1149 :     return createInstanceWithArguments( Sequence< Any >() );
     268                 :            : }
     269                 :            : 
     270                 :            : // ------------------------------------------------------------------------
     271                 :            : 
     272                 :       1158 : Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Sequence< Any >& arguments ) throw()
     273                 :            : {
     274         [ +  - ]:       1158 :     SolarMutexGuard aGuard;
     275 [ +  - ][ +  - ]:       1158 :     Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateClipboard( arguments );
     276         [ +  - ]:       1158 :     return xResult;
     277                 :            : }
     278                 :            : 
     279                 :        186 : OUString SAL_CALL Clipboard_getImplementationName()
     280                 :            : {
     281                 :            :     #if defined UNX
     282                 :            :     return OUString(
     283                 :            :     #if ! defined QUARTZ
     284                 :            :     "com.sun.star.datatransfer.X11ClipboardSupport"
     285                 :            :     #else
     286                 :            :     "com.sun.star.datatransfer.clipboard.AquaClipboard"
     287                 :            :     #endif
     288                 :        186 :      );
     289                 :            :     #else
     290                 :            :     return GenericClipboard::getImplementationName_static();
     291                 :            :     #endif
     292                 :            : }
     293                 :            : 
     294                 :         62 : Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > &  )
     295                 :            : {
     296 [ +  - ][ +  - ]:         62 :     return Reference< XSingleServiceFactory >( new ClipboardFactory() );
     297                 :            : }
     298                 :            : 
     299                 :            : /*
     300                 :            : *   generic DragSource dummy
     301                 :            : */
     302                 :            : class GenericDragSource : public cppu::WeakComponentImplHelper2<
     303                 :            :             datatransfer::dnd::XDragSource,
     304                 :            :             XInitialization
     305                 :            :             >
     306                 :            : {
     307                 :            :     osl::Mutex                          m_aMutex;
     308                 :            : public:
     309         [ +  - ]:       2033 :     GenericDragSource() : cppu::WeakComponentImplHelper2< datatransfer::dnd::XDragSource, XInitialization >( m_aMutex ) {}
     310                 :            :     virtual ~GenericDragSource();
     311                 :            : 
     312                 :            :     // XDragSource
     313                 :            :     virtual sal_Bool    SAL_CALL isDragImageSupported() throw();
     314                 :            :     virtual sal_Int32   SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
     315                 :            :     virtual void        SAL_CALL startDrag(
     316                 :            :                                      const datatransfer::dnd::DragGestureEvent& trigger,
     317                 :            :                                      sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
     318                 :            :                                      const Reference< datatransfer::XTransferable >& transferable,
     319                 :            :                                      const Reference< datatransfer::dnd::XDragSourceListener >& listener
     320                 :            :                                      ) throw();
     321                 :            : 
     322                 :            :     // XInitialization
     323                 :            :     virtual void        SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
     324                 :            : 
     325                 :            :     static Sequence< OUString > getSupportedServiceNames_static()
     326                 :            :     {
     327                 :            :         Sequence< OUString > aRet( 1 );
     328                 :            :         aRet[0] = OUString("com.sun.star.datatransfer.dnd.GenericDragSource");
     329                 :            :         return aRet;
     330                 :            :     }
     331                 :            : 
     332                 :            :     static OUString getImplementationName_static()
     333                 :            :     {
     334                 :            :         return OUString("com.sun.star.datatransfer.dnd.VclGenericDragSource");
     335                 :            :     }
     336                 :            : };
     337                 :            : 
     338         [ +  - ]:       2033 : GenericDragSource::~GenericDragSource()
     339                 :            : {
     340         [ -  + ]:       4066 : }
     341                 :            : 
     342                 :          0 : sal_Bool GenericDragSource::isDragImageSupported() throw()
     343                 :            : {
     344                 :          0 :     return sal_False;
     345                 :            : }
     346                 :            : 
     347                 :          0 : sal_Int32 GenericDragSource::getDefaultCursor( sal_Int8 ) throw()
     348                 :            : {
     349                 :          0 :     return 0;
     350                 :            : }
     351                 :            : 
     352                 :          0 : void GenericDragSource::startDrag( const datatransfer::dnd::DragGestureEvent&,
     353                 :            :                                    sal_Int8 /*sourceActions*/, sal_Int32 /*cursor*/, sal_Int32 /*image*/,
     354                 :            :                                    const Reference< datatransfer::XTransferable >&,
     355                 :            :                                    const Reference< datatransfer::dnd::XDragSourceListener >& listener
     356                 :            :                                    ) throw()
     357                 :            : {
     358         [ #  # ]:          0 :     datatransfer::dnd::DragSourceDropEvent aEv;
     359                 :          0 :     aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_COPY;
     360                 :          0 :     aEv.DropSuccess = sal_False;
     361 [ #  # ][ #  # ]:          0 :     listener->dragDropEnd( aEv );
                 [ #  # ]
     362                 :          0 : }
     363                 :            : 
     364                 :       2033 : void GenericDragSource::initialize( const Sequence< Any >& ) throw( Exception )
     365                 :            : {
     366                 :       2033 : }
     367                 :            : 
     368                 :            : 
     369                 :         62 : Sequence< OUString > SAL_CALL DragSource_getSupportedServiceNames()
     370                 :            : {
     371                 :            :     #if defined UNX
     372                 :            :     OUString aServiceName(
     373                 :            :     #if ! defined QUARTZ
     374                 :            :     "com.sun.star.datatransfer.dnd.X11DragSource"
     375                 :            :     #else
     376                 :            :     "com.sun.star.datatransfer.dnd.OleDragSource"
     377                 :            :     #endif
     378                 :         62 :                                                                );
     379         [ +  - ]:         62 :     return Sequence< OUString >(&aServiceName, 1);
     380                 :            :     #else
     381                 :            :     return GenericDragSource::getSupportedServiceNames_static();
     382                 :            :     #endif
     383                 :            : }
     384                 :            : 
     385                 :        186 : OUString SAL_CALL DragSource_getImplementationName()
     386                 :            : {
     387                 :            :     #if defined UNX
     388                 :            :     return OUString(
     389                 :            :     #if ! defined QUARTZ
     390                 :            :     "com.sun.star.datatransfer.dnd.XdndSupport"
     391                 :            :     #else
     392                 :            :     "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"
     393                 :            :     #endif
     394                 :        186 :                                                   );
     395                 :            :     #else
     396                 :            :     return GenericDragSource::getImplementationName_static();
     397                 :            :     #endif
     398                 :            : }
     399                 :            : 
     400                 :       2033 : Reference< XInterface > SAL_CALL DragSource_createInstance( const Reference< XMultiServiceFactory >&  )
     401                 :            : {
     402         [ +  - ]:       2033 :     SolarMutexGuard aGuard;
     403 [ +  - ][ +  - ]:       2033 :     Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDragSource();
     404         [ +  - ]:       2033 :     return xResult;
     405                 :            : }
     406                 :            : 
     407                 :            : /*
     408                 :            : *   generic DragSource dummy
     409                 :            : */
     410                 :            : 
     411                 :            : class GenericDropTarget : public cppu::WeakComponentImplHelper2<
     412                 :            :                                            datatransfer::dnd::XDropTarget,
     413                 :            :                                            XInitialization
     414                 :            :                                            >
     415                 :            : {
     416                 :            :     osl::Mutex m_aMutex;
     417                 :            : public:
     418                 :       2033 :     GenericDropTarget() : cppu::WeakComponentImplHelper2<
     419                 :            :                                            datatransfer::dnd::XDropTarget,
     420                 :            :                                            XInitialization
     421         [ +  - ]:       2033 :                                            > ( m_aMutex )
     422                 :       2033 :     {}
     423                 :            :     virtual ~GenericDropTarget();
     424                 :            : 
     425                 :            :     // XInitialization
     426                 :            :     virtual void        SAL_CALL initialize( const Sequence< Any >& args ) throw ( Exception );
     427                 :            : 
     428                 :            :     // XDropTarget
     429                 :            :     virtual void        SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
     430                 :            :     virtual void        SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
     431                 :            :     virtual sal_Bool    SAL_CALL isActive() throw();
     432                 :            :     virtual void        SAL_CALL setActive( sal_Bool active ) throw();
     433                 :            :     virtual sal_Int8    SAL_CALL getDefaultActions() throw();
     434                 :            :     virtual void        SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
     435                 :            : 
     436                 :            :     static Sequence< OUString > getSupportedServiceNames_static()
     437                 :            :     {
     438                 :            :         Sequence< OUString > aRet( 1 );
     439                 :            :         aRet[0] = OUString("com.sun.star.datatransfer.dnd.GenericDropTarget");
     440                 :            :         return aRet;
     441                 :            :     }
     442                 :            : 
     443                 :            :     static OUString getImplementationName_static()
     444                 :            :     {
     445                 :            :         return OUString("com.sun.star.datatransfer.dnd.VclGenericDropTarget");
     446                 :            :     }
     447                 :            : };
     448                 :            : 
     449         [ +  - ]:       2033 : GenericDropTarget::~GenericDropTarget()
     450                 :            : {
     451         [ -  + ]:       4066 : }
     452                 :            : 
     453                 :       2033 : void GenericDropTarget::initialize( const Sequence< Any >& ) throw( Exception )
     454                 :            : {
     455                 :       2033 : }
     456                 :            : 
     457                 :       2033 : void GenericDropTarget::addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw()
     458                 :            : {
     459                 :       2033 : }
     460                 :            : 
     461                 :       2033 : void GenericDropTarget::removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw()
     462                 :            : {
     463                 :       2033 : }
     464                 :            : 
     465                 :          0 : sal_Bool GenericDropTarget::isActive() throw()
     466                 :            : {
     467                 :          0 :     return sal_False;
     468                 :            : }
     469                 :            : 
     470                 :          0 : void GenericDropTarget::setActive( sal_Bool ) throw()
     471                 :            : {
     472                 :          0 : }
     473                 :            : 
     474                 :      14603 : sal_Int8 GenericDropTarget::getDefaultActions() throw()
     475                 :            : {
     476                 :      14603 :     return 0;
     477                 :            : }
     478                 :            : 
     479                 :          0 : void GenericDropTarget::setDefaultActions( sal_Int8) throw()
     480                 :            : {
     481                 :          0 : }
     482                 :            : 
     483                 :         62 : Sequence< OUString > SAL_CALL DropTarget_getSupportedServiceNames()
     484                 :            : {
     485                 :            :     #if defined UNX
     486                 :            :     OUString aServiceName(
     487                 :            :     #if ! defined QUARTZ
     488                 :            :     "com.sun.star.datatransfer.dnd.X11DropTarget"
     489                 :            :     #else
     490                 :            :     "com.sun.star.datatransfer.dnd.OleDropTarget"
     491                 :            :     #endif
     492                 :         62 :                                                                );
     493         [ +  - ]:         62 :     return Sequence< OUString >(&aServiceName, 1);
     494                 :            :     #else
     495                 :            :     return GenericDropTarget::getSupportedServiceNames_static();
     496                 :            :     #endif
     497                 :            : }
     498                 :            : 
     499                 :        124 : OUString SAL_CALL DropTarget_getImplementationName()
     500                 :            : {
     501                 :            :     #if defined UNX
     502                 :            :     return OUString(
     503                 :            :     #if ! defined QUARTZ
     504                 :            :     "com.sun.star.datatransfer.dnd.XdndDropTarget"
     505                 :            :     #else
     506                 :            :     "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
     507                 :            :     #endif
     508                 :        124 :                      );
     509                 :            :     #else
     510                 :            :     return GenericDropTarget::getImplementationName_static();
     511                 :            :     #endif
     512                 :            : }
     513                 :            : 
     514                 :       2033 : Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMultiServiceFactory >&  )
     515                 :            : {
     516         [ +  - ]:       2033 :     SolarMutexGuard aGuard;
     517 [ +  - ][ +  - ]:       2033 :     Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDropTarget();
     518         [ +  - ]:       2033 :     return xResult;
     519                 :            : }
     520                 :            : 
     521                 :            : 
     522                 :            : } // namespace vcl
     523                 :            : 
     524                 :            : /*
     525                 :            : *   SalInstance generic
     526                 :            : */
     527                 :       1158 : Reference< XInterface > SalInstance::CreateClipboard( const Sequence< Any >& )
     528                 :            : {
     529         [ +  - ]:       1158 :     return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericClipboard() );
     530                 :            : }
     531                 :            : 
     532                 :       2033 : Reference< XInterface > SalInstance::CreateDragSource()
     533                 :            : {
     534         [ +  - ]:       2033 :     return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDragSource() );
     535                 :            : }
     536                 :            : 
     537                 :       2033 : Reference< XInterface > SalInstance::CreateDropTarget()
     538                 :            : {
     539         [ +  - ]:       2033 :     return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDropTarget() );
     540                 :            : }
     541                 :            : 
     542                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10