1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_
21 #define __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
26 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
27 #include <com/sun/star/frame/XFrame.hpp>
29 #include <cppuhelper/implbase1.hxx>
31 #include <sot/exchange.hxx>
36 class DropTargetListener
: private ThreadHelpBase
37 , public ::cppu::WeakImplHelper1
< ::com::sun::star::datatransfer::dnd::XDropTargetListener
>
39 //___________________________________________
43 /// uno service manager to create necessary services
44 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
45 /// weakreference to target frame (Don't use a hard reference. Owner can't delete us then!)
46 css::uno::WeakReference
< css::frame::XFrame
> m_xTargetFrame
;
48 DataFlavorExVector
* m_pFormats
;
50 //___________________________________________
54 DropTargetListener( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
,
55 const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
56 ~DropTargetListener( );
58 //___________________________________________
63 virtual void SAL_CALL
disposing ( const css::lang::EventObject
& Source
) throw(css::uno::RuntimeException
);
65 // XDropTargetListener
66 virtual void SAL_CALL
drop ( const css::datatransfer::dnd::DropTargetDropEvent
& dtde
) throw(css::uno::RuntimeException
);
67 virtual void SAL_CALL
dragEnter ( const css::datatransfer::dnd::DropTargetDragEnterEvent
& dtdee
) throw(css::uno::RuntimeException
);
68 virtual void SAL_CALL
dragExit ( const css::datatransfer::dnd::DropTargetEvent
& dte
) throw(css::uno::RuntimeException
);
69 virtual void SAL_CALL
dragOver ( const css::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(css::uno::RuntimeException
);
70 virtual void SAL_CALL
dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent
& dtde
) throw(css::uno::RuntimeException
);
72 //___________________________________________
76 void implts_BeginDrag ( const css::uno::Sequence
< css::datatransfer::DataFlavor
>& rSupportedDataFlavors
);
77 void implts_EndDrag ( );
78 sal_Bool
implts_IsDropFormatSupported( SotFormatStringId nFormat
);
79 void implts_OpenFile ( const String
& rFilePath
);
81 }; // class DropTargetListener
83 } // namespace framework
85 #endif // __FRAMEWORK_CLASSES_DROPTARGETLISTENER_HXX_
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */