diff options
author | Peter Burow <pb@openoffice.org> | 2001-06-15 08:31:09 +0000 |
---|---|---|
committer | Peter Burow <pb@openoffice.org> | 2001-06-15 08:31:09 +0000 |
commit | 3f29abd5c9cd0d4558ae6298b8bdc6fa7e191666 (patch) | |
tree | dd2c99eb7550f24c1afe499753106057f0f11217 /framework/inc | |
parent | 3e7f7207420720b574d19850c7dc7a617fa5bb5c (diff) |
fix: #88014# new class for d&d
Diffstat (limited to 'framework/inc')
-rw-r--r-- | framework/inc/classes/droptargetlistener.hxx | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/framework/inc/classes/droptargetlistener.hxx b/framework/inc/classes/droptargetlistener.hxx new file mode 100644 index 000000000000..e54c7486940a --- /dev/null +++ b/framework/inc/classes/droptargetlistener.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: droptargetlistener.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: pb $ $Date: 2001-06-15 09:26:57 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_ +#define __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDROPTARGETELISTENER_HPP_ +#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ +#include <com/sun/star/frame/XFrame.hpp> +#endif + +//_________________________________________________________________________________________________________________ +// includes of other projects +//_________________________________________________________________________________________________________________ + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif + +#ifndef _SOT_EXCHANGE_HXX_ +#include <sot/exchange.hxx> +#endif + +namespace framework +{ + +class DropTargetListener : public ::cppu::WeakImplHelper1< ::com::sun::star::datatransfer::dnd::XDropTargetListener > +{ + private: + + css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame; // weakreference to target frame (Don't use a hard reference. Owner can't delete us then!) + DataFlavorExVector* m_pFormats; + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + + // XDropTargetListener + virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException); + + private: + + void impl_BeginDrag( const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& rSupportedDataFlavors ); + void impl_EndDrag(); + sal_Bool impl_IsDropFormatSupported( SotFormatStringId nFormat ); + + public: + + DropTargetListener( css::uno::Reference< css::frame::XFrame > xFrame ); + ~DropTargetListener(); +}; + +} + +#endif // __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_ + |