Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uikit] UIDragInteraction & UIDragInteractionDelegate (Xcode 9 b1,2,3) #2357

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion src/uikit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16162,6 +16162,7 @@ interface IUIDropSession {}
interface IUIDragDropSession {}
interface IUIDragAnimating {}
interface IUIDragSession {}
interface IUIDragInteractionDelegate {}
interface IUIDropInteractionDelegate {}

#if !WATCH
Expand Down Expand Up @@ -16290,6 +16291,87 @@ interface UIDragSession : UIDragDropSession
NSObject LocalContext { get; set; }
}

[NoWatch, NoTV]
[iOS (11,0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface UIDragInteraction : UIInteraction {
[Export ("initWithDelegate:")]
[DesignatedInitializer]
IntPtr Constructor (IUIDragInteractionDelegate @delegate);

[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
IUIDragInteractionDelegate Delegate { get; }

[Export ("allowsSimultaneousRecognitionDuringLift")]
bool AllowsSimultaneousRecognitionDuringLift { get; set; }

[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }

[Static]
[Export ("enabledByDefault")]
bool EnabledByDefault { [Bind ("isEnabledByDefault")] get; }
}

[NoWatch, NoTV]
[iOS (11,0)]
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface UIDragInteractionDelegate {
[Abstract]
[Export ("dragInteraction:itemsForBeginningSession:")]
UIDragItem[] GetItemsForBeginningSession (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:previewForLiftingItem:session:")]
[return: NullAllowed]
UITargetedDragPreview GetPreviewForLiftingItem (UIDragInteraction interaction, UIDragItem item, IUIDragSession session);

[Export ("dragInteraction:willAnimateLiftWithAnimator:session:")]
void WillAnimateLift (UIDragInteraction interaction, IUIDragAnimating animator, IUIDragSession session);

[Export ("dragInteraction:sessionWillBegin:")]
void SessionWillBegin (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:sessionAllowsMoveOperation:")]
bool SessionAllowsMoveOperation (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:sessionIsRestrictedToDraggingApplication:")]
bool SessionIsRestrictedToDraggingApplication (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:prefersFullSizePreviewsForSession:")]
bool PrefersFullSizePreviews (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:sessionDidMove:")]
void SessionDidMove (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:session:willEndWithOperation:")]
void SessionWillEnd (UIDragInteraction interaction, IUIDragSession session, UIDropOperation operation);

[Export ("dragInteraction:session:didEndWithOperation:")]
void SessionDidEnd (UIDragInteraction interaction, IUIDragSession session, UIDropOperation operation);

[Export ("dragInteraction:sessionDidTransferItems:")]
void SessionDidTransferItems (UIDragInteraction interaction, IUIDragSession session);

[Export ("dragInteraction:itemsForAddingToSession:withTouchAtPoint:")]
UIDragItem[] GetItemsForAddingToSession (UIDragInteraction interaction, IUIDragSession session, CGPoint point);

[Export ("dragInteraction:sessionForAddingItems:withTouchAtPoint:")]
[return: NullAllowed]
IUIDragSession GetSessionForAddingItems (UIDragInteraction interaction, IUIDragSession[] sessions, CGPoint point);

[Export ("dragInteraction:session:willAddItems:forInteraction:")]
void WillAddItems (UIDragInteraction interaction, IUIDragSession session, UIDragItem[] items, UIDragInteraction addingInteraction);

[Export ("dragInteraction:previewForCancellingItem:withDefault:")]
[return: NullAllowed]
UITargetedDragPreview GetPreviewForCancellingItem (UIDragInteraction interaction, UIDragItem item, UITargetedDragPreview defaultPreview);

[Export ("dragInteraction:item:willAnimateCancelWithAnimator:")]
void WillAnimateCancel (UIDragInteraction interaction, UIDragItem item, IUIDragAnimating animator);
}

[NoWatch, NoTV, iOS (11,0)]
[BaseType (typeof(NSObject))] // If Apple adds a delegate setter: Delegates=new string [] {"Delegate"}, Events=new Type [] { typeof (UIDropInteractionDelegate)})]
[DisableDefaultCtor]
Expand Down Expand Up @@ -16335,7 +16417,7 @@ interface UIDropInteractionDelegate

[Export ("dropInteraction:previewForDroppingItem:withDefault:")]
[return: NullAllowed][DelegateName("UIDropInteractionPreviewForItem"), NoDefaultValue]
UITargetedDragPreview PreviewForDroppingItem (UIDropInteraction interaction, UIDragItem item, UITargetedDragPreview defaultPreview);
UITargetedDragPreview GetPreviewForDroppingItem (UIDropInteraction interaction, UIDragItem item, UITargetedDragPreview defaultPreview);

[Export ("dropInteraction:item:willAnimateDropWithAnimator:"), EventArgs("UIDropInteractionAnimation")]
void WillAnimateDrop (UIDropInteraction interaction, UIDragItem item, IUIDragAnimating animator);
Expand Down