5
// Lluis Sanchez <lluis@xamarin.com>
7
// Copyright (c) 2011 Xamarin Inc
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31
public class DragCheckEventArgs: EventArgs
33
public DragCheckEventArgs (Point position, TransferDataType[] types, DragDropAction action)
38
Result = DragDropResult.None;
41
public TransferDataType[] DataTypes { get; private set; }
43
public Point Position { get; private set; }
45
public DragDropAction Action { get; private set; }
47
public DragDropResult Result { get; set; }
50
public class DragEventArgs: EventArgs
52
public DragEventArgs (Point position, Xwt.Backends.TransferDataStore dataStore, DragDropAction action)
60
public ITransferData Data { get; private set; }
62
public Point Position { get; private set; }
64
public DragDropAction Action { get; private set; }
66
public bool Success { get; set; }
69
public class DragOverCheckEventArgs: EventArgs
71
DragDropAction allowedAction;
73
public DragOverCheckEventArgs (Point position, TransferDataType[] types, DragDropAction action)
78
AllowedAction = DragDropAction.Default;
82
/// Type of the data being dropped
84
public TransferDataType[] DataTypes { get; private set; }
87
/// Drop coordinates (in widget coordinates)
89
public Point Position { get; private set; }
92
/// Proposed drop action, which depends on the control keys being pressed
94
public DragDropAction Action { get; private set; }
100
/// To be set by the handler of the event. Specifies the action that will be performed if the item is dropped.
101
/// If not specified or set to Default, the action will be determined by the handler of DragOver.
103
public DragDropAction AllowedAction {
104
get { return allowedAction; }
107
case DragDropAction.Copy:
108
case Xwt.DragDropAction.Default:
109
case Xwt.DragDropAction.Link:
110
case Xwt.DragDropAction.Move:
111
case Xwt.DragDropAction.None:
112
allowedAction = value;
115
throw new ArgumentException ("Allowed action must be one of Copy, Link, Move, None or Default");
121
public class DragOverEventArgs: EventArgs
123
public DragOverEventArgs (Point position, ITransferData dataStore, DragDropAction action)
128
AllowedAction = DragDropAction.Default;
131
public ITransferData Data { get; private set; }
134
/// Drop coordinates (in widget coordinates)
136
public Point Position { get; private set; }
139
/// Proposed drop action, which depends on the control keys being pressed
141
public DragDropAction Action { get; private set; }
147
/// To be set by the handler of the event. Specifies the action that will be performed if the item is dropped.
148
/// If not specified or set to Default, the action will be determined by the handler of DragDropCheck.
150
public DragDropAction AllowedAction { get; set; }
153
public class DragFinishedEventArgs: EventArgs
155
public DragFinishedEventArgs (bool deleteSource)
157
DeleteSource = deleteSource;
160
public bool DeleteSource { get; private set; }
163
public class DragStartedEventArgs: EventArgs
165
public DragOperation DragOperation { get; internal set; }
168
public enum DragDropResult