Branch libreoffice-5-0-4
[LibreOffice.git] / dtrans / source / win32 / dnd / sourcecontext.hxx
blob3682ea2a9840d50aa9cfdd20889ecec41027aa99
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DND_SOURCECONTEXT_HXX
20 #define INCLUDED_DTRANS_SOURCE_WIN32_DND_SOURCECONTEXT_HXX
22 #include <cppuhelper/implbase1.hxx>
23 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
24 #include <cppuhelper/compbase1.hxx>
26 #include "source.hxx"
28 using namespace ::com::sun::star::datatransfer;
29 using namespace ::com::sun::star::datatransfer::dnd;
30 using namespace ::cppu;
31 using namespace ::com::sun::star::uno;
32 using namespace ::com::sun::star::lang;
34 // This class fires events to XDragSourceListener implementations.
35 // Of that interface only dragDropEnd and dropActionChanged are called.
36 // The functions dragEnter, dragExit and dragOver are not supported
37 // currently.
38 // An instance of SourceContext only lives as long as the drag and drop
39 // operation lasts.
40 class SourceContext: public MutexDummy,
41 public WeakComponentImplHelper1<XDragSourceContext>
43 DragSource* m_pDragSource;
44 Reference<XDragSource> m_dragSource;
45 // the action ( copy, move etc)
46 sal_Int8 m_currentAction;
48 SourceContext();
49 SourceContext( const SourceContext&);
50 SourceContext &operator= (const SourceContext& );
52 public:
53 SourceContext( DragSource* pSource, const Reference<XDragSourceListener>& listener);
54 ~SourceContext();
56 virtual void SAL_CALL addDragSourceListener( const Reference<XDragSourceListener >& dsl )
57 throw( RuntimeException);
58 virtual void SAL_CALL removeDragSourceListener( const Reference<XDragSourceListener >& dsl )
59 throw( RuntimeException);
60 virtual sal_Int32 SAL_CALL getCurrentCursor( )
61 throw( RuntimeException);
62 virtual void SAL_CALL setCursor( sal_Int32 cursorId )
63 throw( RuntimeException);
64 virtual void SAL_CALL setImage( sal_Int32 imageId )
65 throw( RuntimeException);
66 virtual void SAL_CALL transferablesFlavorsChanged( )
67 throw( RuntimeException);
69 // non - interface functions
70 void fire_dragDropEnd( sal_Bool success, sal_Int8 byte);
71 void fire_dropActionChanged( sal_Int8 dropAction, sal_Int8 userAction);
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */