xref: /AOO41X/main/vcl/unx/generic/dtrans/X11_dndcontext.hxx (revision ebfcd9af2ce496a86a62eef7379364d0a42a7f96)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DTRANS_X11_DNDCONTEXT_HXX
25 #define _DTRANS_X11_DNDCONTEXT_HXX
26 
27 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
28 #include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp>
29 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
30 #include <cppuhelper/implbase1.hxx>
31 
32 #include "tools/prex.h"
33 #include <X11/Xlib.h>
34 #include "tools/postx.h"
35 
36 using namespace com::sun::star::uno;
37 
38 namespace x11 {
39 
40     class SelectionManager;
41 
42     class DropTargetDropContext :
43         public ::cppu::WeakImplHelper1<
44     ::com::sun::star::datatransfer::dnd::XDropTargetDropContext
45     >
46     {
47         XLIB_Window                 m_aDropWindow;
48         XLIB_Time                   m_nTimestamp;
49         SelectionManager&           m_rManager;
50         com::sun::star::uno::Reference< XInterface >     m_xManagerRef;
51     public:
52         DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& );
53         virtual ~DropTargetDropContext();
54 
55         // XDropTargetDropContext
56         virtual void SAL_CALL acceptDrop( sal_Int8 dragOperation ) throw();
57         virtual void SAL_CALL rejectDrop() throw();
58         virtual void SAL_CALL dropComplete( sal_Bool success ) throw();
59     };
60 
61     class DropTargetDragContext :
62         public ::cppu::WeakImplHelper1<
63     ::com::sun::star::datatransfer::dnd::XDropTargetDragContext
64     >
65     {
66         XLIB_Window                 m_aDropWindow;
67         XLIB_Time                   m_nTimestamp;
68         SelectionManager&           m_rManager;
69         com::sun::star::uno::Reference< XInterface >     m_xManagerRef;
70     public:
71         DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& );
72         virtual ~DropTargetDragContext();
73 
74         // XDropTargetDragContext
75         virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw();
76         virtual void SAL_CALL rejectDrag() throw();
77     };
78 
79     class DragSourceContext :
80         public ::cppu::WeakImplHelper1<
81     ::com::sun::star::datatransfer::dnd::XDragSourceContext
82     >
83     {
84         XLIB_Window                 m_aDropWindow;
85         XLIB_Time                   m_nTimestamp;
86         SelectionManager&           m_rManager;
87         com::sun::star::uno::Reference< XInterface >     m_xManagerRef;
88     public:
89         DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
90         virtual ~DragSourceContext();
91 
92         // XDragSourceContext
93         virtual sal_Int32   SAL_CALL getCurrentCursor() throw();
94         virtual void        SAL_CALL setCursor( sal_Int32 cursorId ) throw();
95         virtual void        SAL_CALL setImage( sal_Int32 imageId ) throw();
96         virtual void        SAL_CALL transferablesFlavorsChanged() throw();
97     };
98 } // namespace
99 
100 #endif // _DTRANS_X11_DNDCONTEXT_HXX
101