1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2/* 3 * This file is part of the LibreOffice project. 4 * 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/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 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 . 18 */ 19 20#ifndef __com_sun_star_datatransfer_dnd_XDragSource_idl__ 21#define __com_sun_star_datatransfer_dnd_XDragSource_idl__ 22 23#include <com/sun/star/datatransfer/dnd/InvalidDNDOperationException.idl> 24#include <com/sun/star/datatransfer/dnd/DragGestureEvent.idl> 25#include <com/sun/star/datatransfer/XTransferable.idl> 26#include <com/sun/star/lang/IllegalArgumentException.idl> 27 28 29module com { module sun { module star { module datatransfer { module dnd { 30 31 published interface XDragSourceListener; 32 33/** This interface is implemented by a view or window that supports drag 34 operations and will be received as part of a DragGestureEvent 35 through a com::sun::star::datatransfer::dnd::XDragGestureListener::dragGestureRecognized() 36 callback. 37 38 <p>Differently to Java, the association between view and interface is fixed 39 and can not be changed. Otherwise, the AWT messaging would have to be 40 implemented for any window supporting Drag and Drop operations, which would 41 be a real performance issue.</p> 42*/ 43 44published interface XDragSource: com::sun::star::uno::XInterface 45{ 46 47 /** In order to query if drag image support is available. 48 49 @returns 50 A boolean indicating whether or not drag image support is 51 available on the underlying platform. 52 */ 53 54 boolean isDragImageSupported(); 55 56 /** To get the default cursor for a specified drag action. 57 58 @param dragAction 59 A drag action as specified in DNDConstants. 60 61 @returns 62 The default drag cursor for the specified drag action. 63 <p>The returned value may be used as parameter for the method 64 com::sun::star::datatransfer::dnd::XDragSourceContext::setCursor().</p> 65 */ 66 67 long getDefaultCursor( [in] byte dragAction ) 68 raises( com::sun::star::lang::IllegalArgumentException ); 69 70 /** Starts the drag operation. 71 72 <p>Note: this call does <em>not</em> block until the drag and drop 73 operation ends. If the Drag and Drop system is unable to initiate 74 a drag operation or if the user attempts to start a drag while an 75 existing drag operation is still executing, the action fails immediately. 76 This is indicated by calling 77 com::sun::star::datatransfer::dnd::XDragSourceListener::dragDropEnd() 78 on the parameter listener with a DragSourceDragEvent showing a failure.</p> 79 80 @param trigger 81 The DragGestureEvent that initiated the drag. 82 83 @param sourceActions 84 The action or actions supported for this transferable as defined 85 in DNDConstants. 86 87 @param cursor 88 The initial drag cursor id or 0 as default. 89 90 @param image 91 The initial drag image id or 0 as default. 92 93 @param trans 94 The transferable object dragged. 95 96 @param listener 97 The XDragSourceListener. 98 99 @see com::sun::star::datatransfer::XTransferable 100 */ 101 102 void startDrag( 103 [in] DragGestureEvent trigger, 104 [in] byte sourceActions, 105 [in] long cursor, 106 [in] long image, 107 [in] com::sun::star::datatransfer::XTransferable trans, 108 [in] XDragSourceListener listener ); 109}; 110 111 112}; }; }; }; }; 113 114#endif 115 116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 117