1 // ==========================================================================
  2 // Project:   SproutCore - JavaScript Application Framework
  3 // Copyright: ©2006-2011 Strobe Inc. and contributors.
  4 //            Portions ©2008-2011 Apple Inc. All rights reserved.
  5 // License:   Licensed under MIT license (see license.js)
  6 // ==========================================================================
  7 
  8 sc_require('system/drag');
  9 
 10 /** @namespace
 11   The `SC.DragDataSourceProtocol` protocol defines the properties and methods that you may implement
 12   in your drag source objects in order to access additional functionality of SproutCore's drag
 13   support.
 14 
 15   This protocol implements a dynamic data source for a drag operation. You should use it to return a
 16   set of allowed data types and then the method will be used to actually get data in that format
 17   when requested.
 18 
 19   *Note: Do not mix `SC.DragDataSourceProtocol` into your classes. As a protocol, it exists only for
 20   reference sake. You only need define any of the properties or methods listed below in order to use
 21   this protocol.*
 22 */
 23 SC.DragDataSourceProtocol = {
 24 
 25   /**
 26     Implement this property as an array of data types you want to support
 27     for drag operations.
 28 
 29     @type Array
 30     @default []
 31   */
 32   dragDataTypes: [],
 33 
 34   /**
 35     Implement this method to return the data in the format passed.  Return
 36     null if the requested data type cannot be generated.
 37 
 38     @param {SC.Drag} drag The Drag instance managing this drag.
 39     @param {Object} dataType The proposed dataType to return.  This will
 40       always be one of the data types declared in dragDataTypes.
 41 
 42     @returns The data object for the specified type
 43   */
 44   dragDataForType: function(drag, dataType) {
 45     return null;
 46   }
 47 
 48 };
 49 
 50