1 /* 2 * ***** BEGIN LICENSE BLOCK ***** 3 * Zimbra Collaboration Suite Web Client 4 * Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc. 5 * 6 * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: https://www.zimbra.com/license 9 * The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 10 * have been added to cover use of software over a computer network and provide for limited attribution 11 * for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B. 12 * 13 * Software distributed under the License is distributed on an "AS IS" basis, 14 * WITHOUT WARRANTY OF ANY KIND, either express or implied. 15 * See the License for the specific language governing rights and limitations under the License. 16 * The Original Code is Zimbra Open Source Web Client. 17 * The Initial Developer of the Original Code is Zimbra, Inc. All rights to the Original Code were 18 * transferred by Zimbra, Inc. to Synacor, Inc. on September 14, 2015. 19 * 20 * All portions of the code are Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc. All Rights Reserved. 21 * ***** END LICENSE BLOCK ***** 22 */ 23 24 /** 25 * @constructor 26 * @class 27 * DwtDragEvent is generated by the Drag and Drop framework when a drag operation is 28 * in process. The drag event is dispatched to the registered {@link DwtDragSource} instance. 29 * 30 * @author Ross Dargahi 31 * 32 * @see DwtDragSource 33 */ 34 DwtDragEvent = function() { 35 /** 36 * Type of drag operation. One of: 37 * <ul> 38 * <li>{@link DwtDragEvent.DRAG_START}</li> 39 * <li>{@link DwtDragEvent.SET_DATA}</li> 40 * <li>{@link DwtDragEvent.DRAG_END}</li> 41 * </ul> 42 */ 43 this.operation = null; 44 45 /** 46 * Drag source control 47 * @type DwtControl 48 */ 49 this.srcControl = null; 50 51 /** 52 * Action being performed. One of: 53 * <ul> 54 * <li>{@link Dwt.DND_DROP_NONE}</li> 55 * <li>{@link Dwt.DND_DROP_COPY}</li> 56 * <li>{@link Dwt.DND_DROP_MOVE}</li> 57 * </ul> 58 */ 59 this.action = null; 60 61 /** 62 * Whether the DnD framework should perform the operation. The application is 63 * responsible for setting this value based on whatever business logic it is 64 * implementing 65 * @type boolean 66 */ 67 this.doIt = false; 68 69 /** 70 * Drag source data. This is the application data associated with the item being dragged. 71 */ 72 this.srcData = null; 73 }; 74 75 /** 76 * Drag initialization. 77 */ 78 DwtDragEvent.DRAG_INIT = "INIT"; 79 80 /** 81 * Drag is starting. 82 */ 83 DwtDragEvent.DRAG_START = "START"; 84 85 /** 86 * Set the <code>srcData</code> field of the event. 87 */ 88 DwtDragEvent.SET_DATA = "SET_DATA"; 89 90 /** 91 * Drag movement has occurred. 92 */ 93 DwtDragEvent.DRAG_MOVE = "MOVE"; 94 95 /** 96 * Drag has ended. 97 */ 98 DwtDragEvent.DRAG_END = "END"; 99 100 /** 101 * Drag canceled (i.e. dropped on invalid target). 102 */ 103 DwtDragEvent.DRAG_CANCEL = "CANCEL"; 104