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