merge the formfield patch from ooo-build
[ooovba.git] / framework / inc / classes / droptargetlistener.hxx
blob0b1ef72456d03058d122b7abbe77763a2b29cc65
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: droptargetlistener.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_
32 #define __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <general.h>
41 //_________________________________________________________________________________________________________________
42 // interface includes
43 //_________________________________________________________________________________________________________________
45 #ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDROPTARGETELISTENER_HPP_
46 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
47 #endif
48 #include <com/sun/star/frame/XFrame.hpp>
50 //_________________________________________________________________________________________________________________
51 // includes of other projects
52 //_________________________________________________________________________________________________________________
53 #include <cppuhelper/implbase1.hxx>
55 #ifndef _SOT_EXCHANGE_HXX_
56 #include <sot/exchange.hxx>
57 #endif
59 namespace framework
62 class DropTargetListener : private ThreadHelpBase
63 , public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDropTargetListener >
65 //___________________________________________
66 // member
67 private:
69 /// uno service manager to create neccessary services
70 css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
71 /// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!)
72 css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame;
73 /// drag/drop info
74 DataFlavorExVector* m_pFormats;
76 //___________________________________________
77 // c++ interface
78 public:
80 DropTargetListener( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ,
81 const css::uno::Reference< css::frame::XFrame >& xFrame );
82 ~DropTargetListener( );
84 //___________________________________________
85 // uno interface
86 public:
88 // XEventListener
89 virtual void SAL_CALL disposing ( const css::lang::EventObject& Source ) throw(css::uno::RuntimeException);
91 // XDropTargetListener
92 virtual void SAL_CALL drop ( const css::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(css::uno::RuntimeException);
93 virtual void SAL_CALL dragEnter ( const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(css::uno::RuntimeException);
94 virtual void SAL_CALL dragExit ( const css::datatransfer::dnd::DropTargetEvent& dte ) throw(css::uno::RuntimeException);
95 virtual void SAL_CALL dragOver ( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(css::uno::RuntimeException);
96 virtual void SAL_CALL dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(css::uno::RuntimeException);
98 //___________________________________________
99 // internal helper
100 private:
102 void implts_BeginDrag ( const css::uno::Sequence< css::datatransfer::DataFlavor >& rSupportedDataFlavors );
103 void implts_EndDrag ( );
104 sal_Bool implts_IsDropFormatSupported( SotFormatStringId nFormat );
105 void implts_OpenFile ( const String& rFilePath );
107 }; // class DropTargetListener
109 } // namespace framework
111 #endif // __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_