Skip to content

Commit

Permalink
[FileProvider] Implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Jul 18, 2017
1 parent 5261284 commit 0d819dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/fileprovider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// FileProvider C# bindings
//
// Authors:
Expand Down Expand Up @@ -33,10 +33,10 @@ public enum NSFileProviderError : nint {
enum NSFileProviderItemIdentifier {

[Field ("NSFileProviderRootContainerItemIdentifier")]
Root,
RootContainer,

[Field ("NSFileProviderWorkingSetContainerItemIdentifier")]
WorkingSet,
WorkingSetContainer,
}

[iOS (11,0)]
Expand Down Expand Up @@ -84,7 +84,7 @@ interface NSFileProviderEnumerationObserver {

[Abstract]
[Export ("finishEnumeratingUpToPage:")]
void FinishEnumerating ([NullAllowed] NSData nextPage);
void FinishEnumerating ([NullAllowed] NSData upToPage);

[Abstract]
[Export ("finishEnumeratingWithError:")]
Expand Down
2 changes: 0 additions & 2 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3052,8 +3052,6 @@ interface NSEnumerator {
NSObject NextObject ();
}

interface INSFileProviderItem { }

[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSError : NSSecureCoding, NSCopying {
Expand Down
23 changes: 12 additions & 11 deletions src/uikit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,43 +331,43 @@ partial interface NSFileProviderExtension {
[iOS (11,0)]
[Export ("itemForIdentifier:error:")]
[return: NullAllowed]
XamCore.FileProvider.INSFileProviderItem GetItem (NSString identifier, out NSError error);
INSFileProviderItem GetItem (NSString identifier, out NSError error);

[iOS (11,0)]
[Wrap ("GetItem (identifier.GetConstant (), out error)")]
XamCore.FileProvider.INSFileProviderItem GetItem (NSFileProviderItemIdentifier identifier, out NSError error);
INSFileProviderItem GetItem (NSFileProviderItemIdentifier identifier, out NSError error);

// Inlining NSFileProviderExtension (NSFileProviderActions) so we get asyncs

[iOS (11,0)]
[Async]
[Export ("importDocumentAtURL:toParentItemIdentifier:completionHandler:")]
void ImportDocument (NSUrl fileUrl, string parentItemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void ImportDocument (NSUrl fileUrl, string parentItemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("createDirectoryWithName:inParentItemIdentifier:completionHandler:")]
void CreateDirectory (string directoryName, string parentItemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void CreateDirectory (string directoryName, string parentItemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("renameItemWithIdentifier:toName:completionHandler:")]
void RenameItem (string itemIdentifier, string itemName, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void RenameItem (string itemIdentifier, string itemName, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("reparentItemWithIdentifier:toParentItemWithIdentifier:completionHandler:")]
void ReparentItem (string itemIdentifier, string parentItemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void ReparentItem (string itemIdentifier, string parentItemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("trashItemWithIdentifier:completionHandler:")]
void TrashItem (string itemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void TrashItem (string itemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("untrashItemWithIdentifier:toParentItemIdentifier:completionHandler:")]
void UntrashItem (string itemIdentifier, [NullAllowed] string parentItemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void UntrashItem (string itemIdentifier, [NullAllowed] string parentItemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
Expand All @@ -377,17 +377,17 @@ partial interface NSFileProviderExtension {
[iOS (11,0)]
[Async]
[Export ("setLastUsedDate:forItemIdentifier:completionHandler:")]
void SetLastUsedDate ([NullAllowed] NSDate lastUsedDate, string itemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void SetLastUsedDate ([NullAllowed] NSDate lastUsedDate, string itemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("setTagData:forItemIdentifier:completionHandler:")]
void SetTagData ([NullAllowed] NSData tagData, string itemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void SetTagData ([NullAllowed] NSData tagData, string itemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Async]
[Export ("setFavoriteRank:forItemIdentifier:completionHandler:")]
void SetFavoriteRank ([NullAllowed] NSNumber favoriteRank, string itemIdentifier, Action<XamCore.FileProvider.INSFileProviderItem, NSError> completionHandler);
void SetFavoriteRank ([NullAllowed] NSNumber favoriteRank, string itemIdentifier, Action<INSFileProviderItem, NSError> completionHandler);

[iOS (11,0)]
[Export ("enumeratorForContainerItemIdentifier:error:")]
Expand All @@ -408,6 +408,7 @@ partial interface NSFileProviderExtension {

// From NSFileProviderExtension (NSFileProviderMessaging)

// Missing members -> https://bugzilla.xamarin.com/show_bug.cgi?id=58222
// TODO: NSFileProviderMessageInterfaceName is not bound yet, comes from Foundation
//[iOS (11,0)]
//[Internal]
Expand Down

0 comments on commit 0d819dc

Please sign in to comment.