Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <vcl/dndhelp.hxx>
21 :
22 : using namespace ::com::sun::star;
23 :
24 26049 : vcl::unohelper::DragAndDropClient::~DragAndDropClient() {}
25 :
26 0 : void vcl::unohelper::DragAndDropClient::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& /*dge*/ )
27 : throw (::com::sun::star::uno::RuntimeException,
28 : std::exception)
29 : {
30 0 : }
31 :
32 0 : void vcl::unohelper::DragAndDropClient::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& /*dsde*/ )
33 : throw (::com::sun::star::uno::RuntimeException,
34 : std::exception)
35 : {
36 0 : }
37 :
38 0 : void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ )
39 : throw (::com::sun::star::uno::RuntimeException,
40 : std::exception)
41 : {
42 0 : }
43 :
44 0 : void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& /*dse*/ )
45 : throw (::com::sun::star::uno::RuntimeException,
46 : std::exception)
47 : {
48 0 : }
49 :
50 0 : void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ )
51 : throw (::com::sun::star::uno::RuntimeException,
52 : std::exception)
53 : {
54 0 : }
55 :
56 0 : void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& /*dsde*/ )
57 : throw (::com::sun::star::uno::RuntimeException,
58 : std::exception)
59 : {
60 0 : }
61 :
62 0 : void vcl::unohelper::DragAndDropClient::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& /*dtde*/ )
63 : throw (::com::sun::star::uno::RuntimeException,
64 : std::exception)
65 : {
66 0 : }
67 :
68 0 : void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& /*dtdee*/ )
69 : throw (::com::sun::star::uno::RuntimeException,
70 : std::exception)
71 : {
72 0 : }
73 :
74 0 : void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& /*dte*/ )
75 : throw (::com::sun::star::uno::RuntimeException,
76 : std::exception)
77 : {
78 0 : }
79 :
80 0 : void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& /*dtde*/ )
81 : throw (::com::sun::star::uno::RuntimeException,
82 : std::exception)
83 : {
84 0 : }
85 :
86 0 : void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& /*dtde*/ )
87 : throw (::com::sun::star::uno::RuntimeException,
88 : std::exception)
89 : {
90 0 : }
91 :
92 26059 : vcl::unohelper::DragAndDropWrapper::DragAndDropWrapper( DragAndDropClient* pClient )
93 : {
94 26059 : mpClient = pClient;
95 26059 : }
96 :
97 52098 : vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper()
98 : {
99 52098 : }
100 :
101 : // uno::XInterface
102 130025 : uno::Any vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException, std::exception)
103 : {
104 : uno::Any aRet = ::cppu::queryInterface( rType,
105 : (static_cast< ::com::sun::star::lang::XEventListener* >( (::com::sun::star::datatransfer::dnd::XDragGestureListener*)this) ),
106 : (static_cast< ::com::sun::star::datatransfer::dnd::XDragGestureListener* >(this)),
107 : (static_cast< ::com::sun::star::datatransfer::dnd::XDragSourceListener* >(this)),
108 130025 : (static_cast< ::com::sun::star::datatransfer::dnd::XDropTargetListener* >(this)) );
109 130025 : return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
110 : }
111 :
112 : // ::com::sun::star::lang::XEventListener
113 26289 : void vcl::unohelper::DragAndDropWrapper::disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception)
114 : {
115 : // Empty Source means it's the client, because the client is not a XInterface
116 26289 : if ( !rEvent.Source.is() )
117 25809 : mpClient = NULL;
118 26289 : }
119 :
120 : // ::com::sun::star::datatransfer::dnd::XDragGestureListener
121 0 : void vcl::unohelper::DragAndDropWrapper::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
122 : {
123 0 : if ( mpClient )
124 0 : mpClient->dragGestureRecognized( rDGE );
125 0 : }
126 :
127 : // ::com::sun::star::datatransfer::dnd::XDragSourceListener
128 0 : void vcl::unohelper::DragAndDropWrapper::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& rDSDE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
129 : {
130 0 : if ( mpClient )
131 0 : mpClient->dragDropEnd( rDSDE );
132 0 : }
133 :
134 0 : void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception)
135 : {
136 0 : if ( mpClient )
137 0 : mpClient->dragEnter( dsde );
138 0 : }
139 :
140 0 : void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent& dse ) throw (::com::sun::star::uno::RuntimeException, std::exception)
141 : {
142 0 : if ( mpClient )
143 0 : mpClient->dragExit( dse );
144 0 : }
145 :
146 0 : void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception)
147 : {
148 0 : if ( mpClient )
149 0 : mpClient->dragOver( dsde );
150 0 : }
151 :
152 0 : void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent& dsde ) throw (::com::sun::star::uno::RuntimeException, std::exception)
153 : {
154 0 : if ( mpClient )
155 0 : mpClient->dropActionChanged( dsde );
156 0 : }
157 :
158 : // ::com::sun::star::datatransfer::dnd::XDropTargetListener
159 0 : void vcl::unohelper::DragAndDropWrapper::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
160 : {
161 0 : if ( mpClient )
162 0 : mpClient->drop( rDTDE );
163 0 : }
164 :
165 0 : void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDEE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
166 : {
167 0 : if ( mpClient )
168 0 : mpClient->dragEnter( rDTDEE );
169 0 : }
170 :
171 0 : void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException, std::exception)
172 : {
173 0 : if ( mpClient )
174 0 : mpClient->dragExit( dte );
175 0 : }
176 :
177 0 : void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
178 : {
179 0 : if ( mpClient )
180 0 : mpClient->dragOver( rDTDE );
181 0 : }
182 :
183 0 : void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException, std::exception)
184 : {
185 0 : if ( mpClient )
186 0 : mpClient->dropActionChanged( rDTDE );
187 0 : }
188 :
189 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|