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 : : #include <vcl/dndhelp.hxx>
30 : :
31 : : using namespace ::com::sun::star;
32 : :
33 [ - + ]: 7753 : vcl::unohelper::DragAndDropClient::~DragAndDropClient() {}
34 : :
35 : 0 : void vcl::unohelper::DragAndDropClient::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& /*dge*/ ) throw (::com::sun::star::uno::RuntimeException)
36 : : {
37 : 0 : }
38 : :
39 : 0 : void vcl::unohelper::DragAndDropClient::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException)
40 : : {
41 : 0 : }
42 : :
43 : 0 : void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException)
44 : : {
45 : 0 : }
46 : :
47 : 0 : void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& /*dse*/ ) throw (::com::sun::star::uno::RuntimeException)
48 : : {
49 : 0 : }
50 : :
51 : 0 : void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException)
52 : : {
53 : 0 : }
54 : :
55 : 0 : void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException)
56 : : {
57 : 0 : }
58 : :
59 : 0 : void vcl::unohelper::DragAndDropClient::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException)
60 : : {
61 : 0 : }
62 : :
63 : 0 : void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& /*dtdee*/ ) throw (::com::sun::star::uno::RuntimeException)
64 : : {
65 : 0 : }
66 : :
67 : 0 : void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& /*dte*/ ) throw (::com::sun::star::uno::RuntimeException)
68 : : {
69 : 0 : }
70 : :
71 : 0 : void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException)
72 : : {
73 : 0 : }
74 : :
75 : 0 : void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException)
76 : : {
77 : 0 : }
78 : :
79 : : // =======================================================================
80 : :
81 : 7773 : vcl::unohelper::DragAndDropWrapper::DragAndDropWrapper( DragAndDropClient* pClient )
82 : : {
83 : 7773 : mpClient = pClient;
84 : 7773 : }
85 : :
86 [ + - ]: 7753 : vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper()
87 : : {
88 [ - + ]: 15506 : }
89 : :
90 : : // uno::XInterface
91 : 38700 : uno::Any vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
92 : : {
93 : : uno::Any aRet = ::cppu::queryInterface( rType,
94 : : (static_cast< ::com::sun::star::lang::XEventListener* >( (::com::sun::star::datatransfer::dnd::XDragGestureListener*)this) ),
95 : : (static_cast< ::com::sun::star::datatransfer::dnd::XDragGestureListener* >(this)),
96 : : (static_cast< ::com::sun::star::datatransfer::dnd::XDragSourceListener* >(this)),
97 [ + - ]: 38700 : (static_cast< ::com::sun::star::datatransfer::dnd::XDropTargetListener* >(this)) );
98 [ + - ][ # # ]: 38700 : return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
99 : : }
100 : :
101 : : // ::com::sun::star::lang::XEventListener
102 : 7858 : void vcl::unohelper::DragAndDropWrapper::disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw (::com::sun::star::uno::RuntimeException)
103 : : {
104 : : // Empty Source means it's the client, because the client is not a XInterface
105 [ + + ]: 7858 : if ( !rEvent.Source.is() )
106 : 7648 : mpClient = NULL;
107 : 7858 : }
108 : :
109 : :
110 : : // ::com::sun::star::datatransfer::dnd::XDragGestureListener
111 : 0 : void vcl::unohelper::DragAndDropWrapper::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw (::com::sun::star::uno::RuntimeException)
112 : : {
113 [ # # ]: 0 : if ( mpClient )
114 : 0 : mpClient->dragGestureRecognized( rDGE );
115 : 0 : }
116 : :
117 : : // ::com::sun::star::datatransfer::dnd::XDragSourceListener
118 : 0 : void vcl::unohelper::DragAndDropWrapper::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& rDSDE ) throw (::com::sun::star::uno::RuntimeException)
119 : : {
120 [ # # ]: 0 : if ( mpClient )
121 : 0 : mpClient->dragDropEnd( rDSDE );
122 : 0 : }
123 : :
124 : 0 : void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException)
125 : : {
126 [ # # ]: 0 : if ( mpClient )
127 : 0 : mpClient->dragEnter( dsde );
128 : 0 : }
129 : :
130 : 0 : void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw (::com::sun::star::uno::RuntimeException)
131 : : {
132 [ # # ]: 0 : if ( mpClient )
133 : 0 : mpClient->dragExit( dse );
134 : 0 : }
135 : :
136 : 0 : void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException)
137 : : {
138 [ # # ]: 0 : if ( mpClient )
139 : 0 : mpClient->dragOver( dsde );
140 : 0 : }
141 : :
142 : 0 : void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException)
143 : : {
144 [ # # ]: 0 : if ( mpClient )
145 : 0 : mpClient->dropActionChanged( dsde );
146 : 0 : }
147 : :
148 : : // ::com::sun::star::datatransfer::dnd::XDropTargetListener
149 : 0 : void vcl::unohelper::DragAndDropWrapper::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
150 : : {
151 [ # # ]: 0 : if ( mpClient )
152 : 0 : mpClient->drop( rDTDE );
153 : 0 : }
154 : :
155 : 0 : void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDEE ) throw (::com::sun::star::uno::RuntimeException)
156 : : {
157 [ # # ]: 0 : if ( mpClient )
158 : 0 : mpClient->dragEnter( rDTDEE );
159 : 0 : }
160 : :
161 : 0 : void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException)
162 : : {
163 [ # # ]: 0 : if ( mpClient )
164 : 0 : mpClient->dragExit( dte );
165 : 0 : }
166 : :
167 : 0 : void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
168 : : {
169 [ # # ]: 0 : if ( mpClient )
170 : 0 : mpClient->dragOver( rDTDE );
171 : 0 : }
172 : :
173 : 0 : void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
174 : : {
175 [ # # ]: 0 : if ( mpClient )
176 : 0 : mpClient->dropActionChanged( rDTDE );
177 : 0 : }
178 : :
179 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|