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

[FileProvider] Add support for Xcode13 beta 4. #12300

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions src/FileProvider/Structs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#if MONOMAC
using System;
using System.Runtime.InteropServices;
using ObjCRuntime;

namespace FileProvider {

[NoiOS, NoMacCatalyst, Mac (12,0)]
[StructLayout (LayoutKind.Sequential)]
public struct NSFileProviderTypeAndCreator
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved
{
public uint Type;

public uint Creator;
}

}
#endif
54 changes: 47 additions & 7 deletions src/fileprovider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,18 @@ enum NSFileProviderError : long {
OlderExtensionVersionRunning = -2003,
NewerExtensionVersionFound = -2004,
CannotSynchronize = -2005,
#if MONOMAC
NonEvictableChildren = -2006,
UnsyncedEdits = -2007,
NonEvictable = -2008,
#endif
}

[Unavailable (PlatformName.MacCatalyst)]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[NoiOS, Mac (12,0), NoMacCatalyst]
[Native, Advice ("This API is not available when using UIKit on macOS.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
public enum NSFileProviderDomainRemovalMode : long {
RemoveAll = 0,
PreserveDirtyUserData = 1,
PreserveDownloadedUserData = 2,
}

[iOS (11,0)]
Expand All @@ -203,7 +210,7 @@ interface NSFileProviderErrorKeys {
[Field ("NSFileProviderErrorNonExistentItemIdentifierKey")]
NSString NonExistentItemIdentifierKey { get; }

[NoiOS]
[iOS (15,0)]
[Field ("NSFileProviderErrorItemKey")]
NSString ItemKey { get; }
}
Expand Down Expand Up @@ -330,6 +337,11 @@ interface NSFileProviderDomain {
[Notification]
[Field ("NSFileProviderDomainDidChange")]
NSString DidChange { get; }

[NoWatch, NoTV, NoiOS, Mac (12, 0), NoMacCatalyst]
[Advice ("This API is not available when using UIKit on macOS.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[NullAllowed, Export ("backingStoreIdentity")]
NSData BackingStoreIdentity { get; }
}

interface INSFileProviderEnumerationObserver { }
Expand Down Expand Up @@ -542,6 +554,13 @@ interface NSFileProviderItem {
[NoiOS]
[NullAllowed, Export ("symlinkTargetPath")]
string SymlinkTargetPath { get; }

#if MONOMAC
[NoiOS, Mac (12, 0), NoMacCatalyst]
[Advice ("This API is not available when using UIKit on macOS.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[Export ("typeAndCreator")]
NSFileProviderTypeAndCreator TypeAndCreator { get; }
#endif
}

[iOS (11,0)]
Expand Down Expand Up @@ -716,6 +735,12 @@ interface NSFileProviderManager {
[return: NullAllowed]
NSDictionary<INSFileProviderTestingOperation, NSError> GetRunTestingOperations (INSFileProviderTestingOperation[] operations, [NullAllowed] out NSError error);

[NoiOS, Mac (12,0), NoMacCatalyst]
[Async (ResultTypeName = "NSFileProviderRemoveDomainResult")]
[Static]
[Export ("removeDomain:mode:completionHandler:")]
void RemoveDomain (NSFileProviderDomain domain, NSFileProviderDomainRemovalMode mode, Action<NSUrl, NSError> completionHandler);

}

interface INSFileProviderPendingSetEnumerator { }
Expand Down Expand Up @@ -815,6 +840,8 @@ enum NSFileProviderItemFields : ulong {
ContentModificationDate = 1uL << 7,
FileSystemFlags = 1uL << 8,
ExtendedAttributes = 1uL << 9,
[Mac (12,0)
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
TypeAndCreator = 1uL << 10,
}

[Mac (11,0)]
Expand All @@ -826,9 +853,8 @@ enum NSFileProviderManagerDisconnectionOptions : ulong {
Temporary = 1,
}

[Mac (11,0)]
[iOS (15,0), Mac (11,0)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using Catalyst on macOS.")]
[NoiOS]
[Native][Flags]
enum NSFileProviderFileSystemFlags : ulong
{
Expand Down Expand Up @@ -1003,8 +1029,7 @@ interface NSFileProviderDomainState {
}

[Advice ("This API is not available when using UIKit on macOS.")]
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[Unavailable (PlatformName.MacCatalyst)]
[NoWatch, NoTV, NoiOS, Mac (11,3)]
[NoWatch, NoTV, iOS (15,0), Mac (12,0), NoMacCatalyst]
[Flags]
[Native]
public enum NSFileProviderDomainTestingModes : ulong {
Expand Down Expand Up @@ -1263,4 +1288,19 @@ interface NSFileProviderTestingCollisionResolution : NSFileProviderTestingOperat
[Export ("renamedItem")]
INSFileProviderItem RenamedItem { get; }
}

[NoWatch, NoTV, NoiOS, Mac (12,0), NoMacCatalyst]
[Protocol, Advice ("This API is not available when using UIKit on macOS.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[BaseType (typeof (NSObject))]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
interface NSFileProviderUserInteractionSuppressing
{
[Abstract]
[Export ("setInteractionSuppressed:forIdentifier:")]
void SetInteractionSuppressed (bool suppression, string suppressionIdentifier);

[Abstract]
[Export ("isInteractionSuppressedForIdentifier:")]
bool IsInteractionSuppressed (string suppressionIdentifier);
}

}
3 changes: 3 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ EXTERNALACCESSORY_API_SOURCES = \

# FileProvider

FILEPROVIDER_CORE_SOURCES = \
FileProvider/Structs.cs \

FILEPROVIDER_SOURCES = \
FileProvider/Compat.cs \

Expand Down
6 changes: 0 additions & 6 deletions tests/xtro-sharpie/iOS-FileProvider.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/macOS-FileProvider.todo

This file was deleted.