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 _DRAGSOURCECONTEXT_HXX_ 25 #define _DRAGSOURCECONTEXT_HXX_ 26 27 #include <cppuhelper/implbase1.hxx> 28 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp> 29 #include <cppuhelper/compbase1.hxx> 30 #include <cppuhelper/basemutex.hxx> 31 32 #include <boost/utility.hpp> 33 34 #include "DragSource.hxx" 35 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 DragSourceContext: public cppu::BaseMutex, 43 public cppu::WeakComponentImplHelper1<com::sun::star::datatransfer::dnd::XDragSourceContext>, 44 private ::boost::noncopyable 45 { 46 public: 47 DragSourceContext(DragSource* pSource); 48 ~DragSourceContext(); 49 50 virtual sal_Int32 SAL_CALL getCurrentCursor( ) 51 throw( com::sun::star::uno::RuntimeException); 52 53 virtual void SAL_CALL setCursor( sal_Int32 cursorId ) 54 throw( com::sun::star::uno::RuntimeException); 55 56 virtual void SAL_CALL setImage( sal_Int32 imageId ) 57 throw( com::sun::star::uno::RuntimeException); 58 59 virtual void SAL_CALL transferablesFlavorsChanged( ) 60 throw( com::sun::star::uno::RuntimeException); 61 62 private: 63 DragSource* m_pDragSource; 64 }; 65 66 67 68 #endif 69