View | Details | Raw Unified | Return to issue 113333
Collapse All | Expand All

(-)a/vcl/inc/vcl/dndevdis.hxx (+114 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
5
 * Copyright 2000, 2010 Oracle and/or its affiliates.
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
9
 * This file is part of OpenOffice.org.
10
 *
11
 * OpenOffice.org is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Lesser General Public License version 3
13
 * only, as published by the Free Software Foundation.
14
 *
15
 * OpenOffice.org is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Lesser General Public License version 3 for more details
19
 * (a copy is included in the LICENSE file that accompanied this code).
20
 *
21
 * You should have received a copy of the GNU Lesser General Public License
22
 * version 3 along with OpenOffice.org.  If not, see
23
 * <http://www.openoffice.org/license.html>
24
 * for a copy of the LGPLv3 License.
25
 *
26
 ************************************************************************/
27
28
#ifndef _DNDEVDIS_HXX_
29
#define _DNDEVDIS_HXX_
30
31
#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
32
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
33
34
#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_
35
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
36
#endif
37
#include <cppuhelper/implbase3.hxx>
38
#include <vcl/window.hxx>
39
40
class DNDEventDispatcher: public ::cppu::WeakImplHelper3< 
41
	::com::sun::star::datatransfer::dnd::XDropTargetListener,
42
	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
43
	::com::sun::star::datatransfer::dnd::XDragGestureListener > 
44
{
45
	Window * m_pTopWindow;
46
	Window * m_pCurrentWindow;
47
48
	::osl::Mutex m_aMutex;
49
	::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList;
50
51
	/*
52
	 * fire the events on the dnd listener container of the specified window
53
	 */
54
	 
55
	sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
56
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
57
		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
58
59
	sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
60
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
61
62
	sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
63
64
	sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
65
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
66
67
	sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext, 
68
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
69
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
70
71
	sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource, 
72
		const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
73
74
public:
75
76
	DNDEventDispatcher( Window * pTopWindow );
77
	virtual ~DNDEventDispatcher();
78
79
	/*
80
	 * XDropTargetDragContext
81
	 */
82
83
	virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException);
84
	virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException);
85
86
	/*
87
	 * XDropTargetListener
88
	 */
89
90
	virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
91
	virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
92
	virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
93
	virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
94
	virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
95
96
	/*
97
	 * XDragGestureListener
98
	 */
99
     
100
    virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
101
102
103
	/*
104
	 * XEventListener
105
	 */
106
107
	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException); 
108
};
109
110
//==================================================================================================
111
// 
112
//==================================================================================================
113
114
#endif
(-)a/vcl/inc/vcl/dndlcon.hxx (+124 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
5
 * Copyright 2000, 2010 Oracle and/or its affiliates.
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
9
 * This file is part of OpenOffice.org.
10
 *
11
 * OpenOffice.org is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Lesser General Public License version 3
13
 * only, as published by the Free Software Foundation.
14
 *
15
 * OpenOffice.org is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Lesser General Public License version 3 for more details
19
 * (a copy is included in the LICENSE file that accompanied this code).
20
 *
21
 * You should have received a copy of the GNU Lesser General Public License
22
 * version 3 along with OpenOffice.org.  If not, see
23
 * <http://www.openoffice.org/license.html>
24
 * for a copy of the LGPLv3 License.
25
 *
26
 ************************************************************************/
27
28
#ifndef _DNDLCON_HXX_
29
#define _DNDLCON_HXX_
30
31
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
32
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
33
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
34
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
35
#include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp>
36
#include <cppuhelper/compbase4.hxx>
37
38
#include <vcl/unohelp2.hxx>
39
40
class DNDListenerContainer :    public ::vcl::unohelper::MutexHelper, 
41
                                public ::cppu::WeakComponentImplHelper4< 
42
	::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \
43
	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
44
	::com::sun::star::datatransfer::dnd::XDropTargetDropContext,
45
	::com::sun::star::datatransfer::dnd::XDropTarget >
46
{
47
	sal_Bool m_bActive;
48
	sal_Int8 m_nDefaultActions;
49
50
    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext;
51
    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext;
52
53
public:
54
55
	DNDListenerContainer( sal_Int8 nDefaultActions );
56
	virtual ~DNDListenerContainer();
57
58
	sal_uInt32 fireDropEvent( 
59
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context,
60
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
61
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable );
62
63
	sal_uInt32 fireDragExitEvent();
64
65
	sal_uInt32 fireDragOverEvent(
66
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
67
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
68
69
	sal_uInt32 fireDragEnterEvent(
70
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
71
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
72
		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& dataFlavor );
73
74
	sal_uInt32 fireDropActionChangedEvent(
75
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
76
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
77
78
	sal_uInt32 fireDragGestureEvent(
79
		sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY, 
80
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource,
81
		const ::com::sun::star::uno::Any& triggerEvent );
82
83
	/*
84
	 * XDragGestureRecognizer
85
	 */
86
	 
87
	virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
88
	virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
89
	virtual void SAL_CALL resetRecognizer(  ) throw(::com::sun::star::uno::RuntimeException);
90
91
   	/*
92
	 * XDropTargetDragContext
93
	 */
94
95
    virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw (::com::sun::star::uno::RuntimeException);
96
    virtual void SAL_CALL rejectDrag(  ) throw (::com::sun::star::uno::RuntimeException);
97
98
99
   	/*
100
	 * XDropTargetDropContext
101
	 */
102
103
    virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) throw (::com::sun::star::uno::RuntimeException);
104
    virtual void SAL_CALL rejectDrop(  ) throw (::com::sun::star::uno::RuntimeException);
105
    virtual void SAL_CALL dropComplete( sal_Bool success ) throw (::com::sun::star::uno::RuntimeException);
106
107
	/*
108
	 * XDropTarget
109
	 */
110
	 
111
	virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
112
	virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
113
	virtual sal_Bool SAL_CALL isActive(  ) throw(::com::sun::star::uno::RuntimeException);
114
	virtual void SAL_CALL setActive( sal_Bool active ) throw(::com::sun::star::uno::RuntimeException);
115
	virtual sal_Int8 SAL_CALL getDefaultActions(  ) throw(::com::sun::star::uno::RuntimeException);
116
	virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(::com::sun::star::uno::RuntimeException);
117
};
118
119
120
//==================================================================================================
121
// 
122
//==================================================================================================
123
124
#endif
(-)a/vcl/inc/vcl/ilstbox.hxx (+2 lines)
Lines 396-401 Link Here
396
						mbHScroll		: 1,	// HScroll an oder aus
396
						mbHScroll		: 1,	// HScroll an oder aus
397
						mbAutoHScroll	: 1;	// AutoHScroll an oder aus
397
						mbAutoHScroll	: 1;	// AutoHScroll an oder aus
398
	Link				maScrollHdl;	// Weil der vom ImplListBoxWindow selbst benoetigt wird.
398
	Link				maScrollHdl;	// Weil der vom ImplListBoxWindow selbst benoetigt wird.
399
    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
399
400
400
protected:
401
protected:
401
	virtual void		GetFocus();
402
	virtual void		GetFocus();
Lines 500-505 Link Here
500
501
501
	// pb: #106948# explicit mirroring for calc
502
	// pb: #106948# explicit mirroring for calc
502
	inline void		EnableMirroring()	{ maLBWindow.EnableMirroring(); }
503
	inline void		EnableMirroring()	{ maLBWindow.EnableMirroring(); }
504
    inline void     SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; }
503
};
505
};
504
506
505
// -----------------------------
507
// -----------------------------
(-)a/vcl/source/control/lstbox.cxx (-3 / +11 lines)
Lines 44-52 Link Here
44
44
45
#include "tools/debug.hxx"
45
#include "tools/debug.hxx"
46
46
47
#include <vcl/dndevdis.hxx>
48
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
47
49
48
50
// =======================================================================
49
// =======================================================================
50
51
51
ListBox::ListBox( WindowType nType ) : Control( nType )
52
ListBox::ListBox( WindowType nType ) : Control( nType )
52
{
53
{
Lines 119-124 Link Here
119
	Control::ImplInit( pParent, nStyle, NULL );
120
	Control::ImplInit( pParent, nStyle, NULL );
120
	SetBackground();
121
	SetBackground();
121
122
123
    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener> xDrop = new DNDEventDispatcher(this);
124
122
	if( nStyle & WB_DROPDOWN )
125
	if( nStyle & WB_DROPDOWN )
123
	{
126
	{
124
        sal_Int32 nLeft, nTop, nRight, nBottom;
127
        sal_Int32 nLeft, nTop, nRight, nBottom;
Lines 145-160 Link Here
145
		mpFloatWin = new ImplListBoxFloatingWindow( this );
148
		mpFloatWin = new ImplListBoxFloatingWindow( this );
146
		mpFloatWin->SetAutoWidth( TRUE );
149
		mpFloatWin->SetAutoWidth( TRUE );
147
		mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
150
		mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
151
        mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
148
152
149
		mpImplWin = new ImplWin( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER );
153
		mpImplWin = new ImplWin( this, (nStyle & (WB_LEFT|WB_RIGHT|WB_CENTER))|WB_NOBORDER );
150
		mpImplWin->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
154
		mpImplWin->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
151
		mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
155
		mpImplWin->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
152
		mpImplWin->Show();
156
		mpImplWin->Show();
157
        mpImplWin->GetDropTarget()->addDropTargetListener(xDrop);
153
158
154
		mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE );
159
		mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE );
155
		ImplInitDropDownButton( mpBtn );
160
		ImplInitDropDownButton( mpBtn );
156
		mpBtn->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
161
		mpBtn->SetMBDownHdl( LINK( this, ListBox, ImplClickBtnHdl ) );
157
		mpBtn->Show();
162
		mpBtn->Show();
163
        mpBtn->GetDropTarget()->addDropTargetListener(xDrop);
158
164
159
	}
165
	}
160
166
Lines 169-174 Link Here
169
	mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
175
	mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
170
	mpImplLB->SetPosPixel( Point() );
176
	mpImplLB->SetPosPixel( Point() );
171
	mpImplLB->Show();
177
	mpImplLB->Show();
178
    
179
    mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
180
    mpImplLB->SetDropTraget(xDrop);
172
181
173
	if ( mpFloatWin )
182
	if ( mpFloatWin )
174
	{
183
	{
Lines 1615-1621 Link Here
1615
}
1624
}
1616
1625
1617
// =======================================================================
1626
// =======================================================================
1618
1619
MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
1627
MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
1620
	ListBox( WINDOW_MULTILISTBOX )
1628
	ListBox( WINDOW_MULTILISTBOX )
1621
{
1629
{
(-)a/vcl/source/window/dndevdis.cxx (-2 / +2 lines)
Lines 28-35 Link Here
28
// MARKER(update_precomp.py): autogen include statement, do not remove
28
// MARKER(update_precomp.py): autogen include statement, do not remove
29
#include "precompiled_vcl.hxx"
29
#include "precompiled_vcl.hxx"
30
30
31
#include <dndevdis.hxx>
31
#include <vcl/dndevdis.hxx>
32
#include <dndlcon.hxx>
32
#include <vcl/dndlcon.hxx>
33
#include <vcl/window.h>
33
#include <vcl/window.h>
34
34
35
#include <vos/mutex.hxx>
35
#include <vos/mutex.hxx>
(-)a/vcl/source/window/dndevdis.hxx (-114 lines)
Lines 1-114 Link Here
1
/*************************************************************************
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
5
 * Copyright 2000, 2010 Oracle and/or its affiliates.
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
9
 * This file is part of OpenOffice.org.
10
 *
11
 * OpenOffice.org is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Lesser General Public License version 3
13
 * only, as published by the Free Software Foundation.
14
 *
15
 * OpenOffice.org is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Lesser General Public License version 3 for more details
19
 * (a copy is included in the LICENSE file that accompanied this code).
20
 *
21
 * You should have received a copy of the GNU Lesser General Public License
22
 * version 3 along with OpenOffice.org.  If not, see
23
 * <http://www.openoffice.org/license.html>
24
 * for a copy of the LGPLv3 License.
25
 *
26
 ************************************************************************/
27
28
#ifndef _DNDEVDIS_HXX_
29
#define _DNDEVDIS_HXX_
30
31
#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
32
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
33
34
#ifndef _COM_SUN_STAR_DATATRANSFER_DND_XDRAGESTURERECOGNIZER_HPP_
35
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
36
#endif
37
#include <cppuhelper/implbase3.hxx>
38
#include <vcl/window.hxx>
39
40
class DNDEventDispatcher: public ::cppu::WeakImplHelper3< 
41
	::com::sun::star::datatransfer::dnd::XDropTargetListener,
42
	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
43
	::com::sun::star::datatransfer::dnd::XDragGestureListener > 
44
{
45
	Window * m_pTopWindow;
46
	Window * m_pCurrentWindow;
47
48
	::osl::Mutex m_aMutex;
49
	::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_aDataFlavorList;
50
51
	/*
52
	 * fire the events on the dnd listener container of the specified window
53
	 */
54
	 
55
	sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
56
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
57
		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
58
59
	sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
60
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
61
62
	sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
63
64
	sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext, 
65
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
66
67
	sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext, 
68
		const sal_Int8 nDropAction,	const Point& rLocation, const sal_Int8 nSourceAction,
69
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
70
71
	sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource, 
72
		const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
73
74
public:
75
76
	DNDEventDispatcher( Window * pTopWindow );
77
	virtual ~DNDEventDispatcher();
78
79
	/*
80
	 * XDropTargetDragContext
81
	 */
82
83
	virtual void SAL_CALL acceptDrag( sal_Int8 dropAction ) throw(::com::sun::star::uno::RuntimeException);
84
	virtual void SAL_CALL rejectDrag() throw(::com::sun::star::uno::RuntimeException);
85
86
	/*
87
	 * XDropTargetListener
88
	 */
89
90
	virtual void SAL_CALL drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
91
	virtual void SAL_CALL dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw(::com::sun::star::uno::RuntimeException);
92
	virtual void SAL_CALL dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw(::com::sun::star::uno::RuntimeException);
93
	virtual void SAL_CALL dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
94
	virtual void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw(::com::sun::star::uno::RuntimeException);
95
96
	/*
97
	 * XDragGestureListener
98
	 */
99
     
100
    virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
101
102
103
	/*
104
	 * XEventListener
105
	 */
106
107
	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException); 
108
};
109
110
//==================================================================================================
111
// 
112
//==================================================================================================
113
114
#endif
(-)a/vcl/source/window/dndlcon.cxx (-1 / +1 lines)
Lines 28-34 Link Here
28
// MARKER(update_precomp.py): autogen include statement, do not remove
28
// MARKER(update_precomp.py): autogen include statement, do not remove
29
#include "precompiled_vcl.hxx"
29
#include "precompiled_vcl.hxx"
30
30
31
#include<dndlcon.hxx>
31
#include <vcl/dndlcon.hxx>
32
32
33
using namespace ::cppu;
33
using namespace ::cppu;
34
using namespace ::com::sun::star::uno;
34
using namespace ::com::sun::star::uno;
(-)a/vcl/source/window/dndlcon.hxx (-124 lines)
Lines 1-124 Link Here
1
/*************************************************************************
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
5
 * Copyright 2000, 2010 Oracle and/or its affiliates.
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
9
 * This file is part of OpenOffice.org.
10
 *
11
 * OpenOffice.org is free software: you can redistribute it and/or modify
12
 * it under the terms of the GNU Lesser General Public License version 3
13
 * only, as published by the Free Software Foundation.
14
 *
15
 * OpenOffice.org is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Lesser General Public License version 3 for more details
19
 * (a copy is included in the LICENSE file that accompanied this code).
20
 *
21
 * You should have received a copy of the GNU Lesser General Public License
22
 * version 3 along with OpenOffice.org.  If not, see
23
 * <http://www.openoffice.org/license.html>
24
 * for a copy of the LGPLv3 License.
25
 *
26
 ************************************************************************/
27
28
#ifndef _DNDLCON_HXX_
29
#define _DNDLCON_HXX_
30
31
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
32
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
33
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
34
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
35
#include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp>
36
#include <cppuhelper/compbase4.hxx>
37
38
#include <vcl/unohelp2.hxx>
39
40
class DNDListenerContainer :    public ::vcl::unohelper::MutexHelper, 
41
                                public ::cppu::WeakComponentImplHelper4< 
42
	::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \
43
	::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
44
	::com::sun::star::datatransfer::dnd::XDropTargetDropContext,
45
	::com::sun::star::datatransfer::dnd::XDropTarget >
46
{
47
	sal_Bool m_bActive;
48
	sal_Int8 m_nDefaultActions;
49
50
    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext;
51
    ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext;
52
53
public:
54
55
	DNDListenerContainer( sal_Int8 nDefaultActions );
56
	virtual ~DNDListenerContainer();
57
58
	sal_uInt32 fireDropEvent( 
59
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context,
60
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
61
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable );
62
63
	sal_uInt32 fireDragExitEvent();
64
65
	sal_uInt32 fireDragOverEvent(
66
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
67
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
68
69
	sal_uInt32 fireDragEnterEvent(
70
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
71
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
72
		const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& dataFlavor );
73
74
	sal_uInt32 fireDropActionChangedEvent(
75
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context,
76
		sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
77
78
	sal_uInt32 fireDragGestureEvent(
79
		sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY, 
80
		const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource,
81
		const ::com::sun::star::uno::Any& triggerEvent );
82
83
	/*
84
	 * XDragGestureRecognizer
85
	 */
86
	 
87
	virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
88
	virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
89
	virtual void SAL_CALL resetRecognizer(  ) throw(::com::sun::star::uno::RuntimeException);
90
91
   	/*
92
	 * XDropTargetDragContext
93
	 */
94
95
    virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw (::com::sun::star::uno::RuntimeException);
96
    virtual void SAL_CALL rejectDrag(  ) throw (::com::sun::star::uno::RuntimeException);
97
98
99
   	/*
100
	 * XDropTargetDropContext
101
	 */
102
103
    virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) throw (::com::sun::star::uno::RuntimeException);
104
    virtual void SAL_CALL rejectDrop(  ) throw (::com::sun::star::uno::RuntimeException);
105
    virtual void SAL_CALL dropComplete( sal_Bool success ) throw (::com::sun::star::uno::RuntimeException);
106
107
	/*
108
	 * XDropTarget
109
	 */
110
	 
111
	virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
112
	virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
113
	virtual sal_Bool SAL_CALL isActive(  ) throw(::com::sun::star::uno::RuntimeException);
114
	virtual void SAL_CALL setActive( sal_Bool active ) throw(::com::sun::star::uno::RuntimeException);
115
	virtual sal_Int8 SAL_CALL getDefaultActions(  ) throw(::com::sun::star::uno::RuntimeException);
116
	virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(::com::sun::star::uno::RuntimeException);
117
};
118
119
120
//==================================================================================================
121
// 
122
//==================================================================================================
123
124
#endif
(-)a/vcl/source/window/winproc.cxx (-1 / +1 lines)
Lines 62-68 Link Here
62
#include <vcl/salgdi.hxx>
62
#include <vcl/salgdi.hxx>
63
#include <vcl/menu.hxx>
63
#include <vcl/menu.hxx>
64
64
65
#include <dndlcon.hxx>
65
#include <vcl/dndlcon.hxx>
66
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
66
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
67
#include <com/sun/star/awt/MouseEvent.hpp>
67
#include <com/sun/star/awt/MouseEvent.hpp>
68
68
(-)a/svtools/source/contnr/svlbox.cxx (+11 lines)
Lines 1518-1523 Link Here
1518
void SvLBox::Command( const CommandEvent& i_rCommandEvent )
1518
void SvLBox::Command( const CommandEvent& i_rCommandEvent )
1519
{
1519
{
1520
	DBG_CHKTHIS(SvLBox,0);
1520
	DBG_CHKTHIS(SvLBox,0);
1521
1522
    if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() )
1523
    {
1524
        Point aEventPos( i_rCommandEvent.GetMousePosPixel() );
1525
	    MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
1526
		MouseButtonUp( aMouseEvt );
1527
    }
1521
    Control::Command( i_rCommandEvent );
1528
    Control::Command( i_rCommandEvent );
1522
}
1529
}
Lines 1775-1780 Link Here
1775
{
1782
{
1776
	DBG_CHKTHIS(SvLBox,0);
1783
	DBG_CHKTHIS(SvLBox,0);
1784
    Point aEventPos( rPosPixel );
1785
    MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
1786
    MouseButtonUp( aMouseEvt );
1787
1777
	nOldDragMode = GetDragDropMode();
1788
	nOldDragMode = GetDragDropMode();
1778
    if ( !nOldDragMode )
1789
    if ( !nOldDragMode )
1779
        return;
1790
        return;

Return to issue 113333