update credits
[LibreOffice.git] / dtrans / source / win32 / dnd / sourcecontext.hxx
blob4d9e5c928dc9356e039a0b31985b602af250ea61
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 _SOURCECONTEXT_HXX_
20 #define _SOURCECONTEXT_HXX_
22 #include <cppuhelper/implbase1.hxx>
23 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
24 #include <cppuhelper/compbase1.hxx>
27 #include "source.hxx"
29 using namespace ::com::sun::star::datatransfer;
30 using namespace ::com::sun::star::datatransfer::dnd;
31 using namespace ::cppu;
32 using namespace ::com::sun::star::uno;
33 using namespace ::com::sun::star::lang;
36 // This class fires events to XDragSourceListener implementations.
37 // Of that interface only dragDropEnd and dropActionChanged are called.
38 // The functions dragEnter, dragExit and dragOver are not supported
39 // currently.
40 // An instance of SourceContext only lives as long as the drag and drop
41 // operation lasts.
42 class SourceContext: public MutexDummy,
43 public WeakComponentImplHelper1<XDragSourceContext>
45 DragSource* m_pDragSource;
46 Reference<XDragSource> m_dragSource;
47 // the action ( copy, move etc)
48 sal_Int8 m_currentAction;
50 SourceContext();
51 SourceContext( const SourceContext&);
52 SourceContext &operator= (const SourceContext& );
54 public:
55 SourceContext( DragSource* pSource, const Reference<XDragSourceListener>& listener);
56 ~SourceContext();
58 virtual void SAL_CALL addDragSourceListener( const Reference<XDragSourceListener >& dsl )
59 throw( RuntimeException);
60 virtual void SAL_CALL removeDragSourceListener( const Reference<XDragSourceListener >& dsl )
61 throw( RuntimeException);
62 virtual sal_Int32 SAL_CALL getCurrentCursor( )
63 throw( RuntimeException);
64 virtual void SAL_CALL setCursor( sal_Int32 cursorId )
65 throw( RuntimeException);
66 virtual void SAL_CALL setImage( sal_Int32 imageId )
67 throw( RuntimeException);
68 virtual void SAL_CALL transferablesFlavorsChanged( )
69 throw( RuntimeException);
73 // non - interface functions
74 void fire_dragDropEnd( sal_Bool success, sal_Int8 byte);
75 void fire_dropActionChanged( sal_Int8 dropAction, sal_Int8 userAction);
81 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */