Documentation
¶
Overview ¶
Package fileprovider provides Go bindings for the FileProvider framework.
An extension other apps use to access files and folders managed by your app and synced with a remote storage.
If your app focuses on providing and syncing user documents from remote storage, you can implement a File Provider extension to give users access to those documents when they’re using other apps. If you just need to share local documents, see Share files locally below.
Essentials ¶
- File Provider updates: Learn about important changes to File Provider.
Extension types ¶
- Replicated File Provider extension: Build a File Provider extension that syncs the local copies of your files with your remote storage. (NSFileProviderReplicatedExtension, NSFileProviderEnumerating, NSFileProviderIncrementalContentFetching, NSFileProviderPartialContentFetching, NSFileProviderServicing)
- Nonreplicated File Provider extension: Build a File Provider extension that hosts and manages the user’s local files.
Extension management ¶
- NSFileProviderManager: A manager object that you use to communicate with the file provider from either your app or your File Provider extension. (NSFileProviderKnownFolders, NSFileProviderKnownFolderLocations, NSFileProviderKnownFolderSupporting, NSFileProviderExternalVolumeHandling)
Provided items ¶
- NSFileProviderItem: An item the File Provider extension manages.
- NSFileProviderItem: A protocol that defines the properties of an item managed by the File Provider extension. (NSFileProviderContentPolicy, NSFileProviderFileSystemFlags)
- NSFileProviderItemIdentifier: A unique identifier for an item managed by the File Provider extension.
- NSFileProviderItemCapabilities: An item’s capabilities, which define the actions that the user can perform in the document browser.
- NSFileProviderTypeAndCreator: A structure that contains the file type and file creator codes for an item.
Cloud search ¶
- NSFileProviderSearching: A protocol you implement to support searching in your file provider. (NSFileProviderStringSearchRequest, NSFileProviderSearchEnumerator)
Domains ¶
- NSFileProviderDomain: A File Provider extension’s domain. (NSFileProviderDomainIdentifier, NSFileProviderKnownFolders)
Errors ¶
- NSFileProviderErrorCode: The error codes for the File Provider extension.
- FileProviderErrorDomain: The error domain for the File Provider extension.
- FileProviderErrorItemKey: The key for accessing information about sync-related errors.
- FileProviderErrorNonExistentItemIdentifierKey: The key for accessing the specified item’s identifier when the item doesn’t exist.
Data export ¶
- Exporting file provider metrics data: Download and analyze usage, consistency, and error data.
Global variables and macros ¶
Variables ¶
- FileProviderUserInfoExperimentIDKey: System interpreted user info key When setting a value to that user info on a domain, the system will ingest this value.
Type Aliases ¶
Enumerations ¶
- NSFileProviderVolumeUnsupportedReason: Constants that describe why an external volume might not be eligible for storing a domain.//
Key Types ¶
- NSFileProviderManager - A manager object that you use to communicate with the file provider from either your app or your File Provider extension.
- NSFileProviderDomain - A File Provider extension’s domain.
- NSFileProviderItemVersion - The version of the item’s content and its metadata.
- NSFileProviderKnownFolderLocations - A class for working with known-folder locations.
- NSFileProviderRequest - An object that provides information about the application requesting data from the File Provider extension.
- NSFileProviderKnownFolderLocation
- NSFileProviderStringSearchRequest - A type that contains details of a string-based search request.
- NSFileProviderDomainVersion - An opaque object that identifies a specific version of a domain.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Variables
- func NewDataBlock(handler DataHandler) (objc.ID, func())
- func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
- func NewFileProviderItemErrorBlock(handler FileProviderItemErrorHandler) (objc.ID, func())
- func NewFileProviderItemNSFileProviderItemFieldsBoolErrorBlock(handler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) (objc.ID, func())
- func NewFileProviderKnownFolderLocationsErrorBlock(handler FileProviderKnownFolderLocationsErrorHandler) (objc.ID, func())
- func NewFileProviderServiceErrorBlock(handler FileProviderServiceErrorHandler) (objc.ID, func())
- func NewNSFileProviderDomainArrayErrorBlock(handler NSFileProviderDomainArrayErrorHandler) (objc.ID, func())
- func NewStringDataErrorBlock(handler StringDataErrorHandler) (objc.ID, func())
- func NewStringStringErrorBlock(handler StringStringErrorHandler) (objc.ID, func())
- func NewURLErrorBlock(handler URLErrorHandler) (objc.ID, func())
- func NewURLFileProviderItemErrorBlock(handler URLFileProviderItemErrorHandler) (objc.ID, func())
- func NewURLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorBlock(...) (objc.ID, func())
- func NewVoidBlock(handler VoidHandler) (objc.ID, func())
- type DataHandler
- type ErrorHandler
- type FileProviderItemErrorHandler
- type FileProviderItemNSFileProviderItemFieldsBoolErrorHandler
- type FileProviderKnownFolderLocationsErrorHandler
- type FileProviderServiceErrorHandler
- type INSFileProviderDomain
- type INSFileProviderDomainVersion
- type INSFileProviderItemVersion
- type INSFileProviderKnownFolderLocation
- type INSFileProviderKnownFolderLocations
- type INSFileProviderManager
- type INSFileProviderRequest
- type INSFileProviderStringSearchRequest
- type NSError
- type NSFileProviderChangeObserver
- type NSFileProviderChangeObserverObject
- func (o NSFileProviderChangeObserverObject) BaseObject() objectivec.Object
- func (o NSFileProviderChangeObserverObject) DidDeleteItemsWithIdentifiers(deletedItemIdentifiers []string)
- func (o NSFileProviderChangeObserverObject) DidUpdateItems(updatedItems []objectivec.IObject)
- func (o NSFileProviderChangeObserverObject) FinishEnumeratingChangesUpToSyncAnchorMoreComing(anchor NSFileProviderSyncAnchor, moreComing bool)
- func (o NSFileProviderChangeObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
- func (o NSFileProviderChangeObserverObject) SuggestedBatchSize() int
- type NSFileProviderContentPolicy
- type NSFileProviderCreateItemOptions
- type NSFileProviderCustomAction
- type NSFileProviderCustomActionObject
- type NSFileProviderDeleteItemOptions
- type NSFileProviderDomain
- func NSFileProviderDomainFromID(id objc.ID) NSFileProviderDomain
- func NewFileProviderDomainWithDisplayNameUserInfoVolumeURL(displayName string, userInfo foundation.INSDictionary, ...) NSFileProviderDomain
- func NewFileProviderDomainWithIdentifierDisplayName(identifier NSFileProviderDomainIdentifier, displayName string) NSFileProviderDomain
- func NewFileProviderDomainWithIdentifierDisplayNamePathRelativeToDocumentStorage(identifier NSFileProviderDomainIdentifier, displayName string, ...) NSFileProviderDomain
- func NewNSFileProviderDomain() NSFileProviderDomain
- func (f NSFileProviderDomain) Autorelease() NSFileProviderDomain
- func (f NSFileProviderDomain) BackingStoreIdentity() foundation.NSData
- func (f NSFileProviderDomain) DisplayName() string
- func (f NSFileProviderDomain) Identifier() NSFileProviderDomainIdentifier
- func (f NSFileProviderDomain) Init() NSFileProviderDomain
- func (f NSFileProviderDomain) InitWithDisplayNameUserInfoVolumeURL(displayName string, userInfo foundation.INSDictionary, ...) NSFileProviderDomain
- func (f NSFileProviderDomain) InitWithIdentifierDisplayName(identifier NSFileProviderDomainIdentifier, displayName string) NSFileProviderDomain
- func (f NSFileProviderDomain) IsDisconnected() bool
- func (f NSFileProviderDomain) IsHidden() bool
- func (f NSFileProviderDomain) IsReplicated() bool
- func (f NSFileProviderDomain) ReplicatedKnownFolders() NSFileProviderKnownFolders
- func (f NSFileProviderDomain) SetHidden(value bool)
- func (f NSFileProviderDomain) SetSupportedKnownFolders(value NSFileProviderKnownFolders)
- func (f NSFileProviderDomain) SetSupportsStringSearchRequest(value bool)
- func (f NSFileProviderDomain) SetSupportsSyncingTrash(value bool)
- func (f NSFileProviderDomain) SetTestingModes(value NSFileProviderDomainTestingModes)
- func (f NSFileProviderDomain) SetUserInfo(value foundation.INSDictionary)
- func (f NSFileProviderDomain) SupportedKnownFolders() NSFileProviderKnownFolders
- func (f NSFileProviderDomain) SupportsStringSearchRequest() bool
- func (f NSFileProviderDomain) SupportsSyncingTrash() bool
- func (f NSFileProviderDomain) TestingModes() NSFileProviderDomainTestingModes
- func (f NSFileProviderDomain) UserEnabled() bool
- func (f NSFileProviderDomain) UserInfo() foundation.INSDictionary
- func (f NSFileProviderDomain) VolumeUUID() foundation.NSUUID
- type NSFileProviderDomainArrayErrorHandler
- type NSFileProviderDomainClass
- type NSFileProviderDomainIdentifier
- type NSFileProviderDomainRemovalMode
- type NSFileProviderDomainState
- type NSFileProviderDomainStateObject
- type NSFileProviderDomainTestingModes
- type NSFileProviderDomainVersion
- func (f NSFileProviderDomainVersion) Autorelease() NSFileProviderDomainVersion
- func (f NSFileProviderDomainVersion) EncodeWithCoder(coder foundation.INSCoder)
- func (f NSFileProviderDomainVersion) Init() NSFileProviderDomainVersion
- func (f NSFileProviderDomainVersion) Next() INSFileProviderDomainVersion
- type NSFileProviderDomainVersionClass
- type NSFileProviderEnumerating
- type NSFileProviderEnumeratingObject
- type NSFileProviderEnumerationObserver
- type NSFileProviderEnumerationObserverObject
- func (o NSFileProviderEnumerationObserverObject) BaseObject() objectivec.Object
- func (o NSFileProviderEnumerationObserverObject) DidEnumerateItems(updatedItems []objectivec.IObject)
- func (o NSFileProviderEnumerationObserverObject) FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
- func (o NSFileProviderEnumerationObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
- func (o NSFileProviderEnumerationObserverObject) SuggestedPageSize() int
- type NSFileProviderEnumerator
- type NSFileProviderEnumeratorObject
- func (o NSFileProviderEnumeratorObject) BaseObject() objectivec.Object
- func (o NSFileProviderEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)
- func (o NSFileProviderEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor(observer NSFileProviderChangeObserver, syncAnchor NSFileProviderSyncAnchor)
- func (o NSFileProviderEnumeratorObject) EnumerateItemsForObserverStartingAtPage(observer NSFileProviderEnumerationObserver, page NSFileProviderPage)
- func (o NSFileProviderEnumeratorObject) Invalidate()
- type NSFileProviderErrorCode
- type NSFileProviderExtensionActionIdentifier
- type NSFileProviderExternalVolumeHandling
- type NSFileProviderExternalVolumeHandlingObject
- type NSFileProviderFetchContentsOptions
- type NSFileProviderFileSystemFlags
- type NSFileProviderIncrementalContentFetching
- type NSFileProviderIncrementalContentFetchingObject
- func (o NSFileProviderIncrementalContentFetchingObject) BaseObject() objectivec.Object
- func (o NSFileProviderIncrementalContentFetchingObject) FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, ...) foundation.Progress
- type NSFileProviderItem
- type NSFileProviderItemCapabilities
- type NSFileProviderItemDecorating
- type NSFileProviderItemDecoratingObject
- type NSFileProviderItemDecorationIdentifier
- type NSFileProviderItemFields
- type NSFileProviderItemIdentifier
- type NSFileProviderItemObject
- func (o NSFileProviderItemObject) BaseObject() objectivec.Object
- func (o NSFileProviderItemObject) Capabilities() NSFileProviderItemCapabilities
- func (o NSFileProviderItemObject) ChildItemCount() foundation.NSNumber
- func (o NSFileProviderItemObject) ContentModificationDate() foundation.NSDate
- func (o NSFileProviderItemObject) ContentPolicy() NSFileProviderContentPolicy
- func (o NSFileProviderItemObject) ContentType() uniformtypeidentifiers.UTType
- func (o NSFileProviderItemObject) CreationDate() foundation.NSDate
- func (o NSFileProviderItemObject) DocumentSize() foundation.NSNumber
- func (o NSFileProviderItemObject) DownloadingError() foundation.NSError
- func (o NSFileProviderItemObject) ExtendedAttributes() foundation.INSDictionary
- func (o NSFileProviderItemObject) FavoriteRank() foundation.NSNumber
- func (o NSFileProviderItemObject) FileSystemFlags() NSFileProviderFileSystemFlags
- func (o NSFileProviderItemObject) Filename() string
- func (o NSFileProviderItemObject) IsDownloaded() bool
- func (o NSFileProviderItemObject) IsDownloading() bool
- func (o NSFileProviderItemObject) IsMostRecentVersionDownloaded() bool
- func (o NSFileProviderItemObject) IsShared() bool
- func (o NSFileProviderItemObject) IsSharedByCurrentUser() bool
- func (o NSFileProviderItemObject) IsTrashed() bool
- func (o NSFileProviderItemObject) IsUploaded() bool
- func (o NSFileProviderItemObject) IsUploading() bool
- func (o NSFileProviderItemObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderItemObject) ItemVersion() INSFileProviderItemVersion
- func (o NSFileProviderItemObject) LastUsedDate() foundation.NSDate
- func (o NSFileProviderItemObject) MostRecentEditorNameComponents() foundation.NSPersonNameComponents
- func (o NSFileProviderItemObject) OwnerNameComponents() foundation.NSPersonNameComponents
- func (o NSFileProviderItemObject) ParentItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderItemObject) SymlinkTargetPath() string
- func (o NSFileProviderItemObject) TagData() foundation.NSData
- func (o NSFileProviderItemObject) TypeAndCreator() NSFileProviderTypeAndCreator
- func (o NSFileProviderItemObject) TypeIdentifier() string
- func (o NSFileProviderItemObject) UploadingError() foundation.NSError
- func (o NSFileProviderItemObject) UserInfo() foundation.INSDictionary
- func (o NSFileProviderItemObject) VersionIdentifier() foundation.NSData
- type NSFileProviderItemVersion
- func (f NSFileProviderItemVersion) Autorelease() NSFileProviderItemVersion
- func (f NSFileProviderItemVersion) ContentVersion() foundation.NSData
- func (f NSFileProviderItemVersion) Init() NSFileProviderItemVersion
- func (f NSFileProviderItemVersion) InitWithContentVersionMetadataVersion(contentVersion foundation.NSData, metadataVersion foundation.NSData) NSFileProviderItemVersion
- func (f NSFileProviderItemVersion) MetadataVersion() foundation.NSData
- type NSFileProviderItemVersionClass
- type NSFileProviderKnownFolderLocation
- func NSFileProviderKnownFolderLocationFromID(id objc.ID) NSFileProviderKnownFolderLocation
- func NewFileProviderKnownFolderLocationWithExistingItemIdentifier(existingItemIdentifier NSFileProviderItemIdentifier) NSFileProviderKnownFolderLocation
- func NewFileProviderKnownFolderLocationWithParentItemIdentifierFilename(parentItemIdentifier NSFileProviderItemIdentifier, filename string) NSFileProviderKnownFolderLocation
- func NewNSFileProviderKnownFolderLocation() NSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocation) Autorelease() NSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocation) Init() NSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocation) InitWithExistingItemIdentifier(existingItemIdentifier NSFileProviderItemIdentifier) NSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocation) InitWithParentItemIdentifierFilename(parentItemIdentifier NSFileProviderItemIdentifier, filename string) NSFileProviderKnownFolderLocation
- type NSFileProviderKnownFolderLocationClass
- type NSFileProviderKnownFolderLocations
- func (f NSFileProviderKnownFolderLocations) Autorelease() NSFileProviderKnownFolderLocations
- func (f NSFileProviderKnownFolderLocations) DesktopLocation() INSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocations) DocumentsLocation() INSFileProviderKnownFolderLocation
- func (f NSFileProviderKnownFolderLocations) Init() NSFileProviderKnownFolderLocations
- func (f NSFileProviderKnownFolderLocations) SetDesktopLocation(value INSFileProviderKnownFolderLocation)
- func (f NSFileProviderKnownFolderLocations) SetDocumentsLocation(value INSFileProviderKnownFolderLocation)
- func (f NSFileProviderKnownFolderLocations) SetShouldCreateBinaryCompatibilitySymlink(value bool)
- func (f NSFileProviderKnownFolderLocations) ShouldCreateBinaryCompatibilitySymlink() bool
- type NSFileProviderKnownFolderLocationsClass
- type NSFileProviderKnownFolderSupporting
- type NSFileProviderKnownFolderSupportingObject
- type NSFileProviderKnownFolders
- type NSFileProviderManager
- func (f NSFileProviderManager) Autorelease() NSFileProviderManager
- func (f NSFileProviderManager) ClaimKnownFoldersLocalizedReason(ctx context.Context, knownFolders INSFileProviderKnownFolderLocations, ...) error
- func (f NSFileProviderManager) ClaimKnownFoldersLocalizedReasonCompletionHandler(knownFolders INSFileProviderKnownFolderLocations, localizedReason string, ...)
- func (f NSFileProviderManager) DisconnectWithReasonOptions(ctx context.Context, localizedReason string, ...) error
- func (f NSFileProviderManager) DisconnectWithReasonOptionsCompletionHandler(localizedReason string, options NSFileProviderManagerDisconnectionOptions, ...)
- func (f NSFileProviderManager) EnumeratorForMaterializedItems() NSFileProviderEnumerator
- func (f NSFileProviderManager) EnumeratorForPendingItems() NSFileProviderPendingSetEnumerator
- func (f NSFileProviderManager) EvictItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
- func (f NSFileProviderManager) EvictItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
- func (f NSFileProviderManager) GetServiceWithNameItemIdentifier(ctx context.Context, serviceName foundation.NSFileProviderServiceName, ...) (*foundation.NSFileProviderService, error)
- func (f NSFileProviderManager) GetServiceWithNameItemIdentifierCompletionHandler(serviceName foundation.NSFileProviderServiceName, ...)
- func (f NSFileProviderManager) GetUserVisibleURLForItemIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) (*foundation.NSURL, error)
- func (f NSFileProviderManager) GetUserVisibleURLForItemIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler URLErrorHandler)
- func (f NSFileProviderManager) GlobalProgressForKind(kind foundation.NSProgressFileOperationKind) foundation.Progress
- func (f NSFileProviderManager) Init() NSFileProviderManager
- func (f NSFileProviderManager) ListAvailableTestingOperationsWithError() ([]objectivec.IObject, error)
- func (f NSFileProviderManager) Reconnect(ctx context.Context) error
- func (f NSFileProviderManager) ReconnectWithCompletionHandler(completionHandler ErrorHandler)
- func (f NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifier(ctx context.Context, task foundation.NSURLSessionTask, ...) error
- func (f NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifierCompletionHandler(task foundation.NSURLSessionTask, identifier NSFileProviderItemIdentifier, ...)
- func (f NSFileProviderManager) ReimportItemsBelowItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
- func (f NSFileProviderManager) ReimportItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
- func (f NSFileProviderManager) ReleaseKnownFoldersLocalizedReason(ctx context.Context, knownFolders NSFileProviderKnownFolders, ...) error
- func (f NSFileProviderManager) ReleaseKnownFoldersLocalizedReasonCompletionHandler(knownFolders NSFileProviderKnownFolders, localizedReason string, ...)
- func (f NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReason(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier, ...) error
- func (f NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, errorReason foundation.NSError, ...)
- func (f NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptions(ctx context.Context, fields NSFileProviderItemFields, ...) error
- func (f NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler(fields NSFileProviderItemFields, itemIdentifier NSFileProviderItemIdentifier, ...)
- func (f NSFileProviderManager) RunTestingOperationsError(operations []objectivec.IObject) (foundation.INSDictionary, error)
- func (f NSFileProviderManager) SignalEnumeratorForContainerItemIdentifier(ctx context.Context, containerItemIdentifier NSFileProviderItemIdentifier) error
- func (f NSFileProviderManager) SignalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier NSFileProviderItemIdentifier, completion ErrorHandler)
- func (f NSFileProviderManager) SignalErrorResolved(ctx context.Context, error_ foundation.NSError) error
- func (f NSFileProviderManager) SignalErrorResolvedCompletionHandler(error_ foundation.NSError, completionHandler ErrorHandler)
- func (f NSFileProviderManager) StateDirectoryURLWithError() (foundation.NSURL, error)
- func (f NSFileProviderManager) TemporaryDirectoryURLWithError() (foundation.NSURL, error)
- func (f NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
- func (f NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
- func (f NSFileProviderManager) WaitForStabilization(ctx context.Context) error
- func (f NSFileProviderManager) WaitForStabilizationWithCompletionHandler(completionHandler ErrorHandler)
- type NSFileProviderManagerClass
- func (fc NSFileProviderManagerClass) AddDomain(ctx context.Context, domain INSFileProviderDomain) error
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) AddDomainCompletionHandler(domain INSFileProviderDomain, completionHandler ErrorHandler)
- func (nc NSFileProviderManagerClass) Alloc() NSFileProviderManager
- func (nc NSFileProviderManagerClass) Class() objc.Class
- func (fc NSFileProviderManagerClass) GetDomains(ctx context.Context) ([]NSFileProviderDomain, error)
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) GetDomainsWithCompletionHandler(completionHandler NSFileProviderDomainArrayErrorHandler)
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) GetIdentifierForUserVisibleFileAtURLCompletionHandler(url foundation.NSURL, completionHandler StringStringErrorHandler)
- func (fc NSFileProviderManagerClass) ImportDomainFromDirectoryAtURL(ctx context.Context, domain INSFileProviderDomain, url foundation.NSURL) error
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) ImportDomainFromDirectoryAtURLCompletionHandler(domain INSFileProviderDomain, url foundation.NSURL, ...)
- func (fc NSFileProviderManagerClass) RemoveAllDomains(ctx context.Context) error
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveAllDomainsWithCompletionHandler(completionHandler ErrorHandler)
- func (fc NSFileProviderManagerClass) RemoveDomain(ctx context.Context, domain INSFileProviderDomain) error
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveDomainCompletionHandler(domain INSFileProviderDomain, completionHandler ErrorHandler)
- func (fc NSFileProviderManagerClass) RemoveDomainMode(ctx context.Context, domain INSFileProviderDomain, ...) (*foundation.NSURL, error)
- func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveDomainModeCompletionHandler(domain INSFileProviderDomain, mode NSFileProviderDomainRemovalMode, ...)
- type NSFileProviderManagerDisconnectionOptions
- type NSFileProviderMaterializationFlags
- type NSFileProviderModifyItemOptions
- type NSFileProviderPage
- type NSFileProviderPartialContentFetching
- type NSFileProviderPartialContentFetchingObject
- func (o NSFileProviderPartialContentFetchingObject) BaseObject() objectivec.Object
- func (o NSFileProviderPartialContentFetchingObject) FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, ...) foundation.Progress
- type NSFileProviderPendingSetEnumerator
- type NSFileProviderPendingSetEnumeratorObject
- func (o NSFileProviderPendingSetEnumeratorObject) BaseObject() objectivec.Object
- func (o NSFileProviderPendingSetEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)
- func (o NSFileProviderPendingSetEnumeratorObject) DomainVersion() INSFileProviderDomainVersion
- func (o NSFileProviderPendingSetEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor(observer NSFileProviderChangeObserver, syncAnchor NSFileProviderSyncAnchor)
- func (o NSFileProviderPendingSetEnumeratorObject) EnumerateItemsForObserverStartingAtPage(observer NSFileProviderEnumerationObserver, page NSFileProviderPage)
- func (o NSFileProviderPendingSetEnumeratorObject) Invalidate()
- func (o NSFileProviderPendingSetEnumeratorObject) IsMaximumSizeReached() bool
- func (o NSFileProviderPendingSetEnumeratorObject) RefreshInterval() foundation.NSTimeInterval
- type NSFileProviderReplicatedExtension
- type NSFileProviderReplicatedExtensionObject
- func (o NSFileProviderReplicatedExtensionObject) BaseObject() objectivec.Object
- func (o NSFileProviderReplicatedExtensionObject) CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler(itemTemplate NSFileProviderItem, fields NSFileProviderItemFields, ...) foundation.Progress
- func (o NSFileProviderReplicatedExtensionObject) DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler(identifier NSFileProviderItemIdentifier, version INSFileProviderItemVersion, ...) foundation.Progress
- func (o NSFileProviderReplicatedExtensionObject) EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier NSFileProviderItemIdentifier, ...) (NSFileProviderEnumerator, error)
- func (o NSFileProviderReplicatedExtensionObject) FetchContentsForItemWithIdentifierVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, ...) foundation.Progress
- func (o NSFileProviderReplicatedExtensionObject) ImportDidFinishWithCompletionHandler(completionHandler VoidHandler)
- func (o NSFileProviderReplicatedExtensionObject) Invalidate()
- func (o NSFileProviderReplicatedExtensionObject) ItemForIdentifierRequestCompletionHandler(identifier NSFileProviderItemIdentifier, request INSFileProviderRequest, ...) foundation.Progress
- func (o NSFileProviderReplicatedExtensionObject) MaterializedItemsDidChangeWithCompletionHandler(completionHandler VoidHandler)
- func (o NSFileProviderReplicatedExtensionObject) ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler(item NSFileProviderItem, version INSFileProviderItemVersion, ...) foundation.Progress
- func (o NSFileProviderReplicatedExtensionObject) PendingItemsDidChangeWithCompletionHandler(completionHandler VoidHandler)
- type NSFileProviderRequest
- func (f NSFileProviderRequest) Autorelease() NSFileProviderRequest
- func (f NSFileProviderRequest) DomainVersion() INSFileProviderDomainVersion
- func (f NSFileProviderRequest) Init() NSFileProviderRequest
- func (f NSFileProviderRequest) IsFileViewerRequest() bool
- func (f NSFileProviderRequest) IsSystemRequest() bool
- func (f NSFileProviderRequest) RequestingExecutable() foundation.NSURL
- type NSFileProviderRequestClass
- type NSFileProviderSearchEnumerationObserver
- type NSFileProviderSearchEnumerationObserverObject
- func (o NSFileProviderSearchEnumerationObserverObject) BaseObject() objectivec.Object
- func (o NSFileProviderSearchEnumerationObserverObject) DidEnumerateSearchResults(searchResults []objectivec.IObject)
- func (o NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
- func (o NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
- func (o NSFileProviderSearchEnumerationObserverObject) MaximumNumberOfResultsPerPage() int
- type NSFileProviderSearchEnumerator
- type NSFileProviderSearchEnumeratorObject
- func (o NSFileProviderSearchEnumeratorObject) BaseObject() objectivec.Object
- func (o NSFileProviderSearchEnumeratorObject) EnumerateSearchResultsForObserverStartingAtPage(observer NSFileProviderSearchEnumerationObserver, page NSFileProviderPage)
- func (o NSFileProviderSearchEnumeratorObject) Invalidate()
- type NSFileProviderSearchResult
- type NSFileProviderSearchResultObject
- func (o NSFileProviderSearchResultObject) BaseObject() objectivec.Object
- func (o NSFileProviderSearchResultObject) ContentModificationDate() foundation.NSDate
- func (o NSFileProviderSearchResultObject) ContentType() uniformtypeidentifiers.UTType
- func (o NSFileProviderSearchResultObject) CreationDate() foundation.NSDate
- func (o NSFileProviderSearchResultObject) DocumentSize() foundation.NSNumber
- func (o NSFileProviderSearchResultObject) Filename() string
- func (o NSFileProviderSearchResultObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderSearchResultObject) LastUsedDate() foundation.NSDate
- type NSFileProviderSearching
- type NSFileProviderSearchingObject
- type NSFileProviderServiceSource
- type NSFileProviderServiceSourceObject
- func (o NSFileProviderServiceSourceObject) BaseObject() objectivec.Object
- func (o NSFileProviderServiceSourceObject) IsRestricted() bool
- func (o NSFileProviderServiceSourceObject) MakeListenerEndpointAndReturnError() (foundation.NSXPCListenerEndpoint, error)
- func (o NSFileProviderServiceSourceObject) ServiceName() foundation.NSFileProviderServiceName
- type NSFileProviderServicing
- type NSFileProviderServicingObject
- type NSFileProviderStringSearchRequest
- func (f NSFileProviderStringSearchRequest) Autorelease() NSFileProviderStringSearchRequest
- func (f NSFileProviderStringSearchRequest) DesiredNumberOfResults() int
- func (f NSFileProviderStringSearchRequest) Init() NSFileProviderStringSearchRequest
- func (f NSFileProviderStringSearchRequest) Query() string
- type NSFileProviderStringSearchRequestClass
- type NSFileProviderSyncAnchor
- type NSFileProviderTestingChildrenEnumeration
- type NSFileProviderTestingChildrenEnumerationObject
- func (o NSFileProviderTestingChildrenEnumerationObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingChildrenEnumerationObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingChildrenEnumerationObject) Side() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingChildrenEnumerationObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingCollisionResolution
- type NSFileProviderTestingCollisionResolutionObject
- func (o NSFileProviderTestingCollisionResolutionObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingCollisionResolutionObject) RenamedItem() NSFileProviderItem
- func (o NSFileProviderTestingCollisionResolutionObject) Side() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingCollisionResolutionObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingContentFetch
- type NSFileProviderTestingContentFetchObject
- func (o NSFileProviderTestingContentFetchObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingContentFetchObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingContentFetchObject) Side() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingContentFetchObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingCreation
- type NSFileProviderTestingCreationObject
- func (o NSFileProviderTestingCreationObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingCreationObject) DomainVersion() INSFileProviderDomainVersion
- func (o NSFileProviderTestingCreationObject) SourceItem() NSFileProviderItem
- func (o NSFileProviderTestingCreationObject) TargetSide() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingCreationObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingDeletion
- type NSFileProviderTestingDeletionObject
- func (o NSFileProviderTestingDeletionObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingDeletionObject) DomainVersion() INSFileProviderDomainVersion
- func (o NSFileProviderTestingDeletionObject) SourceItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingDeletionObject) TargetItemBaseVersion() INSFileProviderItemVersion
- func (o NSFileProviderTestingDeletionObject) TargetItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingDeletionObject) TargetSide() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingDeletionObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingIngestion
- type NSFileProviderTestingIngestionObject
- func (o NSFileProviderTestingIngestionObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingIngestionObject) Item() NSFileProviderItem
- func (o NSFileProviderTestingIngestionObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingIngestionObject) Side() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingIngestionObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingLookup
- type NSFileProviderTestingLookupObject
- func (o NSFileProviderTestingLookupObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingLookupObject) ItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingLookupObject) Side() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingLookupObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingModification
- type NSFileProviderTestingModificationObject
- func (o NSFileProviderTestingModificationObject) BaseObject() objectivec.Object
- func (o NSFileProviderTestingModificationObject) ChangedFields() NSFileProviderItemFields
- func (o NSFileProviderTestingModificationObject) DomainVersion() INSFileProviderDomainVersion
- func (o NSFileProviderTestingModificationObject) SourceItem() NSFileProviderItem
- func (o NSFileProviderTestingModificationObject) TargetItemBaseVersion() INSFileProviderItemVersion
- func (o NSFileProviderTestingModificationObject) TargetItemIdentifier() NSFileProviderItemIdentifier
- func (o NSFileProviderTestingModificationObject) TargetSide() NSFileProviderTestingOperationSide
- func (o NSFileProviderTestingModificationObject) Type() NSFileProviderTestingOperationType
- type NSFileProviderTestingOperation
- type NSFileProviderTestingOperationObject
- type NSFileProviderTestingOperationSide
- type NSFileProviderTestingOperationType
- type NSFileProviderThumbnailing
- type NSFileProviderThumbnailingObject
- type NSFileProviderTypeAndCreator
- type NSFileProviderUserInfoKey
- type NSFileProviderUserInteractionSuppressing
- type NSFileProviderUserInteractionSuppressingObject
- func (o NSFileProviderUserInteractionSuppressingObject) BaseObject() objectivec.Object
- func (o NSFileProviderUserInteractionSuppressingObject) IsInteractionSuppressedForIdentifier(suppressionIdentifier string) bool
- func (o NSFileProviderUserInteractionSuppressingObject) SetInteractionSuppressedForIdentifier(suppression bool, suppressionIdentifier string)
- type NSFileProviderVolumeUnsupportedReason
- type StringDataErrorHandler
- type StringStringErrorHandler
- type URLErrorHandler
- type URLFileProviderItemErrorHandler
- type URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler
- type VoidHandler
Constants ¶
This section is empty.
Variables ¶
var ( // FileProviderDomainDidChange is a notification that posts when a file provider’s domain changes. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainDidChange FileProviderDomainDidChange foundation.NSNotificationName // FileProviderMaterializedSetDidChange is a notification that the system posts when the set of materialized items changes for your file provider extension. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderMaterializedSetDidChange FileProviderMaterializedSetDidChange foundation.NSNotificationName // FileProviderPendingSetDidChange is a notification that the system posts when the set of pending items changes for your file provider extension. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetDidChange FileProviderPendingSetDidChange foundation.NSNotificationName )
var ( // FileProviderErrorItemKey is the key for accessing information about sync-related errors. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderErrorItemKey FileProviderErrorItemKey foundation.NSErrorUserInfoKey // FileProviderErrorNonExistentItemIdentifierKey is the key for accessing the specified item’s identifier when the item doesn’t exist. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderErrorNonExistentItemIdentifierKey FileProviderErrorNonExistentItemIdentifierKey foundation.NSErrorUserInfoKey )
var ( // FileProviderErrorDomain is the error domain for the File Provider extension. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderErrorDomain FileProviderErrorDomain foundation.NSErrorDomain )
var ( // FileProviderFavoriteRankUnranked is a value that indicates that the item is not ranked. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderFavoriteRankUnranked FileProviderFavoriteRankUnranked uint64 )
Functions ¶
func NewDataBlock ¶
func NewDataBlock(handler DataHandler) (objc.ID, func())
NewDataBlock wraps a Go DataHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [NSFileProviderEnumerator.CurrentSyncAnchorWithCompletionHandler]
func NewErrorBlock ¶
func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- NSFileProviderCustomAction.PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler
- NSFileProviderExternalVolumeHandling.ShouldConnectExternalDomainWithCompletionHandler
- [NSFileProviderManager.AddDomainCompletionHandler]
- NSFileProviderManager.ClaimKnownFoldersLocalizedReasonCompletionHandler
- NSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler
- NSFileProviderManager.EvictItemWithIdentifierCompletionHandler
- [NSFileProviderManager.ImportDomainFromDirectoryAtURLCompletionHandler]
- NSFileProviderManager.ReconnectWithCompletionHandler
- NSFileProviderManager.RegisterURLSessionTaskForItemWithIdentifierCompletionHandler
- NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler
- NSFileProviderManager.ReleaseKnownFoldersLocalizedReasonCompletionHandler
- [NSFileProviderManager.RemoveAllDomainsWithCompletionHandler]
- [NSFileProviderManager.RemoveDomainCompletionHandler]
- NSFileProviderManager.RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler
- NSFileProviderManager.RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler
- NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler
- NSFileProviderManager.SignalErrorResolvedCompletionHandler
- NSFileProviderManager.WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler
- NSFileProviderManager.WaitForStabilizationWithCompletionHandler
- NSFileProviderReplicatedExtension.DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler
- NSFileProviderServicing.SupportedServiceSourcesForItemIdentifierCompletionHandler
- NSFileProviderThumbnailing.FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler
func NewFileProviderItemErrorBlock ¶
func NewFileProviderItemErrorBlock(handler FileProviderItemErrorHandler) (objc.ID, func())
NewFileProviderItemErrorBlock wraps a Go FileProviderItemErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewFileProviderItemNSFileProviderItemFieldsBoolErrorBlock ¶
func NewFileProviderItemNSFileProviderItemFieldsBoolErrorBlock(handler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) (objc.ID, func())
NewFileProviderItemNSFileProviderItemFieldsBoolErrorBlock wraps a Go FileProviderItemNSFileProviderItemFieldsBoolErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewFileProviderKnownFolderLocationsErrorBlock ¶
func NewFileProviderKnownFolderLocationsErrorBlock(handler FileProviderKnownFolderLocationsErrorHandler) (objc.ID, func())
NewFileProviderKnownFolderLocationsErrorBlock wraps a Go FileProviderKnownFolderLocationsErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewFileProviderServiceErrorBlock ¶
func NewFileProviderServiceErrorBlock(handler FileProviderServiceErrorHandler) (objc.ID, func())
NewFileProviderServiceErrorBlock wraps a Go FileProviderServiceErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewNSFileProviderDomainArrayErrorBlock ¶
func NewNSFileProviderDomainArrayErrorBlock(handler NSFileProviderDomainArrayErrorHandler) (objc.ID, func())
NewNSFileProviderDomainArrayErrorBlock wraps a Go NSFileProviderDomainArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [NSFileProviderManager.GetDomainsWithCompletionHandler]
func NewStringDataErrorBlock ¶
func NewStringDataErrorBlock(handler StringDataErrorHandler) (objc.ID, func())
NewStringDataErrorBlock wraps a Go StringDataErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewStringStringErrorBlock ¶
func NewStringStringErrorBlock(handler StringStringErrorHandler) (objc.ID, func())
NewStringStringErrorBlock wraps a Go StringStringErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [NSFileProviderManager.GetIdentifierForUserVisibleFileAtURLCompletionHandler]
func NewURLErrorBlock ¶
func NewURLErrorBlock(handler URLErrorHandler) (objc.ID, func())
NewURLErrorBlock wraps a Go URLErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- NSFileProviderManager.GetUserVisibleURLForItemIdentifierCompletionHandler
- [NSFileProviderManager.RemoveDomainModeCompletionHandler]
func NewURLFileProviderItemErrorBlock ¶
func NewURLFileProviderItemErrorBlock(handler URLFileProviderItemErrorHandler) (objc.ID, func())
NewURLFileProviderItemErrorBlock wraps a Go URLFileProviderItemErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewURLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorBlock ¶
func NewURLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorBlock(handler URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler) (objc.ID, func())
NewURLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorBlock wraps a Go URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewVoidBlock ¶
func NewVoidBlock(handler VoidHandler) (objc.ID, func())
NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [NSFileProviderReplicatedExtension.ImportDidFinishWithCompletionHandler]
- [NSFileProviderReplicatedExtension.MaterializedItemsDidChangeWithCompletionHandler]
- [NSFileProviderReplicatedExtension.PendingItemsDidChangeWithCompletionHandler]
Types ¶
type DataHandler ¶
type DataHandler = func(*foundation.NSData)
DataHandler is the signature for a completion handler block.
Used by:
- [NSFileProviderEnumerator.CurrentSyncAnchorWithCompletionHandler]
type ErrorHandler ¶
type ErrorHandler = func(error)
ErrorHandler handles A block called by the system immediately after receiving the request.
- error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- NSFileProviderCustomAction.PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler
- NSFileProviderExternalVolumeHandling.ShouldConnectExternalDomainWithCompletionHandler
- [NSFileProviderManager.AddDomainCompletionHandler]
- NSFileProviderManager.ClaimKnownFoldersLocalizedReasonCompletionHandler
- NSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler
- NSFileProviderManager.EvictItemWithIdentifierCompletionHandler
- [NSFileProviderManager.ImportDomainFromDirectoryAtURLCompletionHandler]
- NSFileProviderManager.ReconnectWithCompletionHandler
- NSFileProviderManager.RegisterURLSessionTaskForItemWithIdentifierCompletionHandler
- NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler
- NSFileProviderManager.ReleaseKnownFoldersLocalizedReasonCompletionHandler
- [NSFileProviderManager.RemoveAllDomainsWithCompletionHandler]
- [NSFileProviderManager.RemoveDomainCompletionHandler]
- NSFileProviderManager.RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler
- NSFileProviderManager.RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler
- NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler
- NSFileProviderManager.SignalErrorResolvedCompletionHandler
- NSFileProviderManager.WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler
- NSFileProviderManager.WaitForStabilizationWithCompletionHandler
- NSFileProviderReplicatedExtension.DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler
- NSFileProviderServicing.SupportedServiceSourcesForItemIdentifierCompletionHandler
- NSFileProviderThumbnailing.FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler
type FileProviderItemErrorHandler ¶
type FileProviderItemErrorHandler = func(NSFileProviderItem, error)
FileProviderItemErrorHandler handles A block that you call after downloading the item’s metadata. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type FileProviderItemNSFileProviderItemFieldsBoolErrorHandler ¶
type FileProviderItemNSFileProviderItemFieldsBoolErrorHandler = func(NSFileProviderItem, NSFileProviderItemFields, bool, error)
FileProviderItemNSFileProviderItemFieldsBoolErrorHandler handles A block that you call after uploading the item to your remote storage. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type FileProviderKnownFolderLocationsErrorHandler ¶
type FileProviderKnownFolderLocationsErrorHandler = func(*NSFileProviderKnownFolderLocations, error)
FileProviderKnownFolderLocationsErrorHandler is the signature for a completion handler block.
Used by:
type FileProviderServiceErrorHandler ¶
type FileProviderServiceErrorHandler = func(*foundation.NSFileProviderService, error)
FileProviderServiceErrorHandler is the signature for a completion handler block.
Used by:
type INSFileProviderDomain ¶
type INSFileProviderDomain interface {
objectivec.IObject
// Creates a new file provider domain with the specified identifier and display name.
InitWithIdentifierDisplayName(identifier NSFileProviderDomainIdentifier, displayName string) NSFileProviderDomain
// Creates a new file provider domain with the specified URL and display name.
InitWithDisplayNameUserInfoVolumeURL(displayName string, userInfo foundation.INSDictionary, volumeURL foundation.NSURL) NSFileProviderDomain
// The name of the domain displayed in the user interface.
DisplayName() string
// The domain’s unique identifier.
Identifier() NSFileProviderDomainIdentifier
IsReplicated() bool
// A unique identifier for the backing store used by the system.
BackingStoreIdentity() foundation.NSData
// A Boolean value that determines whether the domain is visible to users.
IsHidden() bool
SetHidden(value bool)
// A Boolean value that indicates whether the user has enabled or disabled the domain.
UserEnabled() bool
// A Boolean value indicating that the domain is present, but disconnected from the file extension.
IsDisconnected() bool
SupportsSyncingTrash() bool
SetSupportsSyncingTrash(value bool)
UserInfo() foundation.INSDictionary
SetUserInfo(value foundation.INSDictionary)
VolumeUUID() foundation.NSUUID
// A list of known folders that the domain currently replicates.
ReplicatedKnownFolders() NSFileProviderKnownFolders
// A list of known folders that the domain can replicate.
SupportedKnownFolders() NSFileProviderKnownFolders
SetSupportedKnownFolders(value NSFileProviderKnownFolders)
// A Boolean value that indicates whether the provider supports search.
SupportsStringSearchRequest() bool
SetSupportsStringSearchRequest(value bool)
// A mode that gives the File Provider extension more control over the system’s behavior during testing.
TestingModes() NSFileProviderDomainTestingModes
SetTestingModes(value NSFileProviderDomainTestingModes)
}
An interface definition for the NSFileProviderDomain class.
Creating domains ¶
- INSFileProviderDomain.InitWithIdentifierDisplayName: Creates a new file provider domain with the specified identifier and display name.
- INSFileProviderDomain.InitWithDisplayNameUserInfoVolumeURL: Creates a new file provider domain with the specified URL and display name.
Accessing data ¶
- INSFileProviderDomain.DisplayName: The name of the domain displayed in the user interface.
- INSFileProviderDomain.Identifier: The domain’s unique identifier.
- INSFileProviderDomain.IsReplicated
- INSFileProviderDomain.BackingStoreIdentity: A unique identifier for the backing store used by the system.
- INSFileProviderDomain.IsHidden: A Boolean value that determines whether the domain is visible to users.
- INSFileProviderDomain.SetHidden
- INSFileProviderDomain.UserEnabled: A Boolean value that indicates whether the user has enabled or disabled the domain.
- INSFileProviderDomain.IsDisconnected: A Boolean value indicating that the domain is present, but disconnected from the file extension.
- INSFileProviderDomain.SupportsSyncingTrash
- INSFileProviderDomain.SetSupportsSyncingTrash
- INSFileProviderDomain.UserInfo
- INSFileProviderDomain.SetUserInfo
- INSFileProviderDomain.VolumeUUID
Syncing Desktop and Documents folders ¶
- INSFileProviderDomain.ReplicatedKnownFolders: A list of known folders that the domain currently replicates.
- INSFileProviderDomain.SupportedKnownFolders: A list of known folders that the domain can replicate.
- INSFileProviderDomain.SetSupportedKnownFolders
Supporting search ¶
- INSFileProviderDomain.SupportsStringSearchRequest: A Boolean value that indicates whether the provider supports search.
- INSFileProviderDomain.SetSupportsStringSearchRequest
Testing ¶
- INSFileProviderDomain.TestingModes: A mode that gives the File Provider extension more control over the system’s behavior during testing.
- INSFileProviderDomain.SetTestingModes
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain
type INSFileProviderDomainVersion ¶
type INSFileProviderDomainVersion interface {
objectivec.IObject
// Creates a new version that supersedes the current version.
Next() INSFileProviderDomainVersion
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the NSFileProviderDomainVersion class.
Creating Versions ¶
- INSFileProviderDomainVersion.Next: Creates a new version that supersedes the current version.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainVersion
type INSFileProviderItemVersion ¶
type INSFileProviderItemVersion interface {
objectivec.IObject
// Creates a new version object.
InitWithContentVersionMetadataVersion(contentVersion foundation.NSData, metadataVersion foundation.NSData) NSFileProviderItemVersion
// An opaque object used to track versions of the item’s content.
ContentVersion() foundation.NSData
// An opaque object used to track versions of the item’s metadata.
MetadataVersion() foundation.NSData
}
An interface definition for the NSFileProviderItemVersion class.
Creating Version Instances ¶
- INSFileProviderItemVersion.InitWithContentVersionMetadataVersion: Creates a new version object.
Accessing Version Data ¶
- INSFileProviderItemVersion.ContentVersion: An opaque object used to track versions of the item’s content.
- INSFileProviderItemVersion.MetadataVersion: An opaque object used to track versions of the item’s metadata.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion
type INSFileProviderKnownFolderLocation ¶
type INSFileProviderKnownFolderLocation interface {
objectivec.IObject
// Initialize a location with the item identifier of a folder that already exists on the server.
InitWithExistingItemIdentifier(existingItemIdentifier NSFileProviderItemIdentifier) NSFileProviderKnownFolderLocation
// Initialize a location with the filename of the folder in a specified parent.
InitWithParentItemIdentifierFilename(parentItemIdentifier NSFileProviderItemIdentifier, filename string) NSFileProviderKnownFolderLocation
}
An interface definition for the NSFileProviderKnownFolderLocation class.
Initializers ¶
- INSFileProviderKnownFolderLocation.InitWithExistingItemIdentifier: Initialize a location with the item identifier of a folder that already exists on the server.
- INSFileProviderKnownFolderLocation.InitWithParentItemIdentifierFilename: Initialize a location with the filename of the folder in a specified parent.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location
type INSFileProviderKnownFolderLocations ¶
type INSFileProviderKnownFolderLocations interface {
objectivec.IObject
DesktopLocation() INSFileProviderKnownFolderLocation
SetDesktopLocation(value INSFileProviderKnownFolderLocation)
DocumentsLocation() INSFileProviderKnownFolderLocation
SetDocumentsLocation(value INSFileProviderKnownFolderLocation)
ShouldCreateBinaryCompatibilitySymlink() bool
SetShouldCreateBinaryCompatibilitySymlink(value bool)
}
An interface definition for the NSFileProviderKnownFolderLocations class.
Identifying known-folder locations ¶
- INSFileProviderKnownFolderLocations.DesktopLocation
- INSFileProviderKnownFolderLocations.SetDesktopLocation
- INSFileProviderKnownFolderLocations.DocumentsLocation
- INSFileProviderKnownFolderLocations.SetDocumentsLocation
Configuring folder options ¶
- INSFileProviderKnownFolderLocations.ShouldCreateBinaryCompatibilitySymlink
- INSFileProviderKnownFolderLocations.SetShouldCreateBinaryCompatibilitySymlink
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations
type INSFileProviderManager ¶
type INSFileProviderManager interface {
objectivec.IObject
// Returns the user-visible URL for an item.
GetUserVisibleURLForItemIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler URLErrorHandler)
// Tells the system to reimport the item and its content recursively.
ReimportItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
// Asks the system to remove an item from its cache.
EvictItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler(fields NSFileProviderItemFields, itemIdentifier NSFileProviderItemIdentifier, options NSFileProviderModifyItemOptions, completionHandler ErrorHandler)
// Returns an enumerator for all the items the system currently stores on disk.
EnumeratorForMaterializedItems() NSFileProviderEnumerator
// Returns an enumerator for the set of pending items.
EnumeratorForPendingItems() NSFileProviderPendingSetEnumerator
// Registers the URL session task responsible for the specified item.
RegisterURLSessionTaskForItemWithIdentifierCompletionHandler(task foundation.NSURLSessionTask, identifier NSFileProviderItemIdentifier, completion ErrorHandler)
// Alerts the system to changes in the specified folder’s content.
SignalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier NSFileProviderItemIdentifier, completion ErrorHandler)
// Requests a notification after the system completes all the specified changes.
WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
// Returns a progress object that tracks either the uploading or downloading of items from the File Provider extension’s remote storage.
GlobalProgressForKind(kind foundation.NSProgressFileOperationKind) foundation.Progress
// Disconnects the domain from the extension.
DisconnectWithReasonOptionsCompletionHandler(localizedReason string, options NSFileProviderManagerDisconnectionOptions, completionHandler ErrorHandler)
// Reconnects the domain with the extension.
ReconnectWithCompletionHandler(completionHandler ErrorHandler)
// Requests a notification after the domain stabilizes.
WaitForStabilizationWithCompletionHandler(completionHandler ErrorHandler)
// Returns the URL of a directory that the File Provider extension can use to temporarily store files before passing them to the system.
TemporaryDirectoryURLWithError() (foundation.NSURL, error)
// Asks the domain to sync the specified known folders.
ClaimKnownFoldersLocalizedReasonCompletionHandler(knownFolders INSFileProviderKnownFolderLocations, localizedReason string, completionHandler ErrorHandler)
// Asks the system to stop replicating the specified known folders in the domain.
ReleaseKnownFoldersLocalizedReasonCompletionHandler(knownFolders NSFileProviderKnownFolders, localizedReason string, completionHandler ErrorHandler)
// Returns a URL for a directory for storing state information for the domain.
StateDirectoryURLWithError() (foundation.NSURL, error)
GetServiceWithNameItemIdentifierCompletionHandler(serviceName foundation.NSFileProviderServiceName, itemIdentifier NSFileProviderItemIdentifier, completionHandler FileProviderServiceErrorHandler)
// Lists all the operations that are ready for scheduling.
ListAvailableTestingOperationsWithError() ([]objectivec.IObject, error)
// Asks the system to schedule and execute the specified operations.
RunTestingOperationsError(operations []objectivec.IObject) (foundation.INSDictionary, error)
// Indicates a resolved error.
SignalErrorResolvedCompletionHandler(error_ foundation.NSError, completionHandler ErrorHandler)
// Requests a diagnostics collection for use when working directly with Apple to improve sync behavior.
RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, errorReason foundation.NSError, completionHandler ErrorHandler)
}
An interface definition for the NSFileProviderManager class.
Translating user-visible URLs ¶
- INSFileProviderManager.GetUserVisibleURLForItemIdentifierCompletionHandler: Returns the user-visible URL for an item.
Working with items ¶
- INSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler: Tells the system to reimport the item and its content recursively.
- INSFileProviderManager.EvictItemWithIdentifierCompletionHandler: Asks the system to remove an item from its cache.
- INSFileProviderManager.RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler
- INSFileProviderManager.EnumeratorForMaterializedItems: Returns an enumerator for all the items the system currently stores on disk.
- INSFileProviderManager.EnumeratorForPendingItems: Returns an enumerator for the set of pending items.
Performing actions ¶
- INSFileProviderManager.RegisterURLSessionTaskForItemWithIdentifierCompletionHandler: Registers the URL session task responsible for the specified item.
- INSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler: Alerts the system to changes in the specified folder’s content.
- INSFileProviderManager.WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler: Requests a notification after the system completes all the specified changes.
- INSFileProviderManager.GlobalProgressForKind: Returns a progress object that tracks either the uploading or downloading of items from the File Provider extension’s remote storage.
Working with domains ¶
- INSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler: Disconnects the domain from the extension.
- INSFileProviderManager.ReconnectWithCompletionHandler: Reconnects the domain with the extension.
- INSFileProviderManager.WaitForStabilizationWithCompletionHandler: Requests a notification after the domain stabilizes.
- INSFileProviderManager.TemporaryDirectoryURLWithError: Returns the URL of a directory that the File Provider extension can use to temporarily store files before passing them to the system.
Syncing Desktop and Documents folders ¶
- INSFileProviderManager.ClaimKnownFoldersLocalizedReasonCompletionHandler: Asks the domain to sync the specified known folders.
- INSFileProviderManager.ReleaseKnownFoldersLocalizedReasonCompletionHandler: Asks the system to stop replicating the specified known folders in the domain.
Working with external volumes ¶
- INSFileProviderManager.StateDirectoryURLWithError: Returns a URL for a directory for storing state information for the domain.
Using services ¶
Testing ¶
- INSFileProviderManager.ListAvailableTestingOperationsWithError: Lists all the operations that are ready for scheduling.
- INSFileProviderManager.RunTestingOperationsError: Asks the system to schedule and execute the specified operations.
Handling errors ¶
- INSFileProviderManager.SignalErrorResolvedCompletionHandler: Indicates a resolved error.
Collecting diagnostic reports ¶
- INSFileProviderManager.RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler: Requests a diagnostics collection for use when working directly with Apple to improve sync behavior.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager
type INSFileProviderRequest ¶
type INSFileProviderRequest interface {
objectivec.IObject
// The version of the domain for the request.
DomainVersion() INSFileProviderDomainVersion
// The URL of the requesting executable.
RequestingExecutable() foundation.NSURL
// A Boolean value that indicates whether the request came from Finder or related system file browsers.
IsFileViewerRequest() bool
// A Boolean value that indicates whether the request came from a system process.
IsSystemRequest() bool
}
An interface definition for the NSFileProviderRequest class.
Accessing Application Information ¶
- INSFileProviderRequest.DomainVersion: The version of the domain for the request.
- INSFileProviderRequest.RequestingExecutable: The URL of the requesting executable.
- INSFileProviderRequest.IsFileViewerRequest: A Boolean value that indicates whether the request came from Finder or related system file browsers.
- INSFileProviderRequest.IsSystemRequest: A Boolean value that indicates whether the request came from a system process.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest
type INSFileProviderStringSearchRequest ¶
type INSFileProviderStringSearchRequest interface {
objectivec.IObject
// A plaintext string, representing the query a person entered into the system search UI.
Query() string
// How many results the system is requesting. This is a hint to the extension, to help avoid unnecessary work. The extension may return more results than this.
DesiredNumberOfResults() int
}
An interface definition for the NSFileProviderStringSearchRequest class.
Working with request properties ¶
- INSFileProviderStringSearchRequest.Query: A plaintext string, representing the query a person entered into the system search UI.
Instance Properties ¶
- INSFileProviderStringSearchRequest.DesiredNumberOfResults: How many results the system is requesting. This is a hint to the extension, to help avoid unnecessary work. The extension may return more results than this.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderStringSearchRequest
type NSFileProviderChangeObserver ¶
type NSFileProviderChangeObserver interface {
objectivec.IObject
// Tells the observer that the specified items have been deleted.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/didDeleteItems(withIdentifiers:)
DidDeleteItemsWithIdentifiers(deletedItemIdentifiers []string)
// Tells the observer that the specified items have been updated.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/didUpdate(_:)
DidUpdateItems(updatedItems []objectivec.IObject)
// Tells the observer that all of the changes have been enumerated up to the specified sync anchor.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/finishEnumeratingChanges(upTo:moreComing:)
FinishEnumeratingChangesUpToSyncAnchorMoreComing(anchor NSFileProviderSyncAnchor, moreComing bool)
// Tells the observer that an error occurred during change notification.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/finishEnumeratingWithError(_:)
FinishEnumeratingWithError(error_ foundation.NSError)
// The batch size that the system recommends.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/suggestedBatchSize
SuggestedBatchSize() int
}
An observer that receives changes and deletions during enumeration.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver
type NSFileProviderChangeObserverObject ¶
type NSFileProviderChangeObserverObject struct {
objectivec.Object
}
NSFileProviderChangeObserverObject wraps an existing Objective-C object that conforms to the NSFileProviderChangeObserver protocol.
func NSFileProviderChangeObserverObjectFromID ¶
func NSFileProviderChangeObserverObjectFromID(id objc.ID) NSFileProviderChangeObserverObject
NSFileProviderChangeObserverObjectFromID constructs a NSFileProviderChangeObserverObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderChangeObserverObject) BaseObject ¶
func (o NSFileProviderChangeObserverObject) BaseObject() objectivec.Object
func (NSFileProviderChangeObserverObject) DidDeleteItemsWithIdentifiers ¶
func (o NSFileProviderChangeObserverObject) DidDeleteItemsWithIdentifiers(deletedItemIdentifiers []string)
Tells the observer that the specified items have been deleted.
deletedItemIdentifiers: An array of identifiers for the deleted items.
func (NSFileProviderChangeObserverObject) DidUpdateItems ¶
func (o NSFileProviderChangeObserverObject) DidUpdateItems(updatedItems []objectivec.IObject)
Tells the observer that the specified items have been updated.
updatedItems: An array of updated items.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/didUpdate(_:)
func (NSFileProviderChangeObserverObject) FinishEnumeratingChangesUpToSyncAnchorMoreComing ¶
func (o NSFileProviderChangeObserverObject) FinishEnumeratingChangesUpToSyncAnchorMoreComing(anchor NSFileProviderSyncAnchor, moreComing bool)
Tells the observer that all of the changes have been enumerated up to the specified sync anchor.
anchor: An object used to identify the end of the current batch of changes.
moreComing: A Boolean value that indicates the file provider still has one or more batches of pending changes.
func (NSFileProviderChangeObserverObject) FinishEnumeratingWithError ¶
func (o NSFileProviderChangeObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
Tells the observer that an error occurred during change notification.
error: An object that contains information about the error.
func (NSFileProviderChangeObserverObject) SuggestedBatchSize ¶
func (o NSFileProviderChangeObserverObject) SuggestedBatchSize() int
The batch size that the system recommends.
Discussion ¶
The system suggests the batch size to optimize performance based on the context of the pending changes. The system can request the enumeration of a container for various reasons, such as if the user has the directory open in Finder, or the file open in an application. Each case has its own performance profile.
If the enumerator has more pending changes than the suggested batch size, it should split the changes into batches that are equal to or smaller than the batch size. If the enumerator has fewer changes than the suggested batch size, return all the changes immediately and finish the enumeration. You don’t need to wait for more incoming changes.
While using the suggested batch size helps ensure the best user experience, the system enforces a maximum of 100 times the suggested size.
type NSFileProviderContentPolicy ¶
type NSFileProviderContentPolicy int
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderContentPolicy
const ( NSFileProviderContentPolicyDownloadEagerlyAndKeepDownloaded NSFileProviderContentPolicy = 3 NSFileProviderContentPolicyDownloadLazily NSFileProviderContentPolicy = 1 NSFileProviderContentPolicyDownloadLazilyAndEvictOnRemoteUpdate NSFileProviderContentPolicy = 2 NSFileProviderContentPolicyInherited NSFileProviderContentPolicy = 0 )
func (NSFileProviderContentPolicy) String ¶
func (e NSFileProviderContentPolicy) String() string
type NSFileProviderCreateItemOptions ¶
type NSFileProviderCreateItemOptions uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderCreateItemOptions
const ( // NSFileProviderCreateItemDeletionConflicted: A value indicating a conflict for a deleted item. NSFileProviderCreateItemDeletionConflicted NSFileProviderCreateItemOptions = 2 // NSFileProviderCreateItemMayAlreadyExist: An option indicating that the item may already exist in your remote storage. NSFileProviderCreateItemMayAlreadyExist NSFileProviderCreateItemOptions = 1 )
func (NSFileProviderCreateItemOptions) String ¶
func (e NSFileProviderCreateItemOptions) String() string
type NSFileProviderCustomAction ¶
type NSFileProviderCustomAction interface {
objectivec.IObject
// Tells the File Provider extension to perform a custom action.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderCustomAction/performAction(identifier:onItemsWithIdentifiers:completionHandler:)
PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler(actionIdentifier NSFileProviderExtensionActionIdentifier, itemIdentifiers []string, completionHandler ErrorHandler) foundation.Progress
}
Support for custom actions.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderCustomAction
type NSFileProviderCustomActionObject ¶
type NSFileProviderCustomActionObject struct {
objectivec.Object
}
NSFileProviderCustomActionObject wraps an existing Objective-C object that conforms to the NSFileProviderCustomAction protocol.
func NSFileProviderCustomActionObjectFromID ¶
func NSFileProviderCustomActionObjectFromID(id objc.ID) NSFileProviderCustomActionObject
NSFileProviderCustomActionObjectFromID constructs a NSFileProviderCustomActionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderCustomActionObject) BaseObject ¶
func (o NSFileProviderCustomActionObject) BaseObject() objectivec.Object
func (NSFileProviderCustomActionObject) PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler ¶
func (o NSFileProviderCustomActionObject) PerformActionWithIdentifierOnItemsWithIdentifiersCompletionHandler(actionIdentifier NSFileProviderExtensionActionIdentifier, itemIdentifiers []string, completionHandler ErrorHandler) foundation.Progress
Tells the File Provider extension to perform a custom action.
actionIdentifier: The identifier for the requested custom action from the extension’s `Info.Plist()` file.
itemIdentifiers: A list of item identifiers affected by the action.
completionHandler: A block that you call after completing the specified action. You pass the following parameters:
error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks your extension’s progress.
Discussion ¶
Define the custom actions in the File Provider Extension’s `Info.Plist()` file, under the [NSExtensionFileProviderActions] key. The format of this key is identical to actions defined for a File Provider UI extension. For more information, see `Adding Actions to the Context Menu`.
type NSFileProviderDeleteItemOptions ¶
type NSFileProviderDeleteItemOptions uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDeleteItemOptions
const ( // NSFileProviderDeleteItemRecursive: A value indicating that the delete operation removes the item and all of its children. NSFileProviderDeleteItemRecursive NSFileProviderDeleteItemOptions = 1 )
func (NSFileProviderDeleteItemOptions) String ¶
func (e NSFileProviderDeleteItemOptions) String() string
type NSFileProviderDomain ¶
type NSFileProviderDomain struct {
objectivec.Object
}
A File Provider extension’s domain.
Overview ¶
You can use domains to partition a file provider’s content. When you use domains, a single file provider can act as if multiple file providers were installed, and users can dynamically switch from one domain to another. You can use domains to represent different accounts or locations.
By default, a File Provider extension has no domain. You can register domains by calling the NSFileProviderManager class’s NSFileProviderManagerClass.AddDomainCompletionHandler method. A new NSFileProviderExtension instance is created for each domain that you register. The NSFileProviderExtension object’s domain property indicates which domain the file provider belongs to. Any items returned by that file provider also belong to the domain.
Creating domains ¶
- NSFileProviderDomain.InitWithIdentifierDisplayName: Creates a new file provider domain with the specified identifier and display name.
- NSFileProviderDomain.InitWithDisplayNameUserInfoVolumeURL: Creates a new file provider domain with the specified URL and display name.
Accessing data ¶
- NSFileProviderDomain.DisplayName: The name of the domain displayed in the user interface.
- NSFileProviderDomain.Identifier: The domain’s unique identifier.
- NSFileProviderDomain.IsReplicated
- NSFileProviderDomain.BackingStoreIdentity: A unique identifier for the backing store used by the system.
- NSFileProviderDomain.IsHidden: A Boolean value that determines whether the domain is visible to users.
- NSFileProviderDomain.SetHidden
- NSFileProviderDomain.UserEnabled: A Boolean value that indicates whether the user has enabled or disabled the domain.
- NSFileProviderDomain.IsDisconnected: A Boolean value indicating that the domain is present, but disconnected from the file extension.
- NSFileProviderDomain.SupportsSyncingTrash
- NSFileProviderDomain.SetSupportsSyncingTrash
- NSFileProviderDomain.UserInfo
- NSFileProviderDomain.SetUserInfo
- NSFileProviderDomain.VolumeUUID
Syncing Desktop and Documents folders ¶
- NSFileProviderDomain.ReplicatedKnownFolders: A list of known folders that the domain currently replicates.
- NSFileProviderDomain.SupportedKnownFolders: A list of known folders that the domain can replicate.
- NSFileProviderDomain.SetSupportedKnownFolders
Supporting search ¶
- NSFileProviderDomain.SupportsStringSearchRequest: A Boolean value that indicates whether the provider supports search.
- NSFileProviderDomain.SetSupportsStringSearchRequest
Testing ¶
- NSFileProviderDomain.TestingModes: A mode that gives the File Provider extension more control over the system’s behavior during testing.
- NSFileProviderDomain.SetTestingModes
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain
func NSFileProviderDomainFromID ¶
func NSFileProviderDomainFromID(id objc.ID) NSFileProviderDomain
NSFileProviderDomainFromID constructs a NSFileProviderDomain from an objc.ID.
A File Provider extension’s domain.
func NewFileProviderDomainWithDisplayNameUserInfoVolumeURL ¶
func NewFileProviderDomainWithDisplayNameUserInfoVolumeURL(displayName string, userInfo foundation.INSDictionary, volumeURL foundation.NSURL) NSFileProviderDomain
Creates a new file provider domain with the specified URL and display name.
func NewFileProviderDomainWithIdentifierDisplayName ¶
func NewFileProviderDomainWithIdentifierDisplayName(identifier NSFileProviderDomainIdentifier, displayName string) NSFileProviderDomain
Creates a new file provider domain with the specified identifier and display name.
identifier: A string that identifies the domain. The file provider extension can select any string to uniquely identify the domain, as long as it doesn’t contain the colon (:) or slash (/) symbols.
displayName: The name for the domain that the system shows to the user.
func NewFileProviderDomainWithIdentifierDisplayNamePathRelativeToDocumentStorage ¶
func NewFileProviderDomainWithIdentifierDisplayNamePathRelativeToDocumentStorage(identifier NSFileProviderDomainIdentifier, displayName string, pathRelativeToDocumentStorage string) NSFileProviderDomain
Returns a newly instantiated domain.
identifier: A string that identifies the domain. The file provider extension can select any string to uniquely identify the domain, as long as it doesn’t contain the colon (:) or slash (/) symbols.
displayName: The name for the domain that the system shows to the user.
pathRelativeToDocumentStorage: A path relative to the file provider extension’s documentStorageURL that the system uses to store the domain’s content.
func NewNSFileProviderDomain ¶
func NewNSFileProviderDomain() NSFileProviderDomain
NewNSFileProviderDomain creates a new NSFileProviderDomain instance.
func (NSFileProviderDomain) Autorelease ¶
func (f NSFileProviderDomain) Autorelease() NSFileProviderDomain
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderDomain) BackingStoreIdentity ¶
func (f NSFileProviderDomain) BackingStoreIdentity() foundation.NSData
A unique identifier for the backing store used by the system.
Discussion ¶
Changes to this identifier indicate that the system has dropped its backing store and is creating a new one. The system may create a new backing store if the old store becomes corrupted. The file provider extension can also request a new backing store by calling NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler.
While rebuilding the backing store, the system invalidates any extension instances associated with the domain. As a result, the system guarantees that the NSFileProviderDomain.BackingStoreIdentity remains stable throughout the lifetime of an NSFileProviderReplicatedExtension instance.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/backingStoreIdentity
func (NSFileProviderDomain) DisplayName ¶
func (f NSFileProviderDomain) DisplayName() string
The name of the domain displayed in the user interface.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/displayName
func (NSFileProviderDomain) Identifier ¶
func (f NSFileProviderDomain) Identifier() NSFileProviderDomainIdentifier
The domain’s unique identifier.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/identifier
func (NSFileProviderDomain) Init ¶
func (f NSFileProviderDomain) Init() NSFileProviderDomain
Init initializes the instance.
func (NSFileProviderDomain) InitWithDisplayNameUserInfoVolumeURL ¶
func (f NSFileProviderDomain) InitWithDisplayNameUserInfoVolumeURL(displayName string, userInfo foundation.INSDictionary, volumeURL foundation.NSURL) NSFileProviderDomain
Creates a new file provider domain with the specified URL and display name.
func (NSFileProviderDomain) InitWithIdentifierDisplayName ¶
func (f NSFileProviderDomain) InitWithIdentifierDisplayName(identifier NSFileProviderDomainIdentifier, displayName string) NSFileProviderDomain
Creates a new file provider domain with the specified identifier and display name.
identifier: A string that identifies the domain. The file provider extension can select any string to uniquely identify the domain, as long as it doesn’t contain the colon (:) or slash (/) symbols.
displayName: The name for the domain that the system shows to the user.
func (NSFileProviderDomain) IsDisconnected ¶
func (f NSFileProviderDomain) IsDisconnected() bool
A Boolean value indicating that the domain is present, but disconnected from the file extension.
Discussion ¶
Users can continue to browse the content from a disconnected domain; however, the File Provider extension no longer sends or receives updates about modifications to the files.
To change the disconnected state, create a new NSFileProviderDomain using the same identifier, and pass it to NSFileProviderManagerClass.AddDomainCompletionHandler.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/isDisconnected
func (NSFileProviderDomain) IsHidden ¶
func (f NSFileProviderDomain) IsHidden() bool
A Boolean value that determines whether the domain is visible to users.
Discussion ¶
The system stores the files on disk, but it doesn’t display them to the user. For example, you could set this value to false when performing a dry run of a migration.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/isHidden
func (NSFileProviderDomain) IsReplicated ¶
func (f NSFileProviderDomain) IsReplicated() bool
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/isReplicated
func (NSFileProviderDomain) ReplicatedKnownFolders ¶
func (f NSFileProviderDomain) ReplicatedKnownFolders() NSFileProviderKnownFolders
A list of known folders that the domain currently replicates.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/replicatedKnownFolders
func (NSFileProviderDomain) SetHidden ¶
func (f NSFileProviderDomain) SetHidden(value bool)
func (NSFileProviderDomain) SetSupportedKnownFolders ¶
func (f NSFileProviderDomain) SetSupportedKnownFolders(value NSFileProviderKnownFolders)
func (NSFileProviderDomain) SetSupportsStringSearchRequest ¶
func (f NSFileProviderDomain) SetSupportsStringSearchRequest(value bool)
func (NSFileProviderDomain) SetSupportsSyncingTrash ¶
func (f NSFileProviderDomain) SetSupportsSyncingTrash(value bool)
func (NSFileProviderDomain) SetTestingModes ¶
func (f NSFileProviderDomain) SetTestingModes(value NSFileProviderDomainTestingModes)
func (NSFileProviderDomain) SetUserInfo ¶
func (f NSFileProviderDomain) SetUserInfo(value foundation.INSDictionary)
func (NSFileProviderDomain) SupportedKnownFolders ¶
func (f NSFileProviderDomain) SupportedKnownFolders() NSFileProviderKnownFolders
A list of known folders that the domain can replicate.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/supportedKnownFolders
func (NSFileProviderDomain) SupportsStringSearchRequest ¶
func (f NSFileProviderDomain) SupportsStringSearchRequest() bool
A Boolean value that indicates whether the provider supports search.
Discussion ¶
If this value is `true`, the framework uses the extension’s NSFileProviderSearching implementation to support search.
The property defaults to `false` (Swift) or [NO] (Objective-C).
func (NSFileProviderDomain) SupportsSyncingTrash ¶
func (f NSFileProviderDomain) SupportsSyncingTrash() bool
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/supportsSyncingTrash
func (NSFileProviderDomain) TestingModes ¶
func (f NSFileProviderDomain) TestingModes() NSFileProviderDomainTestingModes
A mode that gives the File Provider extension more control over the system’s behavior during testing.
Discussion ¶
By default, the value is `[]` (Swift) or `0` (Objective-C) and all testing modes are disabled. To enable a testing mode, assign its value to this property. You can combine multiple modes:
The system registers the domain’s testing mode when you add the domain by calling NSFileProviderManagerClass.AddDomainCompletionHandler. You can’t change the test mode after you add the domain.
func (NSFileProviderDomain) UserEnabled ¶
func (f NSFileProviderDomain) UserEnabled() bool
A Boolean value that indicates whether the user has enabled or disabled the domain.
Discussion ¶
By default, the property is true; however, If the user disables the domain in the System Preferences, the property is false.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/userEnabled
func (NSFileProviderDomain) UserInfo ¶
func (f NSFileProviderDomain) UserInfo() foundation.INSDictionary
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/userInfo
func (NSFileProviderDomain) VolumeUUID ¶
func (f NSFileProviderDomain) VolumeUUID() foundation.NSUUID
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/volumeUUID
type NSFileProviderDomainArrayErrorHandler ¶
type NSFileProviderDomainArrayErrorHandler = func(*[]NSFileProviderDomain, error)
NSFileProviderDomainArrayErrorHandler is the signature for a completion handler block.
Used by:
- [NSFileProviderManager.GetDomainsWithCompletionHandler]
type NSFileProviderDomainClass ¶
type NSFileProviderDomainClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderDomainClass ¶
func GetNSFileProviderDomainClass() NSFileProviderDomainClass
GetNSFileProviderDomainClass returns the class object for NSFileProviderDomain.
func (NSFileProviderDomainClass) Alloc ¶
func (nc NSFileProviderDomainClass) Alloc() NSFileProviderDomain
Alloc allocates memory for a new instance of the class.
func (NSFileProviderDomainClass) Class ¶
func (nc NSFileProviderDomainClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderDomainIdentifier ¶
type NSFileProviderDomainIdentifier = string
NSFileProviderDomainIdentifier is a unique identifier for a file provider’s domain.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainIdentifier
type NSFileProviderDomainRemovalMode ¶
type NSFileProviderDomainRemovalMode int
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/DomainRemovalMode
const ( // NSFileProviderDomainRemovalModePreserveDirtyUserData: Deletes the domain but keeps any items with unsynced, local changes. NSFileProviderDomainRemovalModePreserveDirtyUserData NSFileProviderDomainRemovalMode = 1 // NSFileProviderDomainRemovalModePreserveDownloadedUserData: Deletes the domain, but keeps the downloaded user data. NSFileProviderDomainRemovalModePreserveDownloadedUserData NSFileProviderDomainRemovalMode = 2 // NSFileProviderDomainRemovalModeRemoveAll: Deletes all items in the domain. NSFileProviderDomainRemovalModeRemoveAll NSFileProviderDomainRemovalMode = 0 )
func (NSFileProviderDomainRemovalMode) String ¶
func (e NSFileProviderDomainRemovalMode) String() string
type NSFileProviderDomainState ¶
type NSFileProviderDomainState interface {
objectivec.IObject
// An opaque object that uniquely identifies the domain’s version.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState/domainVersion
DomainVersion() INSFileProviderDomainVersion
// Global state information about the current domain version.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState/userInfo
UserInfo() foundation.INSDictionary
}
An object that contains global state data about the domain.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState
type NSFileProviderDomainStateObject ¶
type NSFileProviderDomainStateObject struct {
objectivec.Object
}
NSFileProviderDomainStateObject wraps an existing Objective-C object that conforms to the NSFileProviderDomainState protocol.
func NSFileProviderDomainStateObjectFromID ¶
func NSFileProviderDomainStateObjectFromID(id objc.ID) NSFileProviderDomainStateObject
NSFileProviderDomainStateObjectFromID constructs a NSFileProviderDomainStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderDomainStateObject) BaseObject ¶
func (o NSFileProviderDomainStateObject) BaseObject() objectivec.Object
func (NSFileProviderDomainStateObject) DomainVersion ¶
func (o NSFileProviderDomainStateObject) DomainVersion() INSFileProviderDomainVersion
An opaque object that uniquely identifies the domain’s version.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState/domainVersion
func (NSFileProviderDomainStateObject) UserInfo ¶
func (o NSFileProviderDomainStateObject) UserInfo() foundation.INSDictionary
Global state information about the current domain version.
Discussion ¶
Use this dictionary to add state information to the domain. You can then access the [UserInfo] dictionary in predicates for user interactions, file provider actions, and File Provider UI actions using the `domainUserInfo` context key.
This dictionary must only contain the following types for both its keys and values:
- NSString - NSNumber - NSDate - NSPersonNameComponents
The system expects you to update the `domainVersion` whenever the value of the [UserInfo] dictionary changes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState/userInfo
type NSFileProviderDomainTestingModes ¶
type NSFileProviderDomainTestingModes uint
const ( // NSFileProviderDomainTestingModeAlwaysEnabled: A testing mode that automatically enables the domain. NSFileProviderDomainTestingModeAlwaysEnabled NSFileProviderDomainTestingModes = 1 // NSFileProviderDomainTestingModeInteractive: A testing mode where the extension can deterministically test asynchronous operations. NSFileProviderDomainTestingModeInteractive NSFileProviderDomainTestingModes = 2 )
func (NSFileProviderDomainTestingModes) String ¶
func (e NSFileProviderDomainTestingModes) String() string
type NSFileProviderDomainVersion ¶
type NSFileProviderDomainVersion struct {
objectivec.Object
}
An opaque object that identifies a specific version of a domain.
Overview ¶
The file provider extension is responsible for assigning and updating the domain version. To specify the domain version, adopt the NSFileProviderDomainState protocol. The system then calls your extension’s [DomainVersion] method to read the current version.
The system reads the domain version after you call:
- The [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] completion handler - The [ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler] completion handler - The [DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler] completion handler - The [ItemForIdentifierRequestCompletionHandler] completion handler - The [FinishEnumeratingUpToPage] or [FinishEnumeratingWithError] method when enumerating the materialized set.
The system always reads the domain version on the same dispatch queue as the completion handler.
Your extension defines when the domain version changes. When you update the version, call the NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler and passing the workingSet constant as the `containerItemIdentifier` property. This notifies the system of the update. The system ignores any lower versions.
When the system discovers a change on disk, it associates that change with the current domain version. It then includes the version in the NSFileProviderRequest object passed to the file provider extension.
Only file provider extensions based on the NSFileProviderReplicatedExtension use instances of this class. Each version object is immutable. You can use them as keys in a dictionary.
Creating Versions ¶
- NSFileProviderDomainVersion.Next: Creates a new version that supersedes the current version.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainVersion
func NSFileProviderDomainVersionFromID ¶
func NSFileProviderDomainVersionFromID(id objc.ID) NSFileProviderDomainVersion
NSFileProviderDomainVersionFromID constructs a NSFileProviderDomainVersion from an objc.ID.
An opaque object that identifies a specific version of a domain.
func NewNSFileProviderDomainVersion ¶
func NewNSFileProviderDomainVersion() NSFileProviderDomainVersion
NewNSFileProviderDomainVersion creates a new NSFileProviderDomainVersion instance.
func (NSFileProviderDomainVersion) Autorelease ¶
func (f NSFileProviderDomainVersion) Autorelease() NSFileProviderDomainVersion
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderDomainVersion) EncodeWithCoder ¶
func (f NSFileProviderDomainVersion) EncodeWithCoder(coder foundation.INSCoder)
func (NSFileProviderDomainVersion) Init ¶
func (f NSFileProviderDomainVersion) Init() NSFileProviderDomainVersion
Init initializes the instance.
func (NSFileProviderDomainVersion) Next ¶
func (f NSFileProviderDomainVersion) Next() INSFileProviderDomainVersion
Creates a new version that supersedes the current version.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainVersion/next()
type NSFileProviderDomainVersionClass ¶
type NSFileProviderDomainVersionClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderDomainVersionClass ¶
func GetNSFileProviderDomainVersionClass() NSFileProviderDomainVersionClass
GetNSFileProviderDomainVersionClass returns the class object for NSFileProviderDomainVersion.
func (NSFileProviderDomainVersionClass) Alloc ¶
func (nc NSFileProviderDomainVersionClass) Alloc() NSFileProviderDomainVersion
Alloc allocates memory for a new instance of the class.
func (NSFileProviderDomainVersionClass) Class ¶
func (nc NSFileProviderDomainVersionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderEnumerating ¶
type NSFileProviderEnumerating interface {
objectivec.IObject
// Tells the file provider to return an enumerator for the provided directory.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerating/enumerator(for:request:)
EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier NSFileProviderItemIdentifier, request INSFileProviderRequest) (NSFileProviderEnumerator, error)
}
Support for enumerating the file provider’s contents.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerating
type NSFileProviderEnumeratingObject ¶
type NSFileProviderEnumeratingObject struct {
objectivec.Object
}
NSFileProviderEnumeratingObject wraps an existing Objective-C object that conforms to the NSFileProviderEnumerating protocol.
func NSFileProviderEnumeratingObjectFromID ¶
func NSFileProviderEnumeratingObjectFromID(id objc.ID) NSFileProviderEnumeratingObject
NSFileProviderEnumeratingObjectFromID constructs a NSFileProviderEnumeratingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderEnumeratingObject) BaseObject ¶
func (o NSFileProviderEnumeratingObject) BaseObject() objectivec.Object
func (NSFileProviderEnumeratingObject) EnumeratorForContainerItemIdentifierRequestError ¶
func (o NSFileProviderEnumeratingObject) EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier NSFileProviderItemIdentifier, request INSFileProviderRequest) (NSFileProviderEnumerator, error)
Tells the file provider to return an enumerator for the provided directory.
containerItemIdentifier: The item identifier for the directory.
request: An object that identifies the context of that request, such as the requesting app.
Return Value ¶
An enumerator for the specified directory.
Discussion ¶
The system calls this method to request an enumerator for the specified item.
Possible item identifiers include:
rootContainer: The system passes this identifier when the user begins browsing your file provider’s content. A directory’s [ItemIdentifier]: The system requests a new enumerator each time the user opens a new directory. workingSet: The system can request an enumerator so that it can sync the working set in the background. A document’s [ItemIdentifier]: The system subscribes to live updates by requesting an enumerator for a document. The trashContainer directory.: The system passes this identifier when the user browses the contents of the trash. If your File Provider extension doesn’t support moving items to the trash, your implementation should throw or return an error.
Your implementation should create and return an NSFileProviderEnumerator object that provides the requested content.
Handle Errors ¶
If you can’t return the requested enumerator, you must throw an error in Swift, or if you return nil in Objective-C, you must set the `error` out parameter.
If the `containerItemIdentifier` parameter is trashContainer and your extension doesn’t support trashing items, then it should fail with the NSFeatureUnsupportedError error code from the NSCocoaErrorDomain domain. Additionally, make sure the items managed by your File Provider extension don’t have the NSFileProviderItemCapabilitiesAllowsTrashing capability enabled.
If the `containerItemIdentifier` parameter doesn’t exist in your remote storage, you should fail with an NSFileProviderError.Code.noSuchItem error. The system then attempts to delete the item from disk.
If you pass NSFileProviderError.Code.notAuthenticated or NSFileProviderError.Code.serverUnreachable to the handler, the system presents an appropriate alert to the user, but doesn’t try to access the metadata until triggered again by the user.
The system considers any other errors to be transient, and automatically retries the method call.
type NSFileProviderEnumerationObserver ¶
type NSFileProviderEnumerationObserver interface {
objectivec.IObject
// Provides a batch of enumerated items.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/didEnumerate(_:)
DidEnumerateItems(updatedItems []objectivec.IObject)
// Tells the observer that all of the items have been enumerated up to the specified page.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumerating(upTo:)
FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
// Tells the observer that an error occurred during item enumeration.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumeratingWithError(_:)
FinishEnumeratingWithError(error_ foundation.NSError)
// The page size that the system recommends.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/suggestedPageSize
SuggestedPageSize() int
}
An observer that receives batches of items during enumeration.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver
type NSFileProviderEnumerationObserverObject ¶
type NSFileProviderEnumerationObserverObject struct {
objectivec.Object
}
NSFileProviderEnumerationObserverObject wraps an existing Objective-C object that conforms to the NSFileProviderEnumerationObserver protocol.
func NSFileProviderEnumerationObserverObjectFromID ¶
func NSFileProviderEnumerationObserverObjectFromID(id objc.ID) NSFileProviderEnumerationObserverObject
NSFileProviderEnumerationObserverObjectFromID constructs a NSFileProviderEnumerationObserverObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderEnumerationObserverObject) BaseObject ¶
func (o NSFileProviderEnumerationObserverObject) BaseObject() objectivec.Object
func (NSFileProviderEnumerationObserverObject) DidEnumerateItems ¶
func (o NSFileProviderEnumerationObserverObject) DidEnumerateItems(updatedItems []objectivec.IObject)
Provides a batch of enumerated items.
func (NSFileProviderEnumerationObserverObject) FinishEnumeratingUpToPage ¶
func (o NSFileProviderEnumerationObserverObject) FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
Tells the observer that all of the items have been enumerated up to the specified page.
func (NSFileProviderEnumerationObserverObject) FinishEnumeratingWithError ¶
func (o NSFileProviderEnumerationObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
Tells the observer that an error occurred during item enumeration.
func (NSFileProviderEnumerationObserverObject) SuggestedPageSize ¶
func (o NSFileProviderEnumerationObserverObject) SuggestedPageSize() int
The page size that the system recommends.
Discussion ¶
The system suggests a page size to optimize performance based on the enumeration’s context. The system can request the enumeration of a container for various reasons, such as if the user opens the directory in Finder, opens a file in an application, or if the system needs to materialize the contents of a directory. Each case has its own performance profile.
While using the suggested page size helps ensure the best user experience, the system enforces a maximum of 100 times the suggested size.
type NSFileProviderEnumerator ¶
type NSFileProviderEnumerator interface {
objectivec.IObject
// Requests the next batch of items, starting at the specified page.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/enumerateItems(for:startingAt:)
EnumerateItemsForObserverStartingAtPage(observer NSFileProviderEnumerationObserver, page NSFileProviderPage)
// Stops the enumeration of items and changes.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/invalidate()
Invalidate()
}
A protocol for enumerating items and changes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator
type NSFileProviderEnumeratorObject ¶
type NSFileProviderEnumeratorObject struct {
objectivec.Object
}
NSFileProviderEnumeratorObject wraps an existing Objective-C object that conforms to the NSFileProviderEnumerator protocol.
func NSFileProviderEnumeratorObjectFromID ¶
func NSFileProviderEnumeratorObjectFromID(id objc.ID) NSFileProviderEnumeratorObject
NSFileProviderEnumeratorObjectFromID constructs a NSFileProviderEnumeratorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderEnumeratorObject) BaseObject ¶
func (o NSFileProviderEnumeratorObject) BaseObject() objectivec.Object
func (NSFileProviderEnumeratorObject) CurrentSyncAnchorWithCompletionHandler ¶
func (o NSFileProviderEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)
Returns the current sync anchor.
Discussion ¶
func (NSFileProviderEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor ¶
func (o NSFileProviderEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor(observer NSFileProviderChangeObserver, syncAnchor NSFileProviderSyncAnchor)
Requests the next batch of changes after the specified sync anchor.
Discussion ¶
The system requests an enumerator in the following situations:
- For directories. The system requests an enumerator when a document browser displays the contents of a directory. For performance reasons, the system may retain the enumerator even after the browser has moved to a different directory. - For files. The system requests an enumerator when a file presenter begins managing an item. The enumerator is invalidated after the file presenter is removed. - For the working set. The system requests an enumerator when it begins indexing the working set. It invalidates the enumerator after the indexing operation has completed.
Once requested, an enumerator is used to provide both the content and any changes for an item. When the system is finished with the item, it calls the enumerator’s [Invalidate] method. For example, if you return an enumerator that provides the content of a directory, as long as the enumerator is active, the system also uses it to enumerate changes to the directory.
The system may have multiple, active enumerators for a number of different items. Some of these may represent items that are currently displayed on screen. Others may be items that are no longer displayed, but the enumerator is retained for performance reasons. You need to inform the system of any changes to the content managed by any of the active enumerators, as well as any changes to the working set (whether or not it has an active enumerator).
For more information on enumerating items, see Defining Your File Provider’s Content. For more information on tracking changes, see Tracking Your File Provider’s Changes.
func (NSFileProviderEnumeratorObject) EnumerateItemsForObserverStartingAtPage ¶
func (o NSFileProviderEnumeratorObject) EnumerateItemsForObserverStartingAtPage(observer NSFileProviderEnumerationObserver, page NSFileProviderPage)
Requests the next batch of items, starting at the specified page.
Discussion ¶
The system requests an enumerator in the following situations:
- For directories. The system requests an enumerator when a document browser displays the contents of a directory. For performance reasons, the system may retain the enumerator even after the browser has moved to a different directory. - For files. The system requests an enumerator when a file presenter begins managing an item. The enumerator is invalidated after the file presenter is removed. - For the working set. The system requests an enumerator when it begins indexing the working set. It invalidates the enumerator after the indexing operation has completed.
Once requested, an enumerator is used to provide both the content and any changes for an item. When the system is finished with the item, it calls the enumerator’s [Invalidate] method. For example, if you return an enumerator that provides the content of a directory, as long as the enumerator is active, the system also uses it to enumerate changes to the directory.
The system may have multiple, active enumerators for a number of different items. Some of these may represent items that are currently displayed on screen. Others may be items that are no longer displayed, but the enumerator is retained for performance reasons. You need to inform the system of any changes to the content managed by any of the active enumerators, as well as any changes to the working set (whether or not it has an active enumerator).
For more information on enumerating items, see Defining Your File Provider’s Content. For more information on tracking changes, see Tracking Your File Provider’s Changes.
func (NSFileProviderEnumeratorObject) Invalidate ¶
func (o NSFileProviderEnumeratorObject) Invalidate()
Stops the enumeration of items and changes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/invalidate()
type NSFileProviderErrorCode ¶
type NSFileProviderErrorCode int
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderError/Code
const ( // NSFileProviderErrorApplicationExtensionNotFound: An error indicating that there isn’t an app extension within the app bundle. NSFileProviderErrorApplicationExtensionNotFound NSFileProviderErrorCode = -2014 // NSFileProviderErrorCannotSynchronize: An error indicating a failed sync attempt. NSFileProviderErrorCannotSynchronize NSFileProviderErrorCode = -2005 // NSFileProviderErrorDeletionRejected: An error indicating a failed deletion action. NSFileProviderErrorDeletionRejected NSFileProviderErrorCode = -1006 // NSFileProviderErrorDirectoryNotEmpty: An error indicating an attempt to nonrecursively delete a directory that isn’t empty. NSFileProviderErrorDirectoryNotEmpty NSFileProviderErrorCode = -1007 NSFileProviderErrorDomainDisabled NSFileProviderErrorCode = -2011 NSFileProviderErrorExcludedFromSync NSFileProviderErrorCode = -2010 // NSFileProviderErrorFilenameCollision: An error indicating that an item with the same name already exists in the same directory. NSFileProviderErrorFilenameCollision NSFileProviderErrorCode = -1001 // NSFileProviderErrorInsufficientQuota: An error indicating that the File Provider extension can’t upload the item because it would push the account over its quota. NSFileProviderErrorInsufficientQuota NSFileProviderErrorCode = -1003 // NSFileProviderErrorLocalVersionConflictingWithServer: Returned by createItemBasedOnTemplate or modifyItem if the provider does not wish to sync the item. NSFileProviderErrorLocalVersionConflictingWithServer NSFileProviderErrorCode = -2015 // NSFileProviderErrorNewerExtensionVersionFound: An error indicating that the registered provider in the system is a newer version than the one the app uses. NSFileProviderErrorNewerExtensionVersionFound NSFileProviderErrorCode = -2004 // NSFileProviderErrorNoSuchItem: An error indicating that the specified item doesn’t exist. NSFileProviderErrorNoSuchItem NSFileProviderErrorCode = -1005 // NSFileProviderErrorNonEvictable: An error indicating that the File Provider extension can’t evict an item. NSFileProviderErrorNonEvictable NSFileProviderErrorCode = -2008 // NSFileProviderErrorNonEvictableChildren: An error indicating that the File Provider extension can’t evict a directory because it contains nonevictable items. NSFileProviderErrorNonEvictableChildren NSFileProviderErrorCode = -2006 // NSFileProviderErrorNotAuthenticated: An error indicating that you can’t verify the user’s credentials. NSFileProviderErrorNotAuthenticated NSFileProviderErrorCode = -1000 // NSFileProviderErrorOlderExtensionVersionRunning: An error indicating that the registered provider in the system is an older version than the one the app uses. NSFileProviderErrorOlderExtensionVersionRunning NSFileProviderErrorCode = -2003 // NSFileProviderErrorPageExpired: An error indicating that the page is too old, and that the system must restart the enumeration operation from the beginning. NSFileProviderErrorPageExpired NSFileProviderErrorCode = -1002 // NSFileProviderErrorProviderDomainNotFound: An error indicating that there isn’t a registered domain for the corresponding identifier. NSFileProviderErrorProviderDomainNotFound NSFileProviderErrorCode = -2013 NSFileProviderErrorProviderDomainTemporarilyUnavailable NSFileProviderErrorCode = -2012 // NSFileProviderErrorProviderNotFound: An error indicating that the File Provider manager can’t find the specified provider. NSFileProviderErrorProviderNotFound NSFileProviderErrorCode = -2001 // NSFileProviderErrorProviderTranslocated: An error indicating the File Provider extension is in a disabled state due to Gatekeeper’s restrictions for apps from outside the App Store. NSFileProviderErrorProviderTranslocated NSFileProviderErrorCode = -2002 // NSFileProviderErrorServerUnreachable: An error indicating that the File Provider extension can’t reach the remote server. NSFileProviderErrorServerUnreachable NSFileProviderErrorCode = -1004 // NSFileProviderErrorSyncAnchorExpired: An error indicating that the sync anchor is too old, and that the system must restart the sync operation from the beginning. NSFileProviderErrorSyncAnchorExpired NSFileProviderErrorCode = -1002 // NSFileProviderErrorUnsyncedEdits: An error indicating that the item contains unsynced changes. NSFileProviderErrorUnsyncedEdits NSFileProviderErrorCode = -2007 // NSFileProviderErrorVersionNoLongerAvailable: An error indicating that the specified version is no longer available. NSFileProviderErrorVersionNoLongerAvailable NSFileProviderErrorCode = -2009 )
func (NSFileProviderErrorCode) String ¶
func (e NSFileProviderErrorCode) String() string
type NSFileProviderExtensionActionIdentifier ¶
type NSFileProviderExtensionActionIdentifier = string
NSFileProviderExtensionActionIdentifier is an identifier for custom actions.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderExtensionActionIdentifier
type NSFileProviderExternalVolumeHandling ¶
type NSFileProviderExternalVolumeHandling interface {
objectivec.IObject
// Determines whether to connect to a domain from another device.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderExternalVolumeHandling/shouldConnectExternalDomain(completionHandler:)
ShouldConnectExternalDomainWithCompletionHandler(completionHandler ErrorHandler)
}
A protocol that defines the interface for handling external volumes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderExternalVolumeHandling
type NSFileProviderExternalVolumeHandlingObject ¶
type NSFileProviderExternalVolumeHandlingObject struct {
objectivec.Object
}
NSFileProviderExternalVolumeHandlingObject wraps an existing Objective-C object that conforms to the NSFileProviderExternalVolumeHandling protocol.
func NSFileProviderExternalVolumeHandlingObjectFromID ¶
func NSFileProviderExternalVolumeHandlingObjectFromID(id objc.ID) NSFileProviderExternalVolumeHandlingObject
NSFileProviderExternalVolumeHandlingObjectFromID constructs a NSFileProviderExternalVolumeHandlingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderExternalVolumeHandlingObject) BaseObject ¶
func (o NSFileProviderExternalVolumeHandlingObject) BaseObject() objectivec.Object
func (NSFileProviderExternalVolumeHandlingObject) ShouldConnectExternalDomainWithCompletionHandler ¶
func (o NSFileProviderExternalVolumeHandlingObject) ShouldConnectExternalDomainWithCompletionHandler(completionHandler ErrorHandler)
Determines whether to connect to a domain from another device.
type NSFileProviderFetchContentsOptions ¶
type NSFileProviderFetchContentsOptions uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderFetchContentsOptions
const ( // NSFileProviderFetchContentsOptionsStrictVersioning: An option that indicates the system requires an exact match of the requested item’s version. NSFileProviderFetchContentsOptionsStrictVersioning NSFileProviderFetchContentsOptions = 1 )
func (NSFileProviderFetchContentsOptions) String ¶
func (e NSFileProviderFetchContentsOptions) String() string
type NSFileProviderFileSystemFlags ¶
type NSFileProviderFileSystemFlags uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderFileSystemFlags
const ( // NSFileProviderFileSystemHidden: By default, the system hides the item when the user views the file system. NSFileProviderFileSystemHidden NSFileProviderFileSystemFlags = 8 // NSFileProviderFileSystemPathExtensionHidden: By default, the system hides the item’s extension when showing its filename. NSFileProviderFileSystemPathExtensionHidden NSFileProviderFileSystemFlags = 16 // NSFileProviderFileSystemUserExecutable: The user can execute the item. NSFileProviderFileSystemUserExecutable NSFileProviderFileSystemFlags = 1 // NSFileProviderFileSystemUserReadable: The user can read the item. NSFileProviderFileSystemUserReadable NSFileProviderFileSystemFlags = 2 // NSFileProviderFileSystemUserWritable: The user can modify the item. NSFileProviderFileSystemUserWritable NSFileProviderFileSystemFlags = 4 )
func (NSFileProviderFileSystemFlags) String ¶
func (e NSFileProviderFileSystemFlags) String() string
type NSFileProviderIncrementalContentFetching ¶
type NSFileProviderIncrementalContentFetching interface {
objectivec.IObject
// Asks the file provider for an update of the specified item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderIncrementalContentFetching/fetchContents(for:version:usingExistingContentsAt:existingVersion:request:completionHandler:)
FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, existingContents foundation.NSURL, existingVersion INSFileProviderItemVersion, request INSFileProviderRequest, completionHandler URLFileProviderItemErrorHandler) foundation.Progress
}
Support for fetching changes to the item’s content.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderIncrementalContentFetching
type NSFileProviderIncrementalContentFetchingObject ¶
type NSFileProviderIncrementalContentFetchingObject struct {
objectivec.Object
}
NSFileProviderIncrementalContentFetchingObject wraps an existing Objective-C object that conforms to the NSFileProviderIncrementalContentFetching protocol.
func NSFileProviderIncrementalContentFetchingObjectFromID ¶
func NSFileProviderIncrementalContentFetchingObjectFromID(id objc.ID) NSFileProviderIncrementalContentFetchingObject
NSFileProviderIncrementalContentFetchingObjectFromID constructs a NSFileProviderIncrementalContentFetchingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderIncrementalContentFetchingObject) BaseObject ¶
func (o NSFileProviderIncrementalContentFetchingObject) BaseObject() objectivec.Object
func (NSFileProviderIncrementalContentFetchingObject) FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler ¶
func (o NSFileProviderIncrementalContentFetchingObject) FetchContentsForItemWithIdentifierVersionUsingExistingContentsAtURLExistingVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, existingContents foundation.NSURL, existingVersion INSFileProviderItemVersion, request INSFileProviderRequest, completionHandler URLFileProviderItemErrorHandler) foundation.Progress
Asks the file provider for an update of the specified item.
itemIdentifier: The identifier of the item this method should fetch from your remote server.
requestedVersion: The new version. If this value is set, you must fetch the specified version, or fail with an error. If this value isn’t set, fetch the most recent version from your server.
existingContents: A URL that points to the content of the currently cached item.
existingVersion: The version of the currently cached item.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after downloading the update. Pass the following parameters:
`fileContents`: A URL that points to the new contents, or `nil` if an error occurs. `item`: The item’s identifier, or `nil` if an error occurs. The item’s version must match the version of the content passed to the `fileContents` parameter. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks the extension’s progress.
Discussion ¶
Implement this method to optimize downloading changes. Rather than downloading an entire new copy of the item, you can download just the changes from your remote storage.
The system can call this method when it has already cached an item and learns that a new version is available. It passes a copy of the locally stored item to the method. In your implementation of the method, download any updates, apply them to the existing content, and then pass the updated version to the completion handler.
type NSFileProviderItem ¶
type NSFileProviderItem interface {
objectivec.IObject
// The item’s persistent identifier.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// The item’s filename.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/filename
Filename() string
// The item’s Uniform Type Identifier (UTI).
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/typeIdentifier
TypeIdentifier() string
// The item’s Uniform Type Identifier (UTI).
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentType
ContentType() uniformtypeidentifiers.UTType
// The item’s capabilities.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/capabilities
Capabilities() NSFileProviderItemCapabilities
// The number of items contained by this item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/childItemCount
ChildItemCount() foundation.NSNumber
// The document’s size, in bytes.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/documentSize
DocumentSize() foundation.NSNumber
// contentPolicy protocol.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentPolicy
ContentPolicy() NSFileProviderContentPolicy
// The persistent identifier of the item’s parent folder.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/parentItemIdentifier
ParentItemIdentifier() NSFileProviderItemIdentifier
// A Boolean value that indicates whether an item is in the trash.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isTrashed
IsTrashed() bool
// The target of the symlink.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/symlinkTargetPath
SymlinkTargetPath() string
// The date the item was last modified.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentModificationDate
ContentModificationDate() foundation.NSDate
// The date the item was created.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/creationDate
CreationDate() foundation.NSDate
// The date the item was last used.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/lastUsedDate
LastUsedDate() foundation.NSDate
// A version object that tracks changes to an item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/itemVersion
ItemVersion() INSFileProviderItemVersion
// A data value used to determine when the item changes.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/versionIdentifier
VersionIdentifier() foundation.NSData
// A Boolean value that indicates whether the item is the most recent version downloaded from the server.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isMostRecentVersionDownloaded
IsMostRecentVersionDownloaded() bool
// A Boolean value that indicates whether the item is currently uploading to your remote server.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isUploading
IsUploading() bool
// A Boolean value that indicates whether the item has been uploaded to your remote server.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isUploaded
IsUploaded() bool
// An object describing an error that occurred while uploading the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/uploadingError
UploadingError() foundation.NSError
// A Boolean value that indicates whether the item is currently downloading from your remote server.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isDownloading
IsDownloading() bool
// A Boolean value that indicates whether the item has been downloaded from your remote server.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isDownloaded
IsDownloaded() bool
// An object describing an error that occurred while downloading the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/downloadingError
DownloadingError() foundation.NSError
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isShared
IsShared() bool
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isSharedByCurrentUser
IsSharedByCurrentUser() bool
// The most recent editor’s name.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/mostRecentEditorNameComponents
MostRecentEditorNameComponents() foundation.NSPersonNameComponents
// The name of the item’s owner.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/ownerNameComponents
OwnerNameComponents() foundation.NSPersonNameComponents
// The extended file attributes synced by the File Provider extension.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/extendedAttributes
ExtendedAttributes() foundation.INSDictionary
// Flags that define an item’s on-disk properties and its appearance in the user interface.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/fileSystemFlags
FileSystemFlags() NSFileProviderFileSystemFlags
// An abstract data blob representing the tags associated with the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/tagData
TagData() foundation.NSData
// A property list that contains additional data about the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/userInfo
UserInfo() foundation.INSDictionary
// A 64-bit, unsigned integer indicating the order of the favorite item in the Favorites list.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/favoriteRank
FavoriteRank() foundation.NSNumber
// The file type and creator codes for the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/typeAndCreator
TypeAndCreator() NSFileProviderTypeAndCreator
}
A protocol that defines the properties of an item managed by the File Provider extension.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol
type NSFileProviderItemCapabilities ¶
type NSFileProviderItemCapabilities uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemCapabilities
const ( // NSFileProviderItemCapabilitiesAllowsAddingSubItems: A value indicating that the user can add subitems. NSFileProviderItemCapabilitiesAllowsAddingSubItems NSFileProviderItemCapabilities = 2 // NSFileProviderItemCapabilitiesAllowsContentEnumerating: A value indicating that the item’s contents can be enumerated. NSFileProviderItemCapabilitiesAllowsContentEnumerating NSFileProviderItemCapabilities = 1 // NSFileProviderItemCapabilitiesAllowsDeleting: A value indicating that the item can be deleted. NSFileProviderItemCapabilitiesAllowsDeleting NSFileProviderItemCapabilities = 32 // NSFileProviderItemCapabilitiesAllowsExcludingFromSync: A value indicating that the user can exclude the item from sync operations. NSFileProviderItemCapabilitiesAllowsExcludingFromSync NSFileProviderItemCapabilities = 128 // NSFileProviderItemCapabilitiesAllowsReading: A value indicating that the value can be read from. NSFileProviderItemCapabilitiesAllowsReading NSFileProviderItemCapabilities = 1 // NSFileProviderItemCapabilitiesAllowsRenaming: A value indicating that the item can be renamed. NSFileProviderItemCapabilitiesAllowsRenaming NSFileProviderItemCapabilities = 8 // NSFileProviderItemCapabilitiesAllowsReparenting: A value indicating that the item can be moved. NSFileProviderItemCapabilitiesAllowsReparenting NSFileProviderItemCapabilities = 4 // NSFileProviderItemCapabilitiesAllowsTrashing: A value indicating that the item can be moved to the trash. NSFileProviderItemCapabilitiesAllowsTrashing NSFileProviderItemCapabilities = 16 // NSFileProviderItemCapabilitiesAllowsWriting: A value indicating that the item can be written to. NSFileProviderItemCapabilitiesAllowsWriting NSFileProviderItemCapabilities = 2 // Deprecated. NSFileProviderItemCapabilitiesAllowsAll NSFileProviderItemCapabilities = 63 // Deprecated. NSFileProviderItemCapabilitiesAllowsEvicting NSFileProviderItemCapabilities = 64 )
func (NSFileProviderItemCapabilities) String ¶
func (e NSFileProviderItemCapabilities) String() string
type NSFileProviderItemDecorating ¶
type NSFileProviderItemDecorating interface {
objectivec.IObject
// Asks the item for an array of decorations.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemDecorating/decorations
Decorations() []string
}
Support for decorating items.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemDecorating
type NSFileProviderItemDecoratingObject ¶
type NSFileProviderItemDecoratingObject struct {
objectivec.Object
}
NSFileProviderItemDecoratingObject wraps an existing Objective-C object that conforms to the NSFileProviderItemDecorating protocol.
func NSFileProviderItemDecoratingObjectFromID ¶
func NSFileProviderItemDecoratingObjectFromID(id objc.ID) NSFileProviderItemDecoratingObject
NSFileProviderItemDecoratingObjectFromID constructs a NSFileProviderItemDecoratingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderItemDecoratingObject) BaseObject ¶
func (o NSFileProviderItemDecoratingObject) BaseObject() objectivec.Object
func (NSFileProviderItemDecoratingObject) Decorations ¶
func (o NSFileProviderItemDecoratingObject) Decorations() []string
Asks the item for an array of decorations.
Discussion ¶
The system calls this method to request the item’s decorations. Your implementation should return an array of NSFileProviderItemDecorationIdentifier instances.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemDecorating/decorations
type NSFileProviderItemDecorationIdentifier ¶
type NSFileProviderItemDecorationIdentifier = string
NSFileProviderItemDecorationIdentifier is a decoration identifier defined in the File Provider extension’s information property list.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemDecorationIdentifier
type NSFileProviderItemFields ¶
type NSFileProviderItemFields uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemFields
const ( // NSFileProviderItemContentModificationDate: The item’s modification date. NSFileProviderItemContentModificationDate NSFileProviderItemFields = 128 // NSFileProviderItemContents: The item’s content. NSFileProviderItemContents NSFileProviderItemFields = 1 // NSFileProviderItemCreationDate: The item’s creation date. NSFileProviderItemCreationDate NSFileProviderItemFields = 64 // NSFileProviderItemExtendedAttributes: The item’s extended attributes. NSFileProviderItemExtendedAttributes NSFileProviderItemFields = 512 // NSFileProviderItemFavoriteRank: The item’s favorite rank. NSFileProviderItemFavoriteRank NSFileProviderItemFields = 32 // NSFileProviderItemFileSystemFlags: The flags describing the item’s on-disk representation. NSFileProviderItemFileSystemFlags NSFileProviderItemFields = 256 // NSFileProviderItemFilename: The item’s filename. NSFileProviderItemFilename NSFileProviderItemFields = 2 // NSFileProviderItemLastUsedDate: The date the item was last used. NSFileProviderItemLastUsedDate NSFileProviderItemFields = 8 // NSFileProviderItemParentItemIdentifier: The identity of the directory that contains the item. NSFileProviderItemParentItemIdentifier NSFileProviderItemFields = 4 // NSFileProviderItemTagData: The tags for the item. NSFileProviderItemTagData NSFileProviderItemFields = 16 // NSFileProviderItemTypeAndCreator: The file type and creator codes for the item. NSFileProviderItemTypeAndCreator NSFileProviderItemFields = 1024 )
func (NSFileProviderItemFields) String ¶
func (e NSFileProviderItemFields) String() string
type NSFileProviderItemIdentifier ¶
type NSFileProviderItemIdentifier = string
NSFileProviderItemIdentifier is a unique identifier for an item managed by the File Provider extension.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemIdentifier
var ( // FileProviderRootContainerItemIdentifier is the persistent identifier for the root directory of the file provider’s shared file hierarchy. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemIdentifier/rootContainer FileProviderRootContainerItemIdentifier NSFileProviderItemIdentifier // FileProviderTrashContainerItemIdentifier is the persistent identifier for the parent of all trashed items. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemIdentifier/trashContainer FileProviderTrashContainerItemIdentifier NSFileProviderItemIdentifier // FileProviderWorkingSetContainerItemIdentifier is the persistent identifier representing the working set of documents and directories. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemIdentifier/workingSet FileProviderWorkingSetContainerItemIdentifier NSFileProviderItemIdentifier )
type NSFileProviderItemObject ¶
type NSFileProviderItemObject struct {
objectivec.Object
}
NSFileProviderItemObject wraps an existing Objective-C object that conforms to the NSFileProviderItem protocol.
func NSFileProviderItemObjectFromID ¶
func NSFileProviderItemObjectFromID(id objc.ID) NSFileProviderItemObject
NSFileProviderItemObjectFromID constructs a NSFileProviderItemObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderItemObject) BaseObject ¶
func (o NSFileProviderItemObject) BaseObject() objectivec.Object
func (NSFileProviderItemObject) Capabilities ¶
func (o NSFileProviderItemObject) Capabilities() NSFileProviderItemCapabilities
The item’s capabilities.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/capabilities
func (NSFileProviderItemObject) ChildItemCount ¶
func (o NSFileProviderItemObject) ChildItemCount() foundation.NSNumber
The number of items contained by this item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/childItemCount
func (NSFileProviderItemObject) ContentModificationDate ¶
func (o NSFileProviderItemObject) ContentModificationDate() foundation.NSDate
The date the item was last modified.
func (NSFileProviderItemObject) ContentPolicy ¶
func (o NSFileProviderItemObject) ContentPolicy() NSFileProviderContentPolicy
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentPolicy
func (NSFileProviderItemObject) ContentType ¶
func (o NSFileProviderItemObject) ContentType() uniformtypeidentifiers.UTType
The item’s Uniform Type Identifier (UTI).
Discussion ¶
Your extension must provide either the [TypeIdentifier] or the [ContentType] property. Where possible, use the [ContentType] property. Use the [TypeIdentifier] property only in iOS 13 or earlier.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentType
func (NSFileProviderItemObject) CreationDate ¶
func (o NSFileProviderItemObject) CreationDate() foundation.NSDate
The date the item was created.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/creationDate
func (NSFileProviderItemObject) DocumentSize ¶
func (o NSFileProviderItemObject) DocumentSize() foundation.NSNumber
The document’s size, in bytes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/documentSize
func (NSFileProviderItemObject) DownloadingError ¶
func (o NSFileProviderItemObject) DownloadingError() foundation.NSError
An object describing an error that occurred while downloading the item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/downloadingError
func (NSFileProviderItemObject) ExtendedAttributes ¶
func (o NSFileProviderItemObject) ExtendedAttributes() foundation.INSDictionary
The extended file attributes synced by the File Provider extension.
Discussion ¶
The extended file attributes are part of the item’s metadata. The system sets extended attributes on dataless files, and preserves them on files that it renders dataless. The system decides which attributes to sync. To sync an attribute, it calls the `xattr_name_with_flags(_:_:)` method and passes the `XATTR_FLAG_SYNCABLE` flag. Some older attributes are also synced.
The system caps the syncable extended attributes to about 32KiB total for each item. If the extended attributes exceed this limit, the system automatically makes some of the attributes nonsyncable.
The system also decides which nonsyncable attributes it preserves on the local copy when a remote item changes. For example, it preserves attributes created by calling `xattr_name_with_flags(_:_:)` and passing `XATTR_FLAG_CONTENT_DEPENDENT` as long as the remote change didn’t modify the NSFileProviderItemVersion.ContentVersion property for the item’s version.
This dictionary doesn’t list extended attributes that are already covered by NSFileProviderItemFields values, like NSFileProviderItemLastUsedDate or NSFileProviderItemTagData. Similarly, the dictionary doesn’t include the 32 bits of Finder info stored in an extended attribute named `com.Apple().FinderInfo`, because this information exists in other NSFileProviderItem properties.
Also, the resource fork is content and isn’t included in the extended attributes dictionary. If your extension detects remote changes to the resource fork, report these changes by modifying the item version’s NSFileProviderItemVersion.ContentVersion property.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/extendedAttributes
func (NSFileProviderItemObject) FavoriteRank ¶
func (o NSFileProviderItemObject) FavoriteRank() foundation.NSNumber
A 64-bit, unsigned integer indicating the order of the favorite item in the Favorites list.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/favoriteRank
func (NSFileProviderItemObject) FileSystemFlags ¶
func (o NSFileProviderItemObject) FileSystemFlags() NSFileProviderFileSystemFlags
Flags that define an item’s on-disk properties and its appearance in the user interface.
Discussion ¶
The flags define the on-disk properties of the item. The system modifies the item’s appearance based on these flags.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/fileSystemFlags
func (NSFileProviderItemObject) Filename ¶
func (o NSFileProviderItemObject) Filename() string
The item’s filename.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/filename
func (NSFileProviderItemObject) IsDownloaded ¶
func (o NSFileProviderItemObject) IsDownloaded() bool
A Boolean value that indicates whether the item has been downloaded from your remote server.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isDownloaded
func (NSFileProviderItemObject) IsDownloading ¶
func (o NSFileProviderItemObject) IsDownloading() bool
A Boolean value that indicates whether the item is currently downloading from your remote server.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isDownloading
func (NSFileProviderItemObject) IsMostRecentVersionDownloaded ¶
func (o NSFileProviderItemObject) IsMostRecentVersionDownloaded() bool
A Boolean value that indicates whether the item is the most recent version downloaded from the server.
func (NSFileProviderItemObject) IsShared ¶
func (o NSFileProviderItemObject) IsShared() bool
A Boolean value that indicates whether the item is shared with other users.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isShared
func (NSFileProviderItemObject) IsSharedByCurrentUser ¶
func (o NSFileProviderItemObject) IsSharedByCurrentUser() bool
A Boolean value that indicates whether the item was shared by the current user.
func (NSFileProviderItemObject) IsTrashed ¶
func (o NSFileProviderItemObject) IsTrashed() bool
A Boolean value that indicates whether an item is in the trash.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isTrashed
func (NSFileProviderItemObject) IsUploaded ¶
func (o NSFileProviderItemObject) IsUploaded() bool
A Boolean value that indicates whether the item has been uploaded to your remote server.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isUploaded
func (NSFileProviderItemObject) IsUploading ¶
func (o NSFileProviderItemObject) IsUploading() bool
A Boolean value that indicates whether the item is currently uploading to your remote server.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isUploading
func (NSFileProviderItemObject) ItemIdentifier ¶
func (o NSFileProviderItemObject) ItemIdentifier() NSFileProviderItemIdentifier
The item’s persistent identifier.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/itemIdentifier
func (NSFileProviderItemObject) ItemVersion ¶
func (o NSFileProviderItemObject) ItemVersion() INSFileProviderItemVersion
A version object that tracks changes to an item.
Discussion ¶
The version object lets you track changes to an item’s content and metadata separately. Updating the version also invalidates the thumbnail cache. For more information, see NSFileProviderItemVersion.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/itemVersion
func (NSFileProviderItemObject) LastUsedDate ¶
func (o NSFileProviderItemObject) LastUsedDate() foundation.NSDate
The date the item was last used.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/lastUsedDate
func (NSFileProviderItemObject) MostRecentEditorNameComponents ¶
func (o NSFileProviderItemObject) MostRecentEditorNameComponents() foundation.NSPersonNameComponents
The most recent editor’s name.
func (NSFileProviderItemObject) OwnerNameComponents ¶
func (o NSFileProviderItemObject) OwnerNameComponents() foundation.NSPersonNameComponents
The name of the item’s owner.
func (NSFileProviderItemObject) ParentItemIdentifier ¶
func (o NSFileProviderItemObject) ParentItemIdentifier() NSFileProviderItemIdentifier
The persistent identifier of the item’s parent folder.
func (NSFileProviderItemObject) SymlinkTargetPath ¶
func (o NSFileProviderItemObject) SymlinkTargetPath() string
The target of the symlink.
Discussion ¶
If the extension contains an item with a [TypeIdentifier] of `public.Symlink()` (`kUTTypeSymLink`), this property contains the symlink’s target. Otherwise, it’s `nil`.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/symlinkTargetPath
func (NSFileProviderItemObject) TagData ¶
func (o NSFileProviderItemObject) TagData() foundation.NSData
An abstract data blob representing the tags associated with the item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/tagData
func (NSFileProviderItemObject) TypeAndCreator ¶
func (o NSFileProviderItemObject) TypeAndCreator() NSFileProviderTypeAndCreator
The file type and creator codes for the item.
Discussion ¶
This property contains two values: the file type code and the creator code. The system synchronizes both codes at the same time, so define both, even if you’re just changing one.
If you modify this property, the system sets the NSFileProviderTypeAndCreator value passed to the [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] or [ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler] methods. The system also writes the type and creator codes in the [FileInfo] structure, if relevant.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/typeAndCreator
func (NSFileProviderItemObject) TypeIdentifier ¶
func (o NSFileProviderItemObject) TypeIdentifier() string
The item’s Uniform Type Identifier (UTI).
Discussion ¶
Your extension must provide either the [TypeIdentifier] or the [ContentType] property. Use the [TypeIdentifier] property only in iOS 13 or earlier.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/typeIdentifier
func (NSFileProviderItemObject) UploadingError ¶
func (o NSFileProviderItemObject) UploadingError() foundation.NSError
An object describing an error that occurred while uploading the item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/uploadingError
func (NSFileProviderItemObject) UserInfo ¶
func (o NSFileProviderItemObject) UserInfo() foundation.INSDictionary
A property list that contains additional data about the item.
Discussion ¶
The `userInfo` data is often used by the predicate for actions defined by the File Provider UI extension. For more information, see `Adding Actions to the Context Menu`.
The `userInfo` dictionary can only accept entries with numbers (including Boolean values), dates, or strings as either the key or the value.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/userInfo
func (NSFileProviderItemObject) VersionIdentifier ¶
func (o NSFileProviderItemObject) VersionIdentifier() foundation.NSData
A data value used to determine when the item changes.
Discussion ¶
This property contains a data object that can uniquely identify each version of the item; for example, the hash of a document’s contents.
Version identifiers are limited to 1000 bytes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/versionIdentifier
type NSFileProviderItemVersion ¶
type NSFileProviderItemVersion struct {
objectivec.Object
}
The version of the item’s content and its metadata.
Overview ¶
Each item has a separate version object for its metadata and its content. As a result, the file provider can update an item’s metadata without uploading or downloading a new copy of its content.
Creating Version Instances ¶
- NSFileProviderItemVersion.InitWithContentVersionMetadataVersion: Creates a new version object.
Accessing Version Data ¶
- NSFileProviderItemVersion.ContentVersion: An opaque object used to track versions of the item’s content.
- NSFileProviderItemVersion.MetadataVersion: An opaque object used to track versions of the item’s metadata.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion
func NSFileProviderItemVersionFromID ¶
func NSFileProviderItemVersionFromID(id objc.ID) NSFileProviderItemVersion
NSFileProviderItemVersionFromID constructs a NSFileProviderItemVersion from an objc.ID.
The version of the item’s content and its metadata.
func NewFileProviderItemVersionWithContentVersionMetadataVersion ¶
func NewFileProviderItemVersionWithContentVersionMetadataVersion(contentVersion foundation.NSData, metadataVersion foundation.NSData) NSFileProviderItemVersion
Creates a new version object.
contentVersion: An opaque version object for the item’s content.
metadataVersion: An opaque version object for the item’s metadata.
func NewNSFileProviderItemVersion ¶
func NewNSFileProviderItemVersion() NSFileProviderItemVersion
NewNSFileProviderItemVersion creates a new NSFileProviderItemVersion instance.
func (NSFileProviderItemVersion) Autorelease ¶
func (f NSFileProviderItemVersion) Autorelease() NSFileProviderItemVersion
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderItemVersion) ContentVersion ¶
func (f NSFileProviderItemVersion) ContentVersion() foundation.NSData
An opaque object used to track versions of the item’s content.
Discussion ¶
If the system stores a local copy of an item’s content, it downloads a new copy when the NSFileProviderItemVersion.ContentVersion changes. The content version also invalidates the system’s thumbnail cache.
The system considers the file’s resource fork part of the file’s content. The version changes when either the data fork or the resource fork changes.
The version data object must be no longer than 128 bytes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion/contentVersion
func (NSFileProviderItemVersion) Init ¶
func (f NSFileProviderItemVersion) Init() NSFileProviderItemVersion
Init initializes the instance.
func (NSFileProviderItemVersion) InitWithContentVersionMetadataVersion ¶
func (f NSFileProviderItemVersion) InitWithContentVersionMetadataVersion(contentVersion foundation.NSData, metadataVersion foundation.NSData) NSFileProviderItemVersion
Creates a new version object.
contentVersion: An opaque version object for the item’s content.
metadataVersion: An opaque version object for the item’s metadata.
func (NSFileProviderItemVersion) MetadataVersion ¶
func (f NSFileProviderItemVersion) MetadataVersion() foundation.NSData
An opaque object used to track versions of the item’s metadata.
Discussion ¶
When the NSFileProviderItemVersion.MetadataVersion changes, system updates the dataless representation of the item on disk, but it doesn’t attempt to download the content.
The version data object must be no longer than 128 bytes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion/metadataVersion
type NSFileProviderItemVersionClass ¶
type NSFileProviderItemVersionClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderItemVersionClass ¶
func GetNSFileProviderItemVersionClass() NSFileProviderItemVersionClass
GetNSFileProviderItemVersionClass returns the class object for NSFileProviderItemVersion.
func (NSFileProviderItemVersionClass) Alloc ¶
func (nc NSFileProviderItemVersionClass) Alloc() NSFileProviderItemVersion
Alloc allocates memory for a new instance of the class.
func (NSFileProviderItemVersionClass) BeforeFirstSyncComponent ¶
func (_NSFileProviderItemVersionClass NSFileProviderItemVersionClass) BeforeFirstSyncComponent() foundation.NSData
A Boolean value indicating that this version predates the version returned by the file provider extension.
Discussion ¶
The system uses this property to represent an item that doesn’t have a corresponding version provided by the file provider extension.
When creating an item by calling the [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] method, if your file provider extension returns an item that doesn’t match the template, the system tries to apply the necessary changes before saving the item to disk. However, if the system detects conflicts with the version on disk, it sends the new item back to your file provider extension by calling either the [ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler] of [DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler] methods with a `baseVersion` property that represents the item passed to the [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] method.
func (NSFileProviderItemVersionClass) Class ¶
func (nc NSFileProviderItemVersionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderKnownFolderLocation ¶
type NSFileProviderKnownFolderLocation struct {
objectivec.Object
}
Initializers ¶
- NSFileProviderKnownFolderLocation.InitWithExistingItemIdentifier: Initialize a location with the item identifier of a folder that already exists on the server.
- NSFileProviderKnownFolderLocation.InitWithParentItemIdentifierFilename: Initialize a location with the filename of the folder in a specified parent.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location
func NSFileProviderKnownFolderLocationFromID ¶
func NSFileProviderKnownFolderLocationFromID(id objc.ID) NSFileProviderKnownFolderLocation
NSFileProviderKnownFolderLocationFromID constructs a NSFileProviderKnownFolderLocation from an objc.ID.
func NewFileProviderKnownFolderLocationWithExistingItemIdentifier ¶
func NewFileProviderKnownFolderLocationWithExistingItemIdentifier(existingItemIdentifier NSFileProviderItemIdentifier) NSFileProviderKnownFolderLocation
Initialize a location with the item identifier of a folder that already exists on the server.
Discussion ¶
If the known folder already exists on the server, the provider can specify the exact identifier of the item that needs to be used to back the known folder.
func NewFileProviderKnownFolderLocationWithParentItemIdentifierFilename ¶
func NewFileProviderKnownFolderLocationWithParentItemIdentifierFilename(parentItemIdentifier NSFileProviderItemIdentifier, filename string) NSFileProviderKnownFolderLocation
Initialize a location with the filename of the folder in a specified parent.
Discussion ¶
When replicating a known folder the system will reuse a folder located at the specified filename within the parent if one exists, or create a new item at this location if none exists yet.
func NewNSFileProviderKnownFolderLocation ¶
func NewNSFileProviderKnownFolderLocation() NSFileProviderKnownFolderLocation
NewNSFileProviderKnownFolderLocation creates a new NSFileProviderKnownFolderLocation instance.
func (NSFileProviderKnownFolderLocation) Autorelease ¶
func (f NSFileProviderKnownFolderLocation) Autorelease() NSFileProviderKnownFolderLocation
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderKnownFolderLocation) Init ¶
func (f NSFileProviderKnownFolderLocation) Init() NSFileProviderKnownFolderLocation
Init initializes the instance.
func (NSFileProviderKnownFolderLocation) InitWithExistingItemIdentifier ¶
func (f NSFileProviderKnownFolderLocation) InitWithExistingItemIdentifier(existingItemIdentifier NSFileProviderItemIdentifier) NSFileProviderKnownFolderLocation
Initialize a location with the item identifier of a folder that already exists on the server.
Discussion ¶
If the known folder already exists on the server, the provider can specify the exact identifier of the item that needs to be used to back the known folder.
func (NSFileProviderKnownFolderLocation) InitWithParentItemIdentifierFilename ¶
func (f NSFileProviderKnownFolderLocation) InitWithParentItemIdentifierFilename(parentItemIdentifier NSFileProviderItemIdentifier, filename string) NSFileProviderKnownFolderLocation
Initialize a location with the filename of the folder in a specified parent.
Discussion ¶
When replicating a known folder the system will reuse a folder located at the specified filename within the parent if one exists, or create a new item at this location if none exists yet.
type NSFileProviderKnownFolderLocationClass ¶
type NSFileProviderKnownFolderLocationClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderKnownFolderLocationClass ¶
func GetNSFileProviderKnownFolderLocationClass() NSFileProviderKnownFolderLocationClass
GetNSFileProviderKnownFolderLocationClass returns the class object for NSFileProviderKnownFolderLocation.
func (NSFileProviderKnownFolderLocationClass) Alloc ¶
func (nc NSFileProviderKnownFolderLocationClass) Alloc() NSFileProviderKnownFolderLocation
Alloc allocates memory for a new instance of the class.
func (NSFileProviderKnownFolderLocationClass) Class ¶
func (nc NSFileProviderKnownFolderLocationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderKnownFolderLocations ¶
type NSFileProviderKnownFolderLocations struct {
objectivec.Object
}
A class for working with known-folder locations.
Identifying known-folder locations ¶
- NSFileProviderKnownFolderLocations.DesktopLocation
- NSFileProviderKnownFolderLocations.SetDesktopLocation
- NSFileProviderKnownFolderLocations.DocumentsLocation
- NSFileProviderKnownFolderLocations.SetDocumentsLocation
Configuring folder options ¶
- NSFileProviderKnownFolderLocations.ShouldCreateBinaryCompatibilitySymlink
- NSFileProviderKnownFolderLocations.SetShouldCreateBinaryCompatibilitySymlink
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations
func NSFileProviderKnownFolderLocationsFromID ¶
func NSFileProviderKnownFolderLocationsFromID(id objc.ID) NSFileProviderKnownFolderLocations
NSFileProviderKnownFolderLocationsFromID constructs a NSFileProviderKnownFolderLocations from an objc.ID.
A class for working with known-folder locations.
func NewNSFileProviderKnownFolderLocations ¶
func NewNSFileProviderKnownFolderLocations() NSFileProviderKnownFolderLocations
NewNSFileProviderKnownFolderLocations creates a new NSFileProviderKnownFolderLocations instance.
func (NSFileProviderKnownFolderLocations) Autorelease ¶
func (f NSFileProviderKnownFolderLocations) Autorelease() NSFileProviderKnownFolderLocations
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderKnownFolderLocations) DesktopLocation ¶
func (f NSFileProviderKnownFolderLocations) DesktopLocation() INSFileProviderKnownFolderLocation
func (NSFileProviderKnownFolderLocations) DocumentsLocation ¶
func (f NSFileProviderKnownFolderLocations) DocumentsLocation() INSFileProviderKnownFolderLocation
func (NSFileProviderKnownFolderLocations) Init ¶
func (f NSFileProviderKnownFolderLocations) Init() NSFileProviderKnownFolderLocations
Init initializes the instance.
func (NSFileProviderKnownFolderLocations) SetDesktopLocation ¶
func (f NSFileProviderKnownFolderLocations) SetDesktopLocation(value INSFileProviderKnownFolderLocation)
func (NSFileProviderKnownFolderLocations) SetDocumentsLocation ¶
func (f NSFileProviderKnownFolderLocations) SetDocumentsLocation(value INSFileProviderKnownFolderLocation)
func (NSFileProviderKnownFolderLocations) SetShouldCreateBinaryCompatibilitySymlink ¶
func (f NSFileProviderKnownFolderLocations) SetShouldCreateBinaryCompatibilitySymlink(value bool)
func (NSFileProviderKnownFolderLocations) ShouldCreateBinaryCompatibilitySymlink ¶
func (f NSFileProviderKnownFolderLocations) ShouldCreateBinaryCompatibilitySymlink() bool
type NSFileProviderKnownFolderLocationsClass ¶
type NSFileProviderKnownFolderLocationsClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderKnownFolderLocationsClass ¶
func GetNSFileProviderKnownFolderLocationsClass() NSFileProviderKnownFolderLocationsClass
GetNSFileProviderKnownFolderLocationsClass returns the class object for NSFileProviderKnownFolderLocations.
func (NSFileProviderKnownFolderLocationsClass) Alloc ¶
func (nc NSFileProviderKnownFolderLocationsClass) Alloc() NSFileProviderKnownFolderLocations
Alloc allocates memory for a new instance of the class.
func (NSFileProviderKnownFolderLocationsClass) Class ¶
func (nc NSFileProviderKnownFolderLocationsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderKnownFolderSupporting ¶
type NSFileProviderKnownFolderSupporting interface {
objectivec.IObject
// Requests suitable locations for known folders.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderSupporting/getKnownFolderLocations(_:completionHandler:)
GetKnownFolderLocationsCompletionHandler(knownFolders NSFileProviderKnownFolders, completionHandler FileProviderKnownFolderLocationsErrorHandler)
}
A protocol that defines the interface for sharing known-folder locations with the system.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderSupporting
type NSFileProviderKnownFolderSupportingObject ¶
type NSFileProviderKnownFolderSupportingObject struct {
objectivec.Object
}
NSFileProviderKnownFolderSupportingObject wraps an existing Objective-C object that conforms to the NSFileProviderKnownFolderSupporting protocol.
func NSFileProviderKnownFolderSupportingObjectFromID ¶
func NSFileProviderKnownFolderSupportingObjectFromID(id objc.ID) NSFileProviderKnownFolderSupportingObject
NSFileProviderKnownFolderSupportingObjectFromID constructs a NSFileProviderKnownFolderSupportingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderKnownFolderSupportingObject) BaseObject ¶
func (o NSFileProviderKnownFolderSupportingObject) BaseObject() objectivec.Object
func (NSFileProviderKnownFolderSupportingObject) GetKnownFolderLocationsCompletionHandler ¶
func (o NSFileProviderKnownFolderSupportingObject) GetKnownFolderLocationsCompletionHandler(knownFolders NSFileProviderKnownFolders, completionHandler FileProviderKnownFolderLocationsErrorHandler)
Requests suitable locations for known folders.
type NSFileProviderKnownFolders ¶
type NSFileProviderKnownFolders uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolders
const ( NSFileProviderDesktop NSFileProviderKnownFolders = 1 NSFileProviderDocuments NSFileProviderKnownFolders = 2 )
func (NSFileProviderKnownFolders) String ¶
func (e NSFileProviderKnownFolders) String() string
type NSFileProviderManager ¶
type NSFileProviderManager struct {
objectivec.Object
}
A manager object that you use to communicate with the file provider from either your app or your File Provider extension.
Translating user-visible URLs ¶
- NSFileProviderManager.GetUserVisibleURLForItemIdentifierCompletionHandler: Returns the user-visible URL for an item.
Working with items ¶
- NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler: Tells the system to reimport the item and its content recursively.
- NSFileProviderManager.EvictItemWithIdentifierCompletionHandler: Asks the system to remove an item from its cache.
- NSFileProviderManager.RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler
- NSFileProviderManager.EnumeratorForMaterializedItems: Returns an enumerator for all the items the system currently stores on disk.
- NSFileProviderManager.EnumeratorForPendingItems: Returns an enumerator for the set of pending items.
Performing actions ¶
- NSFileProviderManager.RegisterURLSessionTaskForItemWithIdentifierCompletionHandler: Registers the URL session task responsible for the specified item.
- NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler: Alerts the system to changes in the specified folder’s content.
- NSFileProviderManager.WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler: Requests a notification after the system completes all the specified changes.
- NSFileProviderManager.GlobalProgressForKind: Returns a progress object that tracks either the uploading or downloading of items from the File Provider extension’s remote storage.
Working with domains ¶
- NSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler: Disconnects the domain from the extension.
- NSFileProviderManager.ReconnectWithCompletionHandler: Reconnects the domain with the extension.
- NSFileProviderManager.WaitForStabilizationWithCompletionHandler: Requests a notification after the domain stabilizes.
- NSFileProviderManager.TemporaryDirectoryURLWithError: Returns the URL of a directory that the File Provider extension can use to temporarily store files before passing them to the system.
Syncing Desktop and Documents folders ¶
- NSFileProviderManager.ClaimKnownFoldersLocalizedReasonCompletionHandler: Asks the domain to sync the specified known folders.
- NSFileProviderManager.ReleaseKnownFoldersLocalizedReasonCompletionHandler: Asks the system to stop replicating the specified known folders in the domain.
Working with external volumes ¶
- NSFileProviderManager.StateDirectoryURLWithError: Returns a URL for a directory for storing state information for the domain.
Using services ¶
Testing ¶
- NSFileProviderManager.ListAvailableTestingOperationsWithError: Lists all the operations that are ready for scheduling.
- NSFileProviderManager.RunTestingOperationsError: Asks the system to schedule and execute the specified operations.
Handling errors ¶
- NSFileProviderManager.SignalErrorResolvedCompletionHandler: Indicates a resolved error.
Collecting diagnostic reports ¶
- NSFileProviderManager.RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler: Requests a diagnostics collection for use when working directly with Apple to improve sync behavior.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager
func NSFileProviderManagerFromID ¶
func NSFileProviderManagerFromID(id objc.ID) NSFileProviderManager
NSFileProviderManagerFromID constructs a NSFileProviderManager from an objc.ID.
A manager object that you use to communicate with the file provider from either your app or your File Provider extension.
func NewFileProviderManagerForDomain ¶
func NewFileProviderManagerForDomain(domain INSFileProviderDomain) NSFileProviderManager
Returns a newly created file provider manager for the specified domain.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/init(for:)
func NewNSFileProviderManager ¶
func NewNSFileProviderManager() NSFileProviderManager
NewNSFileProviderManager creates a new NSFileProviderManager instance.
func (NSFileProviderManager) Autorelease ¶
func (f NSFileProviderManager) Autorelease() NSFileProviderManager
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderManager) ClaimKnownFoldersLocalizedReason ¶
func (f NSFileProviderManager) ClaimKnownFoldersLocalizedReason(ctx context.Context, knownFolders INSFileProviderKnownFolderLocations, localizedReason string) error
ClaimKnownFoldersLocalizedReason is a synchronous wrapper around NSFileProviderManager.ClaimKnownFoldersLocalizedReasonCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) ClaimKnownFoldersLocalizedReasonCompletionHandler ¶
func (f NSFileProviderManager) ClaimKnownFoldersLocalizedReasonCompletionHandler(knownFolders INSFileProviderKnownFolderLocations, localizedReason string, completionHandler ErrorHandler)
Asks the domain to sync the specified known folders.
Discussion ¶
Use this method to claim a set of known folders according to the information in the `knownFolders` parameter. The system only enables sync for these folders in the domain if the set of locations is valid and if the user agrees.
func (NSFileProviderManager) DisconnectWithReasonOptions ¶
func (f NSFileProviderManager) DisconnectWithReasonOptions(ctx context.Context, localizedReason string, options NSFileProviderManagerDisconnectionOptions) error
DisconnectWithReasonOptions is a synchronous wrapper around NSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) DisconnectWithReasonOptionsCompletionHandler ¶
func (f NSFileProviderManager) DisconnectWithReasonOptionsCompletionHandler(localizedReason string, options NSFileProviderManagerDisconnectionOptions, completionHandler ErrorHandler)
Disconnects the domain from the extension.
localizedReason: A localized string that describes the reason for disconnecting the domain.
options: Options for the disconnection. For a complete list of valid options, see NSFileProviderManager.DisconnectionOptions.
completionHandler: A block that the system calls after disconnecting the domain. The block takes the following parameter:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Call this method to disconnect the domain from the extension. While the domain is disconnected, the user can continue to browse its content, but the extension no longer receives updates about changes.
Call the NSFileProviderManager.ReconnectWithCompletionHandler method to reconnect the domain.
func (NSFileProviderManager) EnumeratorForMaterializedItems ¶
func (f NSFileProviderManager) EnumeratorForMaterializedItems() NSFileProviderEnumerator
Returns an enumerator for all the items the system currently stores on disk.
Discussion ¶
In most cases, the system requests an enumerator from the File Provider. The file provider creates the enumerator, and uses it to pass information back to the system. In this case, however, the roles are reversed. The File Provider extension calls this method to request an enumerator from the system. The system then creates the enumerator and uses it to pass the list of items currently stored on disk back to the File Provider extension.
func (NSFileProviderManager) EnumeratorForPendingItems ¶
func (f NSFileProviderManager) EnumeratorForPendingItems() NSFileProviderPendingSetEnumerator
Returns an enumerator for the set of pending items.
Discussion ¶
When the set of pending items changes, the system calls [PendingItemsDidChangeWithCompletionHandler].
func (NSFileProviderManager) EvictItemWithIdentifier ¶
func (f NSFileProviderManager) EvictItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
EvictItemWithIdentifier is a synchronous wrapper around NSFileProviderManager.EvictItemWithIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) EvictItemWithIdentifierCompletionHandler ¶
func (f NSFileProviderManager) EvictItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
Asks the system to remove an item from its cache.
itemIdentifier: The item’s identifier.
completionHandler: A block that the system calls after removing the item from disk. The system passes the following parameter:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Calling this method turns a materialized item into a dataless item to free up disk space. For more information on materialized and dataless items, see Synchronizing the File Provider Extension.
If the item is a document without local changes, this method deletes the local copy of the item’s content. If the item has local changes, it fails with an NSFileWriteNoPermissionError error.
When called on a directory, the system recursively evicts the directory’s content. It deletes the content of any materialized files, and recursively evicts any subdirectories. After it has successfully evicted all the content, it deletes its list of the directory’s content, making the directory dataless. The next time the system accesses the directory, it requests a list of the contents using the NSFileProviderEnumerating protocol.
If the system encounters a nonevictable child, eviction stops immediately, and the system calls the completion handler with a NSFileProviderError.Code.nonEvictableChildren error. The error includes information about the nonevictable child in its underlyingErrors property. The system may have evicted other materialized items, based on the traversal order.
The system calls the completion handler after it successfully evicts all items, or immediately when an error occurs. Eviction might fail with the following errors:
- NSFileProviderError.Code.unsyncedEdits if the item had nonuploaded changes. - NSFileProviderError.Code.nonEvictable if the user has marked the item as nonevictable. - [EBUSY] if the item has open file descriptors on it. - [EMLINK] if the item has too many hardlinks. - Other NSPOSIXErrorDomain error codes if the system can’t access or manipulate the corresponding file.
func (NSFileProviderManager) GetServiceWithNameItemIdentifier ¶
func (f NSFileProviderManager) GetServiceWithNameItemIdentifier(ctx context.Context, serviceName foundation.NSFileProviderServiceName, itemIdentifier NSFileProviderItemIdentifier) (*foundation.NSFileProviderService, error)
GetServiceWithNameItemIdentifier is a synchronous wrapper around NSFileProviderManager.GetServiceWithNameItemIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) GetServiceWithNameItemIdentifierCompletionHandler ¶
func (f NSFileProviderManager) GetServiceWithNameItemIdentifierCompletionHandler(serviceName foundation.NSFileProviderServiceName, itemIdentifier NSFileProviderItemIdentifier, completionHandler FileProviderServiceErrorHandler)
Discussion ¶
func (NSFileProviderManager) GetUserVisibleURLForItemIdentifier ¶
func (f NSFileProviderManager) GetUserVisibleURLForItemIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) (*foundation.NSURL, error)
GetUserVisibleURLForItemIdentifier is a synchronous wrapper around NSFileProviderManager.GetUserVisibleURLForItemIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) GetUserVisibleURLForItemIdentifierCompletionHandler ¶
func (f NSFileProviderManager) GetUserVisibleURLForItemIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler URLErrorHandler)
Returns the user-visible URL for an item.
itemIdentifier: The item’s identifier.
completionHandler: A block that the system calls after determining the item’s URL. The system passes the following parameters:
`userVisibleFile`: The URL of the user visible file, or `nil` if an error occurs. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Calling this method marks the process so that accessing the URL won’t materialize the item. Instead, any attempt to read or write to an unmaterialized item fails with a EDEADLK POSIX error.
func (NSFileProviderManager) GlobalProgressForKind ¶
func (f NSFileProviderManager) GlobalProgressForKind(kind foundation.NSProgressFileOperationKind) foundation.Progress
Returns a progress object that tracks either the uploading or downloading of items from the File Provider extension’s remote storage.
kind: The kind of operation. This method only accepts two values: uploading and downloading.
Discussion ¶
The returned progress instance tracks ongoing operations. This method supports two kinds of operations:
uploading: Uploading items from the local storage to the remote storage. downloading: Downloading items from the remote storage to the local storage.
The progress instance has its fileOperationKind property set. It also provides the number of items to upload or download, the number of bytes already transferred, and the total number of bytes to transfer. The grand total is reset to `0` when there are no operations left.
If new matching operations begin while the progress instance is running, it adds the new operations to the existing data. By default, when there are no matching operations, the progress has its values set to `1` and its state set to finished.
The system updates the progress instance on the main queue. You must retain the progress item, and observe its changes through key-value observing. For more information, see `Using Key-Value Observing in Swift`.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/globalProgress(for:)
func (NSFileProviderManager) Init ¶
func (f NSFileProviderManager) Init() NSFileProviderManager
Init initializes the instance.
func (NSFileProviderManager) ListAvailableTestingOperationsWithError ¶
func (f NSFileProviderManager) ListAvailableTestingOperationsWithError() ([]objectivec.IObject, error)
Lists all the operations that are ready for scheduling.
Discussion ¶
The system waits for all the pending disk and working set updates before returning the list of available operations. The operations that it returns may become invalid if the system receives new events, or when you schedule and execute operations using the NSFileProviderManager.RunTestingOperationsError method.
func (NSFileProviderManager) Reconnect ¶
func (f NSFileProviderManager) Reconnect(ctx context.Context) error
Reconnect is a synchronous wrapper around NSFileProviderManager.ReconnectWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) ReconnectWithCompletionHandler ¶
func (f NSFileProviderManager) ReconnectWithCompletionHandler(completionHandler ErrorHandler)
Reconnects the domain with the extension.
completionHandler: A block that the system calls after reconnecting the domain. The block takes the following parameter:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Call this method to reconnect the domain after a call to the NSFileProviderManager.DisconnectWithReasonOptionsCompletionHandler method.
func (NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifier ¶
func (f NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifier(ctx context.Context, task foundation.NSURLSessionTask, identifier NSFileProviderItemIdentifier) error
RegisterURLSessionTaskForItemWithIdentifier is a synchronous wrapper around NSFileProviderManager.RegisterURLSessionTaskForItemWithIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifierCompletionHandler ¶
func (f NSFileProviderManager) RegisterURLSessionTaskForItemWithIdentifierCompletionHandler(task foundation.NSURLSessionTask, identifier NSFileProviderItemIdentifier, completion ErrorHandler)
Registers the URL session task responsible for the specified item.
Discussion ¶
func (NSFileProviderManager) ReimportItemsBelowItemWithIdentifier ¶
func (f NSFileProviderManager) ReimportItemsBelowItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
ReimportItemsBelowItemWithIdentifier is a synchronous wrapper around NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) ReimportItemsBelowItemWithIdentifierCompletionHandler ¶
func (f NSFileProviderManager) ReimportItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
Tells the system to reimport the item and its content recursively.
itemIdentifier: The identifier of the item to reimport. The system reimports the item and all of its children.
completionHandler: A block called by the system immediately after receiving the request. The completion handler takes the following parameters:
error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
This method tells the system that the specified item identifiers are no longer valid. Your file provider extension should call this method if it has lost track of its synchronization state and can’t guarantee the stability of the item identifiers anymore.
The system calls [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] and passes the NSFileProviderCreateItemMayAlreadyExist option for each affected identifier in its working set. Your File Provider extension can then specify a new identifier for each item.
The system then calls [ImportDidFinishWithCompletionHandler] when the import is complete. If successful, the system always reimports the specified subtree, but it may reimport other items as well. If the item specified by the `itemIdentifier` parameter has no on-disk representation, the method fails with an NSFileProviderError.Code.noSuchItem error.
If your file provider loses synchronization but is still able to guarantee the stability of the identifiers, you don’t need to reimport the items. Instead, if the system queries the working set with an anchor that predates the synchronization loss, your File Provider extension can fail with an NSFileProviderError.Code.syncAnchorExpired error.
If your file provider loses synchronization, but you aren’t interested in preserving the local data, you can resolve the issue by removing and then adding the domain back.
func (NSFileProviderManager) ReleaseKnownFoldersLocalizedReason ¶
func (f NSFileProviderManager) ReleaseKnownFoldersLocalizedReason(ctx context.Context, knownFolders NSFileProviderKnownFolders, localizedReason string) error
ReleaseKnownFoldersLocalizedReason is a synchronous wrapper around NSFileProviderManager.ReleaseKnownFoldersLocalizedReasonCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) ReleaseKnownFoldersLocalizedReasonCompletionHandler ¶
func (f NSFileProviderManager) ReleaseKnownFoldersLocalizedReasonCompletionHandler(knownFolders NSFileProviderKnownFolders, localizedReason string, completionHandler ErrorHandler)
Asks the system to stop replicating the specified known folders in the domain.
Discussion ¶
Use this method to immediately disable replication of the specified known folders.
func (NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReason ¶
func (f NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReason(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier, errorReason foundation.NSError) error
RequestDiagnosticCollectionForItemWithIdentifierErrorReason is a synchronous wrapper around NSFileProviderManager.RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler ¶
func (f NSFileProviderManager) RequestDiagnosticCollectionForItemWithIdentifierErrorReasonCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, errorReason foundation.NSError, completionHandler ErrorHandler)
Requests a diagnostics collection for use when working directly with Apple to improve sync behavior.
itemIdentifier: The item that failed to sync.
errorReason: An error instance that indicates why the sync failed. If you use a Swift Error, the system coerces it to an NSError and uses only the domain and code.
completionHandler: A block or closure that executes after the system processes the diagnostic collection request. The completion handler receives an error parameter, which is non-`nil` if an error prevented collection of diagnostics. In Swift, you can omit the completion handler and instead use a `do`-`catch` block to handle the thrown error.
Discussion ¶
Calling this method requests that the system prompt the person using the app, who may be experiencing an issue with sync in your provider. It asks their permission to collect and send diagnostic information to Apple for further analysis. Even if the person gives their approval, however, the prompt or the diagnostic collection might not occur, depending on system state and other throttling parameters.
When calling this method, use the `errorReason` parameter to describe the error that prompted the request for diagnostics. The system doesn’t show this error to the person using the app. Instead, the error appears in any generated reports created from the diagnostics.
The system may or may not allow the request, and the method call returns normally in either case. It produces an error — thrown in Swift and sent to the completion handler in Objective-C — if any of the following occur:
- The app isn’t running on a pre-release build. - The app is running on a pre-release build, but the system can’t find the item indicated by the `itemIdentifier` parameter.
func (NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptions ¶
func (f NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptions(ctx context.Context, fields NSFileProviderItemFields, itemIdentifier NSFileProviderItemIdentifier, options NSFileProviderModifyItemOptions) error
RequestModificationOfFieldsForItemWithIdentifierOptions is a synchronous wrapper around NSFileProviderManager.RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler ¶
func (f NSFileProviderManager) RequestModificationOfFieldsForItemWithIdentifierOptionsCompletionHandler(fields NSFileProviderItemFields, itemIdentifier NSFileProviderItemIdentifier, options NSFileProviderModifyItemOptions, completionHandler ErrorHandler)
Discussion ¶
func (NSFileProviderManager) RunTestingOperationsError ¶
func (f NSFileProviderManager) RunTestingOperationsError(operations []objectivec.IObject) (foundation.INSDictionary, error)
Asks the system to schedule and execute the specified operations.
operations: An array of operations. Populate this array with one or more operations returned by the NSFileProviderManager.ListAvailableTestingOperationsWithError method.
Discussion ¶
The system waits until all of the specified operations complete and reports an error for any operations that fail.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/run(_:)
func (NSFileProviderManager) SignalEnumeratorForContainerItemIdentifier ¶
func (f NSFileProviderManager) SignalEnumeratorForContainerItemIdentifier(ctx context.Context, containerItemIdentifier NSFileProviderItemIdentifier) error
SignalEnumeratorForContainerItemIdentifier is a synchronous wrapper around NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) SignalEnumeratorForContainerItemIdentifierCompletionHandler ¶
func (f NSFileProviderManager) SignalEnumeratorForContainerItemIdentifierCompletionHandler(containerItemIdentifier NSFileProviderItemIdentifier, completion ErrorHandler)
Alerts the system to changes in the specified folder’s content.
Discussion ¶
func (NSFileProviderManager) SignalErrorResolved ¶
func (f NSFileProviderManager) SignalErrorResolved(ctx context.Context, error_ foundation.NSError) error
SignalErrorResolved is a synchronous wrapper around NSFileProviderManager.SignalErrorResolvedCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) SignalErrorResolvedCompletionHandler ¶
func (f NSFileProviderManager) SignalErrorResolvedCompletionHandler(error_ foundation.NSError, completionHandler ErrorHandler)
Indicates a resolved error.
error: The original error.
completionHandler: A block that the system calls after resuming the action that triggered the original error. The block takes the following parameters:
error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Use this method if any of your extension’s actions fail because of an NSFileProviderError.Code.notAuthenticated, NSFileProviderError.Code.insufficientQuota, or NSFileProviderError.Code.serverUnreachable error. As soon as you resolve the underlying error, call this method to tell the system to retry the original action.
func (NSFileProviderManager) StateDirectoryURLWithError ¶
func (f NSFileProviderManager) StateDirectoryURLWithError() (foundation.NSURL, error)
Returns a URL for a directory for storing state information for the domain.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/stateDirectoryURL()
func (NSFileProviderManager) TemporaryDirectoryURLWithError ¶
func (f NSFileProviderManager) TemporaryDirectoryURLWithError() (foundation.NSURL, error)
Returns the URL of a directory that the File Provider extension can use to temporarily store files before passing them to the system.
Discussion ¶
The system guarantees that the temporary URL refers to a directory on the same volume as the user-visible URL so that the system can automatically clone or move files between the temporary URL and the user-visible URL. For example, the File Provider extension can use the temporary directory to store content passed to the [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] or [ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler] methods.
When you implement your File Provider extension’s [FetchContentsForItemWithIdentifierVersionRequestCompletionHandler] method, the URL you pass to the completion handler must be on the same volume as the temporary directory, so the system can clone it to provide the content for the dataless item.
This method fails if the system can’t find a suitable directory, for example, if the domain doesn’t exist. However, it can’t fail if the file provider has an active instance for the specified domain.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/temporaryDirectoryURL()
func (NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifier ¶
func (f NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifier(ctx context.Context, itemIdentifier NSFileProviderItemIdentifier) error
WaitForChangesOnItemsBelowItemWithIdentifier is a synchronous wrapper around NSFileProviderManager.WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler ¶
func (f NSFileProviderManager) WaitForChangesOnItemsBelowItemWithIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler)
Requests a notification after the system completes all the specified changes.
itemIdentifier: The item’s identifier.
completionHandler: A block that the system calls after all the changes are complete. The block takes the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
This method waits for all the changes to the item’s descendants to complete before calling the completion handler. If an error occurs during this process, the system immediately passes the error to the completion handler, and you can’t assume all the changes have completed.
If the `itemIdentifier` property doesn’t refer to a directory, this method immediately calls the completion handler.
func (NSFileProviderManager) WaitForStabilization ¶
func (f NSFileProviderManager) WaitForStabilization(ctx context.Context) error
WaitForStabilization is a synchronous wrapper around NSFileProviderManager.WaitForStabilizationWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManager) WaitForStabilizationWithCompletionHandler ¶
func (f NSFileProviderManager) WaitForStabilizationWithCompletionHandler(completionHandler ErrorHandler)
Requests a notification after the domain stabilizes.
completionHandler: A block that the system calls after pending changes to both the file system and the provider have completed. The system passes the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Use this method to enforce a consistent state for testing. The system calls the completion handler after all the pending changes to the local cache and the remote storage have completed. The system waits on any changes that requested before the call to NSFileProviderManager.WaitForStabilizationWithCompletionHandler, but which haven’t completed yet.
type NSFileProviderManagerClass ¶
type NSFileProviderManagerClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderManagerClass ¶
func GetNSFileProviderManagerClass() NSFileProviderManagerClass
GetNSFileProviderManagerClass returns the class object for NSFileProviderManager.
func (NSFileProviderManagerClass) AddDomain ¶
func (fc NSFileProviderManagerClass) AddDomain(ctx context.Context, domain INSFileProviderDomain) error
AddDomain is a synchronous wrapper around [NSFileProviderManager.AddDomainCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) AddDomainCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) AddDomainCompletionHandler(domain INSFileProviderDomain, completionHandler ErrorHandler)
Adds a domain to the File Provider extension.
Discussion ¶
func (NSFileProviderManagerClass) Alloc ¶
func (nc NSFileProviderManagerClass) Alloc() NSFileProviderManager
Alloc allocates memory for a new instance of the class.
func (NSFileProviderManagerClass) Class ¶
func (nc NSFileProviderManagerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (NSFileProviderManagerClass) GetDomains ¶
func (fc NSFileProviderManagerClass) GetDomains(ctx context.Context) ([]NSFileProviderDomain, error)
GetDomains is a synchronous wrapper around [NSFileProviderManager.GetDomainsWithCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) GetDomainsWithCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) GetDomainsWithCompletionHandler(completionHandler NSFileProviderDomainArrayErrorHandler)
Returns all of the File Provider extension’s domains.
Discussion ¶
func (NSFileProviderManagerClass) GetIdentifierForUserVisibleFileAtURLCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) GetIdentifierForUserVisibleFileAtURLCompletionHandler(url foundation.NSURL, completionHandler StringStringErrorHandler)
Returns the identifier and domain for a user-visible URL.
url: The URL of the item.
completionHandler: A block that the system calls after it gets the items identifier. It has the following parameters:
`itemIdentifier`: The item’s identifier. `domainIdentifier`: The identifier for the item’s domain. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
If the URL doesn’t refer to an item managed by your File Provider extension, the system returns a NSFileNoSuchFileError error.
func (NSFileProviderManagerClass) ImportDomainFromDirectoryAtURL ¶
func (fc NSFileProviderManagerClass) ImportDomainFromDirectoryAtURL(ctx context.Context, domain INSFileProviderDomain, url foundation.NSURL) error
ImportDomainFromDirectoryAtURL is a synchronous wrapper around [NSFileProviderManager.ImportDomainFromDirectoryAtURLCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) ImportDomainFromDirectoryAtURLCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) ImportDomainFromDirectoryAtURLCompletionHandler(domain INSFileProviderDomain, url foundation.NSURL, completionHandler ErrorHandler)
Creates a new domain that takes ownership of on-disk data that your app previously managed without a file provider.
domain: The domain to import.
url: A URL that points to the directory to import.
completionHandler: A block that the system calls as soon as it creates the new domain. It takes the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
Use this method to migrate an existing file hierarchy on disk to a NSFileProviderExtension without redownloading the data. After you call the method, the provided URL is no longer valid. The system has moved and now manages all of its contents.
If a domain with the same name already exists, the method fails with an NSFileWriteFileExistsError error. The URL remains untouched. If the system doesn’t allow the extension to request a migration, the method fails with an NSFeatureUnsupportedError error.
The system starts by moving the provided directory into its local cache, and then calls the completion handler. Then, for each item in the directory, it calls your extension’s [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] with the NSFileProviderCreateItemMayAlreadyExist option.
When the import finishes, the system calls your extension’s [ImportDidFinishWithCompletionHandler] method. If you call NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler before the import finishes, the system makes a single call to [ImportDidFinishWithCompletionHandler] for both imports.
func (NSFileProviderManagerClass) RemoveAllDomains ¶
func (fc NSFileProviderManagerClass) RemoveAllDomains(ctx context.Context) error
RemoveAllDomains is a synchronous wrapper around [NSFileProviderManager.RemoveAllDomainsWithCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) RemoveAllDomainsWithCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveAllDomainsWithCompletionHandler(completionHandler ErrorHandler)
Removes all domains from the File Provider extension.
completionHandler: A block that the system calls after removing the domains. It takes the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
func (NSFileProviderManagerClass) RemoveDomain ¶
func (fc NSFileProviderManagerClass) RemoveDomain(ctx context.Context, domain INSFileProviderDomain) error
RemoveDomain is a synchronous wrapper around [NSFileProviderManager.RemoveDomainCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) RemoveDomainCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveDomainCompletionHandler(domain INSFileProviderDomain, completionHandler ErrorHandler)
Removes a domain from the File Provider extension.
domain: The domain to remove.
completionHandler: A block that the system calls after removing the domain. It takes the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
func (NSFileProviderManagerClass) RemoveDomainMode ¶
func (fc NSFileProviderManagerClass) RemoveDomainMode(ctx context.Context, domain INSFileProviderDomain, mode NSFileProviderDomainRemovalMode) (*foundation.NSURL, error)
RemoveDomainMode is a synchronous wrapper around [NSFileProviderManager.RemoveDomainModeCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (NSFileProviderManagerClass) RemoveDomainModeCompletionHandler ¶
func (_NSFileProviderManagerClass NSFileProviderManagerClass) RemoveDomainModeCompletionHandler(domain INSFileProviderDomain, mode NSFileProviderDomainRemovalMode, completionHandler URLErrorHandler)
Removes a domain from the File Provider extension using the specified options.
domain: The domain to remove.
mode: An option that determines how the system handles user data. For a complete list of options, see NSFileProviderManager.DomainRemovalMode.
completionHandler: A block that the system calls after removing the domain. It takes the following parameter:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Discussion ¶
type NSFileProviderManagerDisconnectionOptions ¶
type NSFileProviderManagerDisconnectionOptions uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/DisconnectionOptions
const ( // NSFileProviderManagerDisconnectionOptionsTemporary: A temporary disconnection. NSFileProviderManagerDisconnectionOptionsTemporary NSFileProviderManagerDisconnectionOptions = 1 )
func (NSFileProviderManagerDisconnectionOptions) String ¶
func (e NSFileProviderManagerDisconnectionOptions) String() string
type NSFileProviderMaterializationFlags ¶
type NSFileProviderMaterializationFlags uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderMaterializationFlags
const ( // NSFileProviderMaterializationFlagsKnownSparseRanges: A flag indicating that the system should consider the file fully materialized, even if it’s a sparse file. NSFileProviderMaterializationFlagsKnownSparseRanges NSFileProviderMaterializationFlags = 1 )
func (NSFileProviderMaterializationFlags) String ¶
func (e NSFileProviderMaterializationFlags) String() string
type NSFileProviderModifyItemOptions ¶
type NSFileProviderModifyItemOptions uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderModifyItemOptions
const ( // NSFileProviderModifyItemFailOnConflict: An option to fail an upload in the event of a version conflict. NSFileProviderModifyItemFailOnConflict NSFileProviderModifyItemOptions = 2 // NSFileProviderModifyItemIsImmediateUploadRequestByPresentingApplication: An option to require the upload to complete before calling the completion handler. NSFileProviderModifyItemIsImmediateUploadRequestByPresentingApplication NSFileProviderModifyItemOptions = 4 // NSFileProviderModifyItemMayAlreadyExist: An option that indicates the changes may already exist in your remote storage. NSFileProviderModifyItemMayAlreadyExist NSFileProviderModifyItemOptions = 1 )
func (NSFileProviderModifyItemOptions) String ¶
func (e NSFileProviderModifyItemOptions) String() string
type NSFileProviderPage ¶
type NSFileProviderPage = *foundation.NSData
NSFileProviderPage is a synchronization point that represents the next batch of items to be returned by an enumerator.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPage
var ( // FileProviderInitialPageSortedByDate is the initial batch of items when sorted by date. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPage/initialPageSortedByDate FileProviderInitialPageSortedByDate NSFileProviderPage // FileProviderInitialPageSortedByName is the initial batch of items when sorted by name. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPage/initialPageSortedByName FileProviderInitialPageSortedByName NSFileProviderPage )
type NSFileProviderPartialContentFetching ¶
type NSFileProviderPartialContentFetching interface {
objectivec.IObject
// Tells the file provider to download the requested item from remote storage.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPartialContentFetching/fetchPartialContents(for:version:request:minimalRange:aligningTo:options:completionHandler:)
FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, request INSFileProviderRequest, requestedRange foundation.NSRange, alignment uint, options NSFileProviderFetchContentsOptions, completionHandler URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler) foundation.Progress
}
Support for fetching part of a file’s content.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPartialContentFetching
type NSFileProviderPartialContentFetchingObject ¶
type NSFileProviderPartialContentFetchingObject struct {
objectivec.Object
}
NSFileProviderPartialContentFetchingObject wraps an existing Objective-C object that conforms to the NSFileProviderPartialContentFetching protocol.
func NSFileProviderPartialContentFetchingObjectFromID ¶
func NSFileProviderPartialContentFetchingObjectFromID(id objc.ID) NSFileProviderPartialContentFetchingObject
NSFileProviderPartialContentFetchingObjectFromID constructs a NSFileProviderPartialContentFetchingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderPartialContentFetchingObject) BaseObject ¶
func (o NSFileProviderPartialContentFetchingObject) BaseObject() objectivec.Object
func (NSFileProviderPartialContentFetchingObject) FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler ¶
func (o NSFileProviderPartialContentFetchingObject) FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, request INSFileProviderRequest, requestedRange foundation.NSRange, alignment uint, options NSFileProviderFetchContentsOptions, completionHandler URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler) foundation.Progress
Tells the file provider to download the requested item from remote storage.
itemIdentifier: The item’s identifier.
requestedVersion: The version of the item. The system always provides a specific version.
request: An object that identifies the context of that request, such as the requesting app.
requestedRange: The range given as a starting location and a length in bytes.
alignment: A system defined alignment value. The start and end of the range of data you provide must be multiples of this value. The alignment value may change across reboots; however, the system guarantees that it’s a power of two.
options: Options for the fetch range.
completionHandler: A block that you call after downloading the item from your remote storage. You pass the following parameters:
`fileContents`: A URL to the item’s contents. `item`: The downloaded item. `retrievedRange`: The range that your file provider extension is providing. This must be properly aligned, and must cover the requested range. `flags`: A flag that provides additional information about the provided content. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks the extension’s progress.
Discussion ¶
Implement this method to download a range of the specified file and pass it to the completion handler. If your file provider extension doesn’t implement this method, the system defaults to [FetchContentsForItemWithIdentifierVersionRequestCompletionHandler].
The temporary file you provide must meet the following requirements:
- The temporary file can be a sparse file with noncontiguous ranges. - You must properly align your `retrievedRange` base on the `alignment` parameter passed to this method. The starting location and length of the region you provide must be multiples of the `alignment` value. If your `retrievedRange` covers the rest of the file, then you don’t need to align the end. Just set its length based on the end of the file. - The `retrievedRange` you provide must have the same location in the temp file that it does in the original. However, the sections before or after the `retrievedRange` can be empty, sparse ranges. - Your `retrievedRange` must contain actual data with no holes, unless the original file is a sparse file, and the holes represent empty ranges in the original file. - Your `retrievedRange` must cover the entire `requestedRange`; however, it can be larger than the `requestedRange` (either starting before, or extending after the `requestedRange`). For example, you could provide the entire file, if you have a cached version handy.
The system writes your entire `retrievedRange` to the user-visible file. You can adjust the size of the `retrievedRange` to optimize read latency and reduce the amount of data downloaded by your file provider extension.
If this is the first time the system has requested the file’s content, it sets the `options` parameter to an empty set. This indicates that it’s safe to return a different version than the requested version, if necessary.
However, when updating existing files, the system sets the `options` parameter to NSFileProviderFetchContentsOptionsStrictVersioning. This prevents the system from accidentally writing mismatched pieces from different versions to the same file. If you can’t provide the requested version, pass a NSFileProviderError.Code.versionNoLongerAvailable error to the completion handler instead.
Concurrently Downloading Files ¶
By default, the system calls the [FetchPartialContentsForItemWithIdentifierVersionRequestMinimalRangeAligningToOptionsCompletionHandler] method concurrently when there are multiple outstanding requests. This can include making multiple concurrent requests for different parts of the file.
You can control concurrent requests by setting the NSExtensionFileProviderDownloadPipelineDepth key in your extension’s `Info.Plist()` file. Set the value to the number of concurrent downloads the system can create per domain. This value must be between 1 and 128.
Managing File Ownership ¶
After receiving the `fileContents`, the system clones and deletes the file. Don’t mutate the corresponding file after calling the completion handler. If your extension needs to keep a copy of the content, create a clone of the content and pass the URL of the clone as the completion handler’s `fileContents` parameter.
If the extension or system crashes after you call the completion handler but before the system deletes the file, your temporary file may remain where you saved it. In this case, your extension must delete the file.
Disallowing Downloads ¶
You can control which processes can request files. By default, the system automatically manages files based on its POSIX access control lists.
To prevent a process from accessing content from the extension’s domain, save an array of strings to the [NSFileProviderExtensionNonMaterializingProcessNames] UserDefaults key. The system won’t fetch content if the requesting process’s name matches a string in this array.
- In macOS 11.0 and later, the system checks this list when a process reads a file using POSIX filesystem calls. - In macOS 11.4 and later, the system also checks this list when a process reads a file using file coordination.
Handing Errors ¶
If the system requests an item that your file provider extension doesn’t know about, pass the NSFileProviderError.Code.noSuchItem error to the completion handler. The system then treats the item as if someone had removed the item from the domain, and it attempts to delete the file. If it can’t delete the item (for example, because the item has local changes) it recreates the item by calling your extension’s [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] method.
If the user doesn’t have access to the file, you can pass an NSFileReadNoPermissionError error to the completion handler. The system then displays that error to the user.
Your extension can also pass NSFileProviderError.Code.notAuthenticated and NSFileReadNoPermissionError errors if it can’t download the items because of the system or domain’s current state. In those cases, the system displays an error to the user, and doesn’t make another fetch request until the next time it receives an update notification about the item.
If you can’t provide the requested version for an item, provide a different version unless the system passed the NSFileProviderFetchContentsOptionsStrictVersioning key in the `options` parameter. In this case, pass a NSFileProviderError.Code.versionNoLongerAvailable error to the completion handler instead.
If your extension provides content that doesn’t match the requested version, the system detects the mismatch and treats it as a remote update. The system sends the requesting application an error, indicating that something has updated the item remotely. It then requests an updated copy of the item from your file provider.
The system considers all other errors as transient, and attempts to request the content again.
Canceling Downloads ¶
Your implementation of this method must return a Progress item that tracks your app’s progress while downloading the requested range. The system uses this item to show the progress to the user.
If the user cancels the operation, the system calls the progress item’s cancellationHandler block. Use this block to stop fetching the item, because it’s no longer required.
type NSFileProviderPendingSetEnumerator ¶
type NSFileProviderPendingSetEnumerator interface {
objectivec.IObject
NSFileProviderEnumerator
// The domain version when the system last refreshed the pending set.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator/domainVersion
DomainVersion() INSFileProviderDomainVersion
// The amount of time, in seconds, between updates to the pending set.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator/refreshInterval
RefreshInterval() foundation.NSTimeInterval
// maximumSizeReached protocol.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator/isMaximumSizeReached
IsMaximumSizeReached() bool
}
A protocol for enumerating pending items.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator
type NSFileProviderPendingSetEnumeratorObject ¶
type NSFileProviderPendingSetEnumeratorObject struct {
objectivec.Object
}
NSFileProviderPendingSetEnumeratorObject wraps an existing Objective-C object that conforms to the NSFileProviderPendingSetEnumerator protocol.
func NSFileProviderPendingSetEnumeratorObjectFromID ¶
func NSFileProviderPendingSetEnumeratorObjectFromID(id objc.ID) NSFileProviderPendingSetEnumeratorObject
NSFileProviderPendingSetEnumeratorObjectFromID constructs a NSFileProviderPendingSetEnumeratorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderPendingSetEnumeratorObject) BaseObject ¶
func (o NSFileProviderPendingSetEnumeratorObject) BaseObject() objectivec.Object
func (NSFileProviderPendingSetEnumeratorObject) CurrentSyncAnchorWithCompletionHandler ¶
func (o NSFileProviderPendingSetEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)
Returns the current sync anchor.
Discussion ¶
func (NSFileProviderPendingSetEnumeratorObject) DomainVersion ¶
func (o NSFileProviderPendingSetEnumeratorObject) DomainVersion() INSFileProviderDomainVersion
The domain version when the system last refreshed the pending set.
Discussion ¶
The system sets this property when you call the enumerator’s methods. The value is initially `nil`.
func (NSFileProviderPendingSetEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor ¶
func (o NSFileProviderPendingSetEnumeratorObject) EnumerateChangesForObserverFromSyncAnchor(observer NSFileProviderChangeObserver, syncAnchor NSFileProviderSyncAnchor)
Requests the next batch of changes after the specified sync anchor.
Discussion ¶
The system requests an enumerator in the following situations:
- For directories. The system requests an enumerator when a document browser displays the contents of a directory. For performance reasons, the system may retain the enumerator even after the browser has moved to a different directory. - For files. The system requests an enumerator when a file presenter begins managing an item. The enumerator is invalidated after the file presenter is removed. - For the working set. The system requests an enumerator when it begins indexing the working set. It invalidates the enumerator after the indexing operation has completed.
Once requested, an enumerator is used to provide both the content and any changes for an item. When the system is finished with the item, it calls the enumerator’s [Invalidate] method. For example, if you return an enumerator that provides the content of a directory, as long as the enumerator is active, the system also uses it to enumerate changes to the directory.
The system may have multiple, active enumerators for a number of different items. Some of these may represent items that are currently displayed on screen. Others may be items that are no longer displayed, but the enumerator is retained for performance reasons. You need to inform the system of any changes to the content managed by any of the active enumerators, as well as any changes to the working set (whether or not it has an active enumerator).
For more information on enumerating items, see Defining Your File Provider’s Content. For more information on tracking changes, see Tracking Your File Provider’s Changes.
func (NSFileProviderPendingSetEnumeratorObject) EnumerateItemsForObserverStartingAtPage ¶
func (o NSFileProviderPendingSetEnumeratorObject) EnumerateItemsForObserverStartingAtPage(observer NSFileProviderEnumerationObserver, page NSFileProviderPage)
Requests the next batch of items, starting at the specified page.
Discussion ¶
The system requests an enumerator in the following situations:
- For directories. The system requests an enumerator when a document browser displays the contents of a directory. For performance reasons, the system may retain the enumerator even after the browser has moved to a different directory. - For files. The system requests an enumerator when a file presenter begins managing an item. The enumerator is invalidated after the file presenter is removed. - For the working set. The system requests an enumerator when it begins indexing the working set. It invalidates the enumerator after the indexing operation has completed.
Once requested, an enumerator is used to provide both the content and any changes for an item. When the system is finished with the item, it calls the enumerator’s [Invalidate] method. For example, if you return an enumerator that provides the content of a directory, as long as the enumerator is active, the system also uses it to enumerate changes to the directory.
The system may have multiple, active enumerators for a number of different items. Some of these may represent items that are currently displayed on screen. Others may be items that are no longer displayed, but the enumerator is retained for performance reasons. You need to inform the system of any changes to the content managed by any of the active enumerators, as well as any changes to the working set (whether or not it has an active enumerator).
For more information on enumerating items, see Defining Your File Provider’s Content. For more information on tracking changes, see Tracking Your File Provider’s Changes.
func (NSFileProviderPendingSetEnumeratorObject) Invalidate ¶
func (o NSFileProviderPendingSetEnumeratorObject) Invalidate()
Stops the enumeration of items and changes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/invalidate()
func (NSFileProviderPendingSetEnumeratorObject) IsMaximumSizeReached ¶
func (o NSFileProviderPendingSetEnumeratorObject) IsMaximumSizeReached() bool
func (NSFileProviderPendingSetEnumeratorObject) RefreshInterval ¶
func (o NSFileProviderPendingSetEnumeratorObject) RefreshInterval() foundation.NSTimeInterval
The amount of time, in seconds, between updates to the pending set.
type NSFileProviderReplicatedExtension ¶
type NSFileProviderReplicatedExtension interface {
objectivec.IObject
NSFileProviderEnumerating
// Tells the file provider to perform any necessary cleanup so that the system can deallocate it.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/invalidate()
Invalidate()
// Asks the file provider for the metadata of the provided item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/item(for:request:completionHandler:)
ItemForIdentifierRequestCompletionHandler(identifier NSFileProviderItemIdentifier, request INSFileProviderRequest, completionHandler FileProviderItemErrorHandler) foundation.Progress
// Tells the file provider to download the requested item from remote storage.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/fetchContents(for:version:request:completionHandler:)
FetchContentsForItemWithIdentifierVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, request INSFileProviderRequest, completionHandler URLFileProviderItemErrorHandler) foundation.Progress
// Tells the file provider to create or import an item based on a template.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/createItem(basedOn:fields:contents:options:request:completionHandler:)
CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler(itemTemplate NSFileProviderItem, fields NSFileProviderItemFields, url foundation.NSURL, options NSFileProviderCreateItemOptions, request INSFileProviderRequest, completionHandler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) foundation.Progress
// Tells the file provider that an item’s content or metadata changed.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)
ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler(item NSFileProviderItem, version INSFileProviderItemVersion, changedFields NSFileProviderItemFields, newContents foundation.NSURL, options NSFileProviderModifyItemOptions, request INSFileProviderRequest, completionHandler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) foundation.Progress
// Tells the file provider to delete an item forever.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/deleteItem(identifier:baseVersion:options:request:completionHandler:)
DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler(identifier NSFileProviderItemIdentifier, version INSFileProviderItemVersion, options NSFileProviderDeleteItemOptions, request INSFileProviderRequest, completionHandler ErrorHandler) foundation.Progress
}
A File Provider extension in which the system replicates the contents on disk.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension
type NSFileProviderReplicatedExtensionObject ¶
type NSFileProviderReplicatedExtensionObject struct {
objectivec.Object
}
NSFileProviderReplicatedExtensionObject wraps an existing Objective-C object that conforms to the NSFileProviderReplicatedExtension protocol.
func NSFileProviderReplicatedExtensionObjectFromID ¶
func NSFileProviderReplicatedExtensionObjectFromID(id objc.ID) NSFileProviderReplicatedExtensionObject
NSFileProviderReplicatedExtensionObjectFromID constructs a NSFileProviderReplicatedExtensionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderReplicatedExtensionObject) BaseObject ¶
func (o NSFileProviderReplicatedExtensionObject) BaseObject() objectivec.Object
func (NSFileProviderReplicatedExtensionObject) CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler(itemTemplate NSFileProviderItem, fields NSFileProviderItemFields, url foundation.NSURL, options NSFileProviderCreateItemOptions, request INSFileProviderRequest, completionHandler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) foundation.Progress
Tells the file provider to create or import an item based on a template.
itemTemplate: An object that defines the state of the new or imported item.
fields: The fields that you should apply to the new or imported item.
url: If the item is a file with the NSFileProviderItemContents field set, this is the URL to the item’s content. Otherwise, it’s `nil`.
options: The item creation options.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after uploading the item to your remote storage. You pass the following parameters:
`createdItem`: The newly created item. `stillPendingFields`: Any fields that you haven’t yet applied. If you can apply all the fields at once, pass an empty [NSFileProviderItemField] instance. `shouldFetchContent`: A Boolean value that indicates whether the system should fetch the item’s content from your remote storage. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
A progress that tracks creating the item in your remote storage and uploading its content. The system automatically calls cancel() on the progress object when an error occurs.
Discussion ¶
The system calls this method when the user creates a new item or imports an item into the file provider. The system manages the local copy of the item. You’re responsible for syncing and saving the item to your remote storage.
Implement this method to create an item in your remote storage that matches the template, and then call the callback handler.
The `itemTemplate` parameter describes the item’s intended state, including:
[Filename]: The item’s name. [ContentType]: The item’s type. The item can be a file, directory, symlink, or alias. UTTypeFolder, UTTypeSymbolicLink, and UTTypeAliasFile types typically need special handling. [ParentItemIdentifier]: The item’s location.
The system sets the template’s [ItemIdentifier] to a unique value and guarantees that it remains the same for the specified item. For example, the system can reuse the identifier to replay this method after a crash.
In general, set the properties in your `createdItem` to match the `itemTemplate`. One exception is the [ItemIdentifier] property; always provide your own identifier for the item. If you reuse an existing identifier, the system replaces the local copy of the old item with the new one.
If the item is a document, fetch its contents from the `url` parameter. Otherwise, the `url` is `nil`. For symlinks, you can access the content using the template’s [SymlinkTargetPath] parameter. For both symlinks and aliases, make sure to return the correct UTI for the item, because the UTI can’t be inferred from the item’s filename.
If you are reimporting an item and the system finds a local copy without any content, it sets the NSFileProviderCreateItemMayAlreadyExist option, and sets the `url` to nil. In this case, if you can’t match the item with an existing item from remote storage, pass `nil` as the completion handler’s `createdItem` parameter. The system then deletes the local copy of the item.
If the attempt to create an item fails because the parent directory doesn’t exist, pass NSFileProviderError.Code.noSuchItem to the handler. The system attempts to create the parent directory, and then tries to create the item again.
func (NSFileProviderReplicatedExtensionObject) DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) DeleteItemWithIdentifierBaseVersionOptionsRequestCompletionHandler(identifier NSFileProviderItemIdentifier, version INSFileProviderItemVersion, options NSFileProviderDeleteItemOptions, request INSFileProviderRequest, completionHandler ErrorHandler) foundation.Progress
Tells the file provider to delete an item forever.
identifier: The identifier of the object to delete.
version: The version of the item to delete.
options: The options for deleting the item.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after deleting the item from your remote storage. You pass the following parameter:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks your extension’s progress.
Discussion ¶
The system calls this method when the user deletes an item that was already in the trash. Users can only delete items that have the NSFileProviderItemCapabilitiesAllowsDeleting capability.
Remove the item from the trash and delete it from your remote storage. If the item is in the working set, notify the system about the change by calling NSFileProviderManager.SignalEnumeratorForContainerItemIdentifierCompletionHandler and passing workingSet for the `containerItemIdentifier` parameter. If the deletion is recursive, be sure to check all the deleted items, and notify the system to any changes in the working set.
If your extension doesn’t recognize the item, you can just report success. The system then removes the local copy of the item.
func (NSFileProviderReplicatedExtensionObject) EnumeratorForContainerItemIdentifierRequestError ¶
func (o NSFileProviderReplicatedExtensionObject) EnumeratorForContainerItemIdentifierRequestError(containerItemIdentifier NSFileProviderItemIdentifier, request INSFileProviderRequest) (NSFileProviderEnumerator, error)
Tells the file provider to return an enumerator for the provided directory.
containerItemIdentifier: The item identifier for the directory.
request: An object that identifies the context of that request, such as the requesting app.
Return Value ¶
An enumerator for the specified directory.
Discussion ¶
The system calls this method to request an enumerator for the specified item.
Possible item identifiers include:
rootContainer: The system passes this identifier when the user begins browsing your file provider’s content. A directory’s [ItemIdentifier]: The system requests a new enumerator each time the user opens a new directory. workingSet: The system can request an enumerator so that it can sync the working set in the background. A document’s [ItemIdentifier]: The system subscribes to live updates by requesting an enumerator for a document. The trashContainer directory.: The system passes this identifier when the user browses the contents of the trash. If your File Provider extension doesn’t support moving items to the trash, your implementation should throw or return an error.
Your implementation should create and return an NSFileProviderEnumerator object that provides the requested content.
Handle Errors ¶
If you can’t return the requested enumerator, you must throw an error in Swift, or if you return nil in Objective-C, you must set the `error` out parameter.
If the `containerItemIdentifier` parameter is trashContainer and your extension doesn’t support trashing items, then it should fail with the NSFeatureUnsupportedError error code from the NSCocoaErrorDomain domain. Additionally, make sure the items managed by your File Provider extension don’t have the NSFileProviderItemCapabilitiesAllowsTrashing capability enabled.
If the `containerItemIdentifier` parameter doesn’t exist in your remote storage, you should fail with an NSFileProviderError.Code.noSuchItem error. The system then attempts to delete the item from disk.
If you pass NSFileProviderError.Code.notAuthenticated or NSFileProviderError.Code.serverUnreachable to the handler, the system presents an appropriate alert to the user, but doesn’t try to access the metadata until triggered again by the user.
The system considers any other errors to be transient, and automatically retries the method call.
func (NSFileProviderReplicatedExtensionObject) FetchContentsForItemWithIdentifierVersionRequestCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) FetchContentsForItemWithIdentifierVersionRequestCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, requestedVersion INSFileProviderItemVersion, request INSFileProviderRequest, completionHandler URLFileProviderItemErrorHandler) foundation.Progress
Tells the file provider to download the requested item from remote storage.
itemIdentifier: The item to fetch.
requestedVersion: The version of the item. If this is `nil`, download the latest version.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after downloading the item from your remote storage. You pass the following parameters:
`fileContents`: A URL to the item’s contents. `item`: The downloaded item. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks your extension’s progress. The system automatically calls cancel() on the progress object when an error occurs, or when the system or user cancels the download.
Discussion ¶
The system initially learns about available items through enumerations; however, the enumeration only provides the item’s metadata. When the user accesses the item, the system needs to download the full contents from your remote store. After you call the completion handler, the system takes complete control over the local copy.
If the `requestedVersion` parameter is not `nil`, you must return the specified version of the item, or return an error. If the parameter is `nil`, return a version that is the same or newer than the most recent version enumerated to the system. In either case, the NSFileProviderItemVersion.ContentVersion of the NSFileProviderItem passed to the completion handler must match the version you return.
If your extension doesn’t recognize the item, pass NSFileProviderError.Code.noSuchItem to the handler. The system assumes the item is no longer in the domain, and attempts to delete the local copy. If the delete attempt fails because the item has local changes, the system reimports the item by calling [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler].
If you pass NSFileProviderError.Code.notAuthenticated or NSFileProviderError.Code.serverUnreachable to the handler, the system presents an appropriate alert to the user, but doesn’t try to access the metadata until triggered again by the user.
If the user deletes the item before the download completes, the system calls the progress object’s cancel() method. Your file provider should stop fetching the item, and pass NSUserCancelledError to the handler.
The system considers any other errors to be transient, and automatically retries the method call.
func (NSFileProviderReplicatedExtensionObject) ImportDidFinishWithCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) ImportDidFinishWithCompletionHandler(completionHandler VoidHandler)
Tells the File Provider extension that the system finished importing items.
completionHandler: A block that your implementation must call.
Discussion ¶
The system calls this method after importing on-disk items. You can trigger an import by calling either NSFileProviderManager.ReimportItemsBelowItemWithIdentifierCompletionHandler or NSFileProviderManagerClass.ImportDomainFromDirectoryAtURLCompletionHandler. The system can also initiate its own imports as needed.
During the import, the system calls your File Provider extension’s [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler] method and passes the NSFileProviderCreateItemMayAlreadyExist option. Check to see if the item already exists in your remote storage—uploading it if necessary.
After importing all the items, the system calls your [ImportDidFinishWithCompletionHandler] method. Handle any necessary cleanup operations, and then call the completion handler.
func (NSFileProviderReplicatedExtensionObject) Invalidate ¶
func (o NSFileProviderReplicatedExtensionObject) Invalidate()
Tells the file provider to perform any necessary cleanup so that the system can deallocate it.
Discussion ¶
Your implementation should perform any necessary cleanup so that the system can dismiss and deallocate the file provider.
func (NSFileProviderReplicatedExtensionObject) ItemForIdentifierRequestCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) ItemForIdentifierRequestCompletionHandler(identifier NSFileProviderItemIdentifier, request INSFileProviderRequest, completionHandler FileProviderItemErrorHandler) foundation.Progress
Asks the file provider for the metadata of the provided item.
identifier: The item’s identifier.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after downloading the item’s metadata. The block takes the following parameters:
`item`: A new file provider item, containing all the item’s metadata. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks your extension’s progress. The system automatically calls cancel() on the progress object when an error occurs.
Discussion ¶
If your extension doesn’t recognize the item, pass NSFileProviderError.Code.noSuchItem to the handler. The system assumes the item is no longer in the domain, and attempts to delete the local copy. If the delete attempt fails because the item has local changes, the system reimports the item by calling [CreateItemBasedOnTemplateFieldsContentsOptionsRequestCompletionHandler].
If you pass NSFileProviderError.Code.notAuthenticated or NSFileProviderError.Code.serverUnreachable to the handler, the system presents an appropriate alert to the user, but doesn’t try to access the metadata until triggered again by the user.
The system considers any other errors to be transient, and automatically retries the method call.
func (NSFileProviderReplicatedExtensionObject) MaterializedItemsDidChangeWithCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) MaterializedItemsDidChangeWithCompletionHandler(completionHandler VoidHandler)
Tells the file provider that the set of materialized items changed.
completionHandler: A block that you call after you finish processing the changes.
Discussion ¶
The system calls this method when the set of materialized items changes, such as when the system downloads the content of a dataless item, or deletes the contents of a materialized item.
Keep track of the items in the working set—the set of items that the system has downloaded and is managing on disk—to optimize updates. Your file provider must let the system know about any changes to the working set. If you don’t track the working set, then you need to let the system know about any changes to any items in the remote storage.
For more information, see Synchronizing the File Provider Extension.
func (NSFileProviderReplicatedExtensionObject) ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) ModifyItemBaseVersionChangedFieldsContentsOptionsRequestCompletionHandler(item NSFileProviderItem, version INSFileProviderItemVersion, changedFields NSFileProviderItemFields, newContents foundation.NSURL, options NSFileProviderModifyItemOptions, request INSFileProviderRequest, completionHandler FileProviderItemNSFileProviderItemFieldsBoolErrorHandler) foundation.Progress
Tells the file provider that an item’s content or metadata changed.
item: The item to modify.
version: The item’s version.
changedFields: The fields that have changed.
newContents: A URL for the local copy of the item’s new contents.
options: The modification options.
request: An object that identifies the context of that request, such as the requesting app.
completionHandler: A block that you call after uploading the changes to your remote storage. You pass the following parameters:
`item`: The newly modified item. `stillPendingFields`: Any fields that you haven’t yet applied. If you can apply all the fields at once, pass an empty [NSFileProviderItemField] instance. `shouldFetchContent`: A Boolean value that indicates whether the system should fetch the item’s content from your remote storage. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks your extension’s progress.
Discussion ¶
The system calls this method when the user modifies an item—for example, moving it, renaming it, or updating its content. The `changedFields` parameter may contain multiple items, indicating that multiple changes have occurred. Update the version of the item in your remote storage to match, and then call the callback handler.
func (NSFileProviderReplicatedExtensionObject) PendingItemsDidChangeWithCompletionHandler ¶
func (o NSFileProviderReplicatedExtensionObject) PendingItemsDidChangeWithCompletionHandler(completionHandler VoidHandler)
Tells the file provider extension that the set of pending items has changed.
completionHandler: A block that you call after you finish processing the changes.
Discussion ¶
The system calls this method whenever the set of pending items changes. It updates the pending set regularly, but only when there are meaningful changes, such as:
- New items are now pending. - The system has successfully synced one or more pending items. - The domain version changed when the pending item set wasn’t empty.
To enumerate the pending set, create an object that adopts the NSFileProviderEnumerationObserver and NSFileProviderChangeObserver protocols. Then pass this item to the NSFileProviderManager.EnumeratorForPendingItems method on a NSFileProviderManager instance for your domain. The system then calls your observer object’s methods when the pending set changes.
type NSFileProviderRequest ¶
type NSFileProviderRequest struct {
objectivec.Object
}
An object that provides information about the application requesting data from the File Provider extension.
Accessing Application Information ¶
- NSFileProviderRequest.DomainVersion: The version of the domain for the request.
- NSFileProviderRequest.RequestingExecutable: The URL of the requesting executable.
- NSFileProviderRequest.IsFileViewerRequest: A Boolean value that indicates whether the request came from Finder or related system file browsers.
- NSFileProviderRequest.IsSystemRequest: A Boolean value that indicates whether the request came from a system process.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest
func NSFileProviderRequestFromID ¶
func NSFileProviderRequestFromID(id objc.ID) NSFileProviderRequest
NSFileProviderRequestFromID constructs a NSFileProviderRequest from an objc.ID.
An object that provides information about the application requesting data from the File Provider extension.
func NewNSFileProviderRequest ¶
func NewNSFileProviderRequest() NSFileProviderRequest
NewNSFileProviderRequest creates a new NSFileProviderRequest instance.
func (NSFileProviderRequest) Autorelease ¶
func (f NSFileProviderRequest) Autorelease() NSFileProviderRequest
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderRequest) DomainVersion ¶
func (f NSFileProviderRequest) DomainVersion() INSFileProviderDomainVersion
The version of the domain for the request.
Discussion ¶
If the file provider extension doesn’t implement the NSFileProviderDomainState protocol, this property is `nil`.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest/domainVersion
func (NSFileProviderRequest) Init ¶
func (f NSFileProviderRequest) Init() NSFileProviderRequest
Init initializes the instance.
func (NSFileProviderRequest) IsFileViewerRequest ¶
func (f NSFileProviderRequest) IsFileViewerRequest() bool
A Boolean value that indicates whether the request came from Finder or related system file browsers.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest/isFileViewerRequest
func (NSFileProviderRequest) IsSystemRequest ¶
func (f NSFileProviderRequest) IsSystemRequest() bool
A Boolean value that indicates whether the request came from a system process.
Discussion ¶
System requests occur, for example, when the system needs to update a file after receiving a push notification about a change from the remote storage.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest/isSystemRequest
func (NSFileProviderRequest) RequestingExecutable ¶
func (f NSFileProviderRequest) RequestingExecutable() foundation.NSURL
The URL of the requesting executable.
Discussion ¶
This property is `nil` unless the device has a Mobile Device Management (MDM) profile, and the profile’s administrator installed the file provider’s app using the MDM profile.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderRequest/requestingExecutable
type NSFileProviderRequestClass ¶
type NSFileProviderRequestClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderRequestClass ¶
func GetNSFileProviderRequestClass() NSFileProviderRequestClass
GetNSFileProviderRequestClass returns the class object for NSFileProviderRequest.
func (NSFileProviderRequestClass) Alloc ¶
func (nc NSFileProviderRequestClass) Alloc() NSFileProviderRequest
Alloc allocates memory for a new instance of the class.
func (NSFileProviderRequestClass) Class ¶
func (nc NSFileProviderRequestClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderSearchEnumerationObserver ¶
type NSFileProviderSearchEnumerationObserver interface {
objectivec.IObject
// Delivers an array of search results to the observer.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/didEnumerate(_:)
DidEnumerateSearchResults(searchResults []objectivec.IObject)
// Finish enumerating a page of results, and optionally provide a location within the results to continue the enumeration.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/finishEnumerating(upTo:)
FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
// Finishes a search enumeration by sending an error to the framework.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/finishEnumeratingWithError(_:)
FinishEnumeratingWithError(error_ foundation.NSError)
// The maximum number of results to return in a single page enumeration.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/maximumNumberOfResultsPerPage
MaximumNumberOfResultsPerPage() int
}
A protocol that defines a type that receives enumerations of search results from your extension.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver
type NSFileProviderSearchEnumerationObserverObject ¶
type NSFileProviderSearchEnumerationObserverObject struct {
objectivec.Object
}
NSFileProviderSearchEnumerationObserverObject wraps an existing Objective-C object that conforms to the NSFileProviderSearchEnumerationObserver protocol.
func NSFileProviderSearchEnumerationObserverObjectFromID ¶
func NSFileProviderSearchEnumerationObserverObjectFromID(id objc.ID) NSFileProviderSearchEnumerationObserverObject
NSFileProviderSearchEnumerationObserverObjectFromID constructs a NSFileProviderSearchEnumerationObserverObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderSearchEnumerationObserverObject) BaseObject ¶
func (o NSFileProviderSearchEnumerationObserverObject) BaseObject() objectivec.Object
func (NSFileProviderSearchEnumerationObserverObject) DidEnumerateSearchResults ¶
func (o NSFileProviderSearchEnumerationObserverObject) DidEnumerateSearchResults(searchResults []objectivec.IObject)
Delivers an array of search results to the observer.
Discussion ¶
For files stored on your server, consult search indexes on the server and use them to create an array of NSFileProviderSearchResult instances that you provide to this method.
You can call this method multiple times prior to calling [FinishEnumeratingUpToPage] or [FinishEnumeratingWithError], as long as the total number of results doesn’t exceed `NSFileProviderSearchEnumerationObserver/maxNumberOfResults`.
func (NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingUpToPage ¶
func (o NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingUpToPage(nextPage NSFileProviderPage)
Finish enumerating a page of results, and optionally provide a location within the results to continue the enumeration.
Discussion ¶
Call this method after you make one or more calls to [DidEnumerateSearchResults] to provide results to the observer. The collective results you provide in these calls constitues a “page” of results.
Finish your page before sending `NSFileProviderSearchEnumerationObserver/maxNumberOfResults`. If you have more results to provide, use the `nextPage` parameter to indicate where to continue in your result set. The system sends the `nextPage` parameter the next time it calls your [EnumerateSearchResultsForObserverStartingAtPage] method.
func (NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingWithError ¶
func (o NSFileProviderSearchEnumerationObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)
Finishes a search enumeration by sending an error to the framework.
Discussion ¶
Finishing with an error causes the system to stop requesting additional pages of results. The system doesn’t retry after you call this method. If an error is potentially recoverable, you can perform your own retry in your implementation of [EnumerateSearchResultsForObserverStartingAtPage] and continue if successful, or end the query by calling this method.
func (NSFileProviderSearchEnumerationObserverObject) MaximumNumberOfResultsPerPage ¶
func (o NSFileProviderSearchEnumerationObserverObject) MaximumNumberOfResultsPerPage() int
The maximum number of results to return in a single page enumeration.
Discussion ¶
If the extension returns more than this number of results in a single page enumeration, the system will crash the extension process.
type NSFileProviderSearchEnumerator ¶
type NSFileProviderSearchEnumerator interface {
objectivec.IObject
// Enumerates search results starting from the specified page, in response to a call from the framework.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerator/enumerateSearchResults(for:startingAt:)
EnumerateSearchResultsForObserverStartingAtPage(observer NSFileProviderSearchEnumerationObserver, page NSFileProviderPage)
// Cancels a currently-running enumeration, in respone to a call from the framework.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerator/invalidate()
Invalidate()
}
A protocol that defines methods for providing search results and canceling searches.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerator
type NSFileProviderSearchEnumeratorObject ¶
type NSFileProviderSearchEnumeratorObject struct {
objectivec.Object
}
NSFileProviderSearchEnumeratorObject wraps an existing Objective-C object that conforms to the NSFileProviderSearchEnumerator protocol.
func NSFileProviderSearchEnumeratorObjectFromID ¶
func NSFileProviderSearchEnumeratorObjectFromID(id objc.ID) NSFileProviderSearchEnumeratorObject
NSFileProviderSearchEnumeratorObjectFromID constructs a NSFileProviderSearchEnumeratorObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderSearchEnumeratorObject) BaseObject ¶
func (o NSFileProviderSearchEnumeratorObject) BaseObject() objectivec.Object
func (NSFileProviderSearchEnumeratorObject) EnumerateSearchResultsForObserverStartingAtPage ¶
func (o NSFileProviderSearchEnumeratorObject) EnumerateSearchResultsForObserverStartingAtPage(observer NSFileProviderSearchEnumerationObserver, page NSFileProviderPage)
Enumerates search results starting from the specified page, in response to a call from the framework.
observer: An NSFileProviderSearchEnumerationObserver, to which your extension provides search results.
page: An indication of a location within the search results to resume enumeration. This parameter is non-`nil` if you previously provided a `nextPage` parameter to the observer’s [FinishEnumeratingUpToPage] method. Make sure the page contains whatever information you need to resume the enumeration.
Discussion ¶
Implement this method to perform your search and deliver pages of results to `observer`.
func (NSFileProviderSearchEnumeratorObject) Invalidate ¶
func (o NSFileProviderSearchEnumeratorObject) Invalidate()
Cancels a currently-running enumeration, in respone to a call from the framework.
Discussion ¶
The framework calls this method to cancel a search if the person using the device changes their query, making the results of the current search obsolete. The framework also calls this method when it’s finished using this enumerator object.
Implement this method by canceling any outstanding requests and cleaning up resources.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerator/invalidate()
type NSFileProviderSearchResult ¶
type NSFileProviderSearchResult interface {
objectivec.IObject
// The identifier for this search result.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// The result’s file name.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/filename
Filename() string
// The result file’s creation date.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/creationDate
CreationDate() foundation.NSDate
// The result file’s content modification date.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/contentModificationDate
ContentModificationDate() foundation.NSDate
// The result file’s last-used date.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/lastUsedDate
LastUsedDate() foundation.NSDate
// The result file’s content type.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/contentType
ContentType() uniformtypeidentifiers.UTType
// The result file’s size.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/documentSize
DocumentSize() foundation.NSNumber
}
A protocol that defines properties of a search result.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult
type NSFileProviderSearchResultObject ¶
type NSFileProviderSearchResultObject struct {
objectivec.Object
}
NSFileProviderSearchResultObject wraps an existing Objective-C object that conforms to the NSFileProviderSearchResult protocol.
func NSFileProviderSearchResultObjectFromID ¶
func NSFileProviderSearchResultObjectFromID(id objc.ID) NSFileProviderSearchResultObject
NSFileProviderSearchResultObjectFromID constructs a NSFileProviderSearchResultObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderSearchResultObject) BaseObject ¶
func (o NSFileProviderSearchResultObject) BaseObject() objectivec.Object
func (NSFileProviderSearchResultObject) ContentModificationDate ¶
func (o NSFileProviderSearchResultObject) ContentModificationDate() foundation.NSDate
The result file’s content modification date.
func (NSFileProviderSearchResultObject) ContentType ¶
func (o NSFileProviderSearchResultObject) ContentType() uniformtypeidentifiers.UTType
The result file’s content type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/contentType
func (NSFileProviderSearchResultObject) CreationDate ¶
func (o NSFileProviderSearchResultObject) CreationDate() foundation.NSDate
The result file’s creation date.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/creationDate
func (NSFileProviderSearchResultObject) DocumentSize ¶
func (o NSFileProviderSearchResultObject) DocumentSize() foundation.NSNumber
The result file’s size.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/documentSize
func (NSFileProviderSearchResultObject) Filename ¶
func (o NSFileProviderSearchResultObject) Filename() string
The result’s file name.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/filename
func (NSFileProviderSearchResultObject) ItemIdentifier ¶
func (o NSFileProviderSearchResultObject) ItemIdentifier() NSFileProviderItemIdentifier
The identifier for this search result.
Discussion ¶
Choose an identifier that’s usable with API calls from the NSFileProviderReplicatedExtension protocol.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/itemIdentifier
func (NSFileProviderSearchResultObject) LastUsedDate ¶
func (o NSFileProviderSearchResultObject) LastUsedDate() foundation.NSDate
The result file’s last-used date.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/lastUsedDate
type NSFileProviderSearching ¶
type NSFileProviderSearching interface {
objectivec.IObject
// Provides an object that enumerates over search results, in response to a call from the system.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearching/searchEnumerator(for:)
SearchEnumeratorForStringSearchRequest(request INSFileProviderStringSearchRequest) NSFileProviderSearchEnumerator
}
A protocol you implement to support searching in your file provider.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearching
type NSFileProviderSearchingObject ¶
type NSFileProviderSearchingObject struct {
objectivec.Object
}
NSFileProviderSearchingObject wraps an existing Objective-C object that conforms to the NSFileProviderSearching protocol.
func NSFileProviderSearchingObjectFromID ¶
func NSFileProviderSearchingObjectFromID(id objc.ID) NSFileProviderSearchingObject
NSFileProviderSearchingObjectFromID constructs a NSFileProviderSearchingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderSearchingObject) BaseObject ¶
func (o NSFileProviderSearchingObject) BaseObject() objectivec.Object
func (NSFileProviderSearchingObject) SearchEnumeratorForStringSearchRequest ¶
func (o NSFileProviderSearchingObject) SearchEnumeratorForStringSearchRequest(request INSFileProviderStringSearchRequest) NSFileProviderSearchEnumerator
Provides an object that enumerates over search results, in response to a call from the system.
request: An NSFileProviderStringSearchRequest that contains the search query.
Return Value ¶
An NSFileProviderSearchEnumerator that you implement to provide search results to the system.
type NSFileProviderServiceSource ¶
type NSFileProviderServiceSource interface {
objectivec.IObject
// Returns an endpoint object that lets the host app communicate with the File Provider extension.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/makeListenerEndpoint()
MakeListenerEndpointAndReturnError() (foundation.NSXPCListenerEndpoint, error)
// A name that uniquely identifies the service (reverse domain name notation is recommended).
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/serviceName
ServiceName() foundation.NSFileProviderServiceName
// restricted protocol.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/isRestricted
IsRestricted() bool
}
A service that provides a custom communication channel between the host app and the File Provider extension.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource
type NSFileProviderServiceSourceObject ¶
type NSFileProviderServiceSourceObject struct {
objectivec.Object
}
NSFileProviderServiceSourceObject wraps an existing Objective-C object that conforms to the NSFileProviderServiceSource protocol.
func NSFileProviderServiceSourceObjectFromID ¶
func NSFileProviderServiceSourceObjectFromID(id objc.ID) NSFileProviderServiceSourceObject
NSFileProviderServiceSourceObjectFromID constructs a NSFileProviderServiceSourceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderServiceSourceObject) BaseObject ¶
func (o NSFileProviderServiceSourceObject) BaseObject() objectivec.Object
func (NSFileProviderServiceSourceObject) IsRestricted ¶
func (o NSFileProviderServiceSourceObject) IsRestricted() bool
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/isRestricted
func (NSFileProviderServiceSourceObject) MakeListenerEndpointAndReturnError ¶
func (o NSFileProviderServiceSourceObject) MakeListenerEndpointAndReturnError() (foundation.NSXPCListenerEndpoint, error)
Returns an endpoint object that lets the host app communicate with the File Provider extension.
func (NSFileProviderServiceSourceObject) ServiceName ¶
func (o NSFileProviderServiceSourceObject) ServiceName() foundation.NSFileProviderServiceName
A name that uniquely identifies the service (reverse domain name notation is recommended).
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/serviceName
type NSFileProviderServicing ¶
type NSFileProviderServicing interface {
objectivec.IObject
// Asks the File Provider extension for an array of custom communication channels.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServicing/supportedServiceSources(for:completionHandler:)
SupportedServiceSourcesForItemIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler) foundation.Progress
}
Support for providing a custom service source.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServicing
type NSFileProviderServicingObject ¶
type NSFileProviderServicingObject struct {
objectivec.Object
}
NSFileProviderServicingObject wraps an existing Objective-C object that conforms to the NSFileProviderServicing protocol.
func NSFileProviderServicingObjectFromID ¶
func NSFileProviderServicingObjectFromID(id objc.ID) NSFileProviderServicingObject
NSFileProviderServicingObjectFromID constructs a NSFileProviderServicingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderServicingObject) BaseObject ¶
func (o NSFileProviderServicingObject) BaseObject() objectivec.Object
func (NSFileProviderServicingObject) SupportedServiceSourcesForItemIdentifierCompletionHandler ¶
func (o NSFileProviderServicingObject) SupportedServiceSourcesForItemIdentifierCompletionHandler(itemIdentifier NSFileProviderItemIdentifier, completionHandler ErrorHandler) foundation.Progress
Asks the File Provider extension for an array of custom communication channels.
itemIdentifier: The item’s identifier.
completionHandler: A block that you call after gathering the service sources. You pass the following parameters:
serviceSources: An array of service sources that lets you communicate with the host app. error: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An item that tracks the progress of the ¶
Discussion ¶
The system calls this method when an app requests a list of supported services. Return an array of services for the specified file. An application with access to the file can request the supported services by calling the FileManager class’s getFileProviderServicesForItem(at:completionHandler:) method. For more information, see NSFileProviderService.
type NSFileProviderStringSearchRequest ¶
type NSFileProviderStringSearchRequest struct {
objectivec.Object
}
A type that contains details of a string-based search request.
Working with request properties ¶
- NSFileProviderStringSearchRequest.Query: A plaintext string, representing the query a person entered into the system search UI.
Instance Properties ¶
- NSFileProviderStringSearchRequest.DesiredNumberOfResults: How many results the system is requesting. This is a hint to the extension, to help avoid unnecessary work. The extension may return more results than this.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderStringSearchRequest
func NSFileProviderStringSearchRequestFromID ¶
func NSFileProviderStringSearchRequestFromID(id objc.ID) NSFileProviderStringSearchRequest
NSFileProviderStringSearchRequestFromID constructs a NSFileProviderStringSearchRequest from an objc.ID.
A type that contains details of a string-based search request.
func NewNSFileProviderStringSearchRequest ¶
func NewNSFileProviderStringSearchRequest() NSFileProviderStringSearchRequest
NewNSFileProviderStringSearchRequest creates a new NSFileProviderStringSearchRequest instance.
func (NSFileProviderStringSearchRequest) Autorelease ¶
func (f NSFileProviderStringSearchRequest) Autorelease() NSFileProviderStringSearchRequest
Autorelease adds the receiver to the current autorelease pool.
func (NSFileProviderStringSearchRequest) DesiredNumberOfResults ¶
func (f NSFileProviderStringSearchRequest) DesiredNumberOfResults() int
How many results the system is requesting. This is a hint to the extension, to help avoid unnecessary work. The extension may return more results than this.
func (NSFileProviderStringSearchRequest) Init ¶
func (f NSFileProviderStringSearchRequest) Init() NSFileProviderStringSearchRequest
Init initializes the instance.
func (NSFileProviderStringSearchRequest) Query ¶
func (f NSFileProviderStringSearchRequest) Query() string
A plaintext string, representing the query a person entered into the system search UI.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderStringSearchRequest/query
type NSFileProviderStringSearchRequestClass ¶
type NSFileProviderStringSearchRequestClass struct {
// contains filtered or unexported fields
}
func GetNSFileProviderStringSearchRequestClass ¶
func GetNSFileProviderStringSearchRequestClass() NSFileProviderStringSearchRequestClass
GetNSFileProviderStringSearchRequestClass returns the class object for NSFileProviderStringSearchRequest.
func (NSFileProviderStringSearchRequestClass) Alloc ¶
func (nc NSFileProviderStringSearchRequestClass) Alloc() NSFileProviderStringSearchRequest
Alloc allocates memory for a new instance of the class.
func (NSFileProviderStringSearchRequestClass) Class ¶
func (nc NSFileProviderStringSearchRequestClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type NSFileProviderSyncAnchor ¶
type NSFileProviderSyncAnchor = *foundation.NSData
NSFileProviderSyncAnchor is a synchronization point that represents the last batch of changes returned by the enumerator.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSyncAnchor
type NSFileProviderTestingChildrenEnumeration ¶
type NSFileProviderTestingChildrenEnumeration interface {
objectivec.IObject
NSFileProviderTestingOperation
// The containing identifier’s unique identifier.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingChildrenEnumeration/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// The item’s location.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingChildrenEnumeration/side
Side() NSFileProviderTestingOperationSide
}
An operation that lists a directory’s content.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingChildrenEnumeration
type NSFileProviderTestingChildrenEnumerationObject ¶
type NSFileProviderTestingChildrenEnumerationObject struct {
objectivec.Object
}
NSFileProviderTestingChildrenEnumerationObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingChildrenEnumeration protocol.
func NSFileProviderTestingChildrenEnumerationObjectFromID ¶
func NSFileProviderTestingChildrenEnumerationObjectFromID(id objc.ID) NSFileProviderTestingChildrenEnumerationObject
NSFileProviderTestingChildrenEnumerationObjectFromID constructs a NSFileProviderTestingChildrenEnumerationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingChildrenEnumerationObject) BaseObject ¶
func (o NSFileProviderTestingChildrenEnumerationObject) BaseObject() objectivec.Object
func (NSFileProviderTestingChildrenEnumerationObject) ItemIdentifier ¶
func (o NSFileProviderTestingChildrenEnumerationObject) ItemIdentifier() NSFileProviderItemIdentifier
The containing identifier’s unique identifier.
func (NSFileProviderTestingChildrenEnumerationObject) Side ¶
The item’s location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingChildrenEnumeration/side
func (NSFileProviderTestingChildrenEnumerationObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingCollisionResolution ¶
type NSFileProviderTestingCollisionResolution interface {
objectivec.IObject
NSFileProviderTestingOperation
// A description of the renamed item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCollisionResolution/renamedItem
RenamedItem() NSFileProviderItem
// The item’s location.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCollisionResolution/side
Side() NSFileProviderTestingOperationSide
}
An operation that resolves a collision by renaming the new item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCollisionResolution
type NSFileProviderTestingCollisionResolutionObject ¶
type NSFileProviderTestingCollisionResolutionObject struct {
objectivec.Object
}
NSFileProviderTestingCollisionResolutionObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingCollisionResolution protocol.
func NSFileProviderTestingCollisionResolutionObjectFromID ¶
func NSFileProviderTestingCollisionResolutionObjectFromID(id objc.ID) NSFileProviderTestingCollisionResolutionObject
NSFileProviderTestingCollisionResolutionObjectFromID constructs a NSFileProviderTestingCollisionResolutionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingCollisionResolutionObject) BaseObject ¶
func (o NSFileProviderTestingCollisionResolutionObject) BaseObject() objectivec.Object
func (NSFileProviderTestingCollisionResolutionObject) RenamedItem ¶
func (o NSFileProviderTestingCollisionResolutionObject) RenamedItem() NSFileProviderItem
A description of the renamed item.
func (NSFileProviderTestingCollisionResolutionObject) Side ¶
The item’s location.
Discussion ¶
Most operations are symmetrical. They can affect either items stored locally, or items in the File Provider extension’s remote storage.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCollisionResolution/side
func (NSFileProviderTestingCollisionResolutionObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingContentFetch ¶
type NSFileProviderTestingContentFetch interface {
objectivec.IObject
NSFileProviderTestingOperation
// The containing item’s unique identifier.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingContentFetch/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// The item’s location.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingContentFetch/side
Side() NSFileProviderTestingOperationSide
}
An operation that fetches an item’s content.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingContentFetch
type NSFileProviderTestingContentFetchObject ¶
type NSFileProviderTestingContentFetchObject struct {
objectivec.Object
}
NSFileProviderTestingContentFetchObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingContentFetch protocol.
func NSFileProviderTestingContentFetchObjectFromID ¶
func NSFileProviderTestingContentFetchObjectFromID(id objc.ID) NSFileProviderTestingContentFetchObject
NSFileProviderTestingContentFetchObjectFromID constructs a NSFileProviderTestingContentFetchObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingContentFetchObject) BaseObject ¶
func (o NSFileProviderTestingContentFetchObject) BaseObject() objectivec.Object
func (NSFileProviderTestingContentFetchObject) ItemIdentifier ¶
func (o NSFileProviderTestingContentFetchObject) ItemIdentifier() NSFileProviderItemIdentifier
The containing item’s unique identifier.
func (NSFileProviderTestingContentFetchObject) Side ¶
The item’s location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingContentFetch/side
func (NSFileProviderTestingContentFetchObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingCreation ¶
type NSFileProviderTestingCreation interface {
objectivec.IObject
NSFileProviderTestingOperation
// A description of the item stored at the source.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/sourceItem
SourceItem() NSFileProviderItem
// The target location for the new item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/targetSide
TargetSide() NSFileProviderTestingOperationSide
// The domain’s version when the system discovered the item at the source location.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/domainVersion
DomainVersion() INSFileProviderDomainVersion
}
An operation that syncs the creation of the source item to the target location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation
type NSFileProviderTestingCreationObject ¶
type NSFileProviderTestingCreationObject struct {
objectivec.Object
}
NSFileProviderTestingCreationObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingCreation protocol.
func NSFileProviderTestingCreationObjectFromID ¶
func NSFileProviderTestingCreationObjectFromID(id objc.ID) NSFileProviderTestingCreationObject
NSFileProviderTestingCreationObjectFromID constructs a NSFileProviderTestingCreationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingCreationObject) BaseObject ¶
func (o NSFileProviderTestingCreationObject) BaseObject() objectivec.Object
func (NSFileProviderTestingCreationObject) DomainVersion ¶
func (o NSFileProviderTestingCreationObject) DomainVersion() INSFileProviderDomainVersion
The domain’s version when the system discovered the item at the source location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/domainVersion
func (NSFileProviderTestingCreationObject) SourceItem ¶
func (o NSFileProviderTestingCreationObject) SourceItem() NSFileProviderItem
A description of the item stored at the source.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/sourceItem
func (NSFileProviderTestingCreationObject) TargetSide ¶
func (o NSFileProviderTestingCreationObject) TargetSide() NSFileProviderTestingOperationSide
The target location for the new item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/targetSide
func (NSFileProviderTestingCreationObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingDeletion ¶
type NSFileProviderTestingDeletion interface {
objectivec.IObject
NSFileProviderTestingOperation
// The unique identifier for the source item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/sourceItemIdentifier
SourceItemIdentifier() NSFileProviderItemIdentifier
// The target location for the delete operation.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetSide
TargetSide() NSFileProviderTestingOperationSide
// The unique identifier for the target item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetItemIdentifier
TargetItemIdentifier() NSFileProviderItemIdentifier
// The version of the deleted item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetItemBaseVersion
TargetItemBaseVersion() INSFileProviderItemVersion
// The domain’s version when the source location deleted the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/domainVersion
DomainVersion() INSFileProviderDomainVersion
}
An operation that syncs the deletion of the source item to the target location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion
type NSFileProviderTestingDeletionObject ¶
type NSFileProviderTestingDeletionObject struct {
objectivec.Object
}
NSFileProviderTestingDeletionObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingDeletion protocol.
func NSFileProviderTestingDeletionObjectFromID ¶
func NSFileProviderTestingDeletionObjectFromID(id objc.ID) NSFileProviderTestingDeletionObject
NSFileProviderTestingDeletionObjectFromID constructs a NSFileProviderTestingDeletionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingDeletionObject) BaseObject ¶
func (o NSFileProviderTestingDeletionObject) BaseObject() objectivec.Object
func (NSFileProviderTestingDeletionObject) DomainVersion ¶
func (o NSFileProviderTestingDeletionObject) DomainVersion() INSFileProviderDomainVersion
The domain’s version when the source location deleted the item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/domainVersion
func (NSFileProviderTestingDeletionObject) SourceItemIdentifier ¶
func (o NSFileProviderTestingDeletionObject) SourceItemIdentifier() NSFileProviderItemIdentifier
The unique identifier for the source item.
func (NSFileProviderTestingDeletionObject) TargetItemBaseVersion ¶
func (o NSFileProviderTestingDeletionObject) TargetItemBaseVersion() INSFileProviderItemVersion
The version of the deleted item.
func (NSFileProviderTestingDeletionObject) TargetItemIdentifier ¶
func (o NSFileProviderTestingDeletionObject) TargetItemIdentifier() NSFileProviderItemIdentifier
The unique identifier for the target item.
func (NSFileProviderTestingDeletionObject) TargetSide ¶
func (o NSFileProviderTestingDeletionObject) TargetSide() NSFileProviderTestingOperationSide
The target location for the delete operation.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetSide
func (NSFileProviderTestingDeletionObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingIngestion ¶
type NSFileProviderTestingIngestion interface {
objectivec.IObject
NSFileProviderTestingOperation
// The unique identifier for the item that changed.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// A description of the item that changed.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/item
Item() NSFileProviderItem
// The location where the change occurred.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/side
Side() NSFileProviderTestingOperationSide
}
An operation that alerts the system to either local or remote storage changes.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion
type NSFileProviderTestingIngestionObject ¶
type NSFileProviderTestingIngestionObject struct {
objectivec.Object
}
NSFileProviderTestingIngestionObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingIngestion protocol.
func NSFileProviderTestingIngestionObjectFromID ¶
func NSFileProviderTestingIngestionObjectFromID(id objc.ID) NSFileProviderTestingIngestionObject
NSFileProviderTestingIngestionObjectFromID constructs a NSFileProviderTestingIngestionObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingIngestionObject) BaseObject ¶
func (o NSFileProviderTestingIngestionObject) BaseObject() objectivec.Object
func (NSFileProviderTestingIngestionObject) Item ¶
func (o NSFileProviderTestingIngestionObject) Item() NSFileProviderItem
A description of the item that changed.
Discussion ¶
This property is `nil` for deletion events.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/item
func (NSFileProviderTestingIngestionObject) ItemIdentifier ¶
func (o NSFileProviderTestingIngestionObject) ItemIdentifier() NSFileProviderItemIdentifier
The unique identifier for the item that changed.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/itemIdentifier
func (NSFileProviderTestingIngestionObject) Side ¶
The location where the change occurred.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingIngestion/side
func (NSFileProviderTestingIngestionObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingLookup ¶
type NSFileProviderTestingLookup interface {
objectivec.IObject
NSFileProviderTestingOperation
// The unique identifier for the item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingLookup/itemIdentifier
ItemIdentifier() NSFileProviderItemIdentifier
// The location where the lookup occurs.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingLookup/side
Side() NSFileProviderTestingOperationSide
}
An operation that looks up an item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingLookup
type NSFileProviderTestingLookupObject ¶
type NSFileProviderTestingLookupObject struct {
objectivec.Object
}
NSFileProviderTestingLookupObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingLookup protocol.
func NSFileProviderTestingLookupObjectFromID ¶
func NSFileProviderTestingLookupObjectFromID(id objc.ID) NSFileProviderTestingLookupObject
NSFileProviderTestingLookupObjectFromID constructs a NSFileProviderTestingLookupObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingLookupObject) BaseObject ¶
func (o NSFileProviderTestingLookupObject) BaseObject() objectivec.Object
func (NSFileProviderTestingLookupObject) ItemIdentifier ¶
func (o NSFileProviderTestingLookupObject) ItemIdentifier() NSFileProviderItemIdentifier
The unique identifier for the item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingLookup/itemIdentifier
func (NSFileProviderTestingLookupObject) Side ¶
func (o NSFileProviderTestingLookupObject) Side() NSFileProviderTestingOperationSide
The location where the lookup occurs.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingLookup/side
func (NSFileProviderTestingLookupObject) Type ¶
func (o NSFileProviderTestingLookupObject) Type() NSFileProviderTestingOperationType
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingModification ¶
type NSFileProviderTestingModification interface {
objectivec.IObject
NSFileProviderTestingOperation
// A description of the source item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/sourceItem
SourceItem() NSFileProviderItem
// A list of the fields that changed.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/changedFields
ChangedFields() NSFileProviderItemFields
// The target location for the modification operation.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetSide
TargetSide() NSFileProviderTestingOperationSide
// The unique identifier for the target item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetItemIdentifier
TargetItemIdentifier() NSFileProviderItemIdentifier
// The version of the changed item.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetItemBaseVersion
TargetItemBaseVersion() INSFileProviderItemVersion
// The domain’s version when the change occurred.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/domainVersion
DomainVersion() INSFileProviderDomainVersion
}
An operation that syncs the modification of the source item to the target location.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification
type NSFileProviderTestingModificationObject ¶
type NSFileProviderTestingModificationObject struct {
objectivec.Object
}
NSFileProviderTestingModificationObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingModification protocol.
func NSFileProviderTestingModificationObjectFromID ¶
func NSFileProviderTestingModificationObjectFromID(id objc.ID) NSFileProviderTestingModificationObject
NSFileProviderTestingModificationObjectFromID constructs a NSFileProviderTestingModificationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingModificationObject) BaseObject ¶
func (o NSFileProviderTestingModificationObject) BaseObject() objectivec.Object
func (NSFileProviderTestingModificationObject) ChangedFields ¶
func (o NSFileProviderTestingModificationObject) ChangedFields() NSFileProviderItemFields
A list of the fields that changed.
func (NSFileProviderTestingModificationObject) DomainVersion ¶
func (o NSFileProviderTestingModificationObject) DomainVersion() INSFileProviderDomainVersion
The domain’s version when the change occurred.
func (NSFileProviderTestingModificationObject) SourceItem ¶
func (o NSFileProviderTestingModificationObject) SourceItem() NSFileProviderItem
A description of the source item.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/sourceItem
func (NSFileProviderTestingModificationObject) TargetItemBaseVersion ¶
func (o NSFileProviderTestingModificationObject) TargetItemBaseVersion() INSFileProviderItemVersion
The version of the changed item.
func (NSFileProviderTestingModificationObject) TargetItemIdentifier ¶
func (o NSFileProviderTestingModificationObject) TargetItemIdentifier() NSFileProviderItemIdentifier
The unique identifier for the target item.
func (NSFileProviderTestingModificationObject) TargetSide ¶
func (o NSFileProviderTestingModificationObject) TargetSide() NSFileProviderTestingOperationSide
The target location for the modification operation.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetSide
func (NSFileProviderTestingModificationObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingOperation ¶
type NSFileProviderTestingOperation interface {
objectivec.IObject
// The operation’s type.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
Type() NSFileProviderTestingOperationType
}
An operation that the system can schedule.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation
type NSFileProviderTestingOperationObject ¶
type NSFileProviderTestingOperationObject struct {
objectivec.Object
}
NSFileProviderTestingOperationObject wraps an existing Objective-C object that conforms to the NSFileProviderTestingOperation protocol.
func NSFileProviderTestingOperationObjectFromID ¶
func NSFileProviderTestingOperationObjectFromID(id objc.ID) NSFileProviderTestingOperationObject
NSFileProviderTestingOperationObjectFromID constructs a NSFileProviderTestingOperationObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderTestingOperationObject) BaseObject ¶
func (o NSFileProviderTestingOperationObject) BaseObject() objectivec.Object
func (NSFileProviderTestingOperationObject) Type ¶
The operation’s type.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperation/type
type NSFileProviderTestingOperationSide ¶
type NSFileProviderTestingOperationSide uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperationSide
const ( // NSFileProviderTestingOperationSideDisk: The File Provider extension’s local storage. NSFileProviderTestingOperationSideDisk NSFileProviderTestingOperationSide = 0 // NSFileProviderTestingOperationSideFileProvider: The File Provider extension’s remote storage. NSFileProviderTestingOperationSideFileProvider NSFileProviderTestingOperationSide = 1 )
func (NSFileProviderTestingOperationSide) String ¶
func (e NSFileProviderTestingOperationSide) String() string
type NSFileProviderTestingOperationType ¶
type NSFileProviderTestingOperationType int
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingOperationType
const ( // NSFileProviderTestingOperationTypeChildrenEnumeration: Lists an item’s content. NSFileProviderTestingOperationTypeChildrenEnumeration NSFileProviderTestingOperationType = 6 // NSFileProviderTestingOperationTypeCollisionResolution: Resolves a collision by renaming the new item. NSFileProviderTestingOperationTypeCollisionResolution NSFileProviderTestingOperationType = 7 // NSFileProviderTestingOperationTypeContentFetch: Fetches an item’s content. NSFileProviderTestingOperationTypeContentFetch NSFileProviderTestingOperationType = 5 // NSFileProviderTestingOperationTypeCreation: Propagates the creation of a source item to the target location. NSFileProviderTestingOperationTypeCreation NSFileProviderTestingOperationType = 2 // NSFileProviderTestingOperationTypeDeletion: Propagates the deletion of the source item from the target location. NSFileProviderTestingOperationTypeDeletion NSFileProviderTestingOperationType = 4 // NSFileProviderTestingOperationTypeIngestion: Alerts the system to changes to either the local or remote storage. NSFileProviderTestingOperationTypeIngestion NSFileProviderTestingOperationType = 0 // NSFileProviderTestingOperationTypeLookup: Looks up an item. NSFileProviderTestingOperationTypeLookup NSFileProviderTestingOperationType = 1 // NSFileProviderTestingOperationTypeModification: Propagates a change from the source item to the target location. NSFileProviderTestingOperationTypeModification NSFileProviderTestingOperationType = 3 )
func (NSFileProviderTestingOperationType) String ¶
func (e NSFileProviderTestingOperationType) String() string
type NSFileProviderThumbnailing ¶
type NSFileProviderThumbnailing interface {
objectivec.IObject
// Asks the file provider for a thumbnail of the specified items.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderThumbnailing/fetchThumbnails(for:requestedSize:perThumbnailCompletionHandler:completionHandler:)
FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler(itemIdentifiers []string, size corefoundation.CGSize, perThumbnailCompletionHandler StringDataErrorHandler, completionHandler ErrorHandler) foundation.Progress
}
Support for item thumbnails.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderThumbnailing
type NSFileProviderThumbnailingObject ¶
type NSFileProviderThumbnailingObject struct {
objectivec.Object
}
NSFileProviderThumbnailingObject wraps an existing Objective-C object that conforms to the NSFileProviderThumbnailing protocol.
func NSFileProviderThumbnailingObjectFromID ¶
func NSFileProviderThumbnailingObjectFromID(id objc.ID) NSFileProviderThumbnailingObject
NSFileProviderThumbnailingObjectFromID constructs a NSFileProviderThumbnailingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderThumbnailingObject) BaseObject ¶
func (o NSFileProviderThumbnailingObject) BaseObject() objectivec.Object
func (NSFileProviderThumbnailingObject) FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler ¶
func (o NSFileProviderThumbnailingObject) FetchThumbnailsForItemIdentifiersRequestedSizePerThumbnailCompletionHandlerCompletionHandler(itemIdentifiers []string, size corefoundation.CGSize, perThumbnailCompletionHandler StringDataErrorHandler, completionHandler ErrorHandler) foundation.Progress
Asks the file provider for a thumbnail of the specified items.
itemIdentifiers: The identifiers of the specified items.
size: The size for the thumbnail image.
perThumbnailCompletionHandler: A block that you call once for each item in the `itemIdentifiers` array. Pass the following parameters:
`identifier`: The identifier of the item. `imageData`: A data object containing the thumbnail, or `nil` if an error occurred. This data object must be in an image format supported by Image I/O. `error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
completionHandler: A block that you call after returning a thumbnail for each item. Pass the following parameters:
`error`: If an error occurs, this object contains information about the error; otherwise, it’s `nil`.
Return Value ¶
An object that reports the progress of this request. If the thumbnails are no longer needed, the system can cancel this request by calling the progress object’s cancel() method.
Discussion ¶
For local files, the system automatically provides thumbnails for supported content types, and calls a Quick Look Preview extension to get thumbnails for custom types.
However, the system can’t generate thumbnails for remote items. Instead, it calls this method to request thumbnails for items stored on a remote sever. The system caches these thumbnails, and only requests thumbnails for new items as needed. The system caches thumbnails based on the item’s [ItemVersion] property. To update an item’s thumbnail, update the item’s version identifier.
In your implementation, call the `perThumbnailCompletionHandler` block once for each item in the `itemIdentifiers` array. Call the `completionHandler` block only after calling `perThumbnailCompletionHandler` for each item.
For the best performance, use PNG images for text and vector graphics, JPEG for nontransparent photographs, and JPEG2000 for photographs with transparent backgrounds; however, you can use any image formats supported by NSImage and UIImage. You can also select a different image type for different thumbnails.
If a global error occurs, you don’t have to call `perThumbnailCompletionHandler` on each item. Instead, call the `completionHandler` block, and pass in the global error. The system applies this error to all outstanding items.
If a given item doesn’t have a thumbnail, call the `perThumbnailCompletionHandler` block and pass `nil` for both the `imageData` and `error` parameters.
type NSFileProviderTypeAndCreator ¶
type NSFileProviderTypeAndCreator struct {
Type uint32 // The item’s type code.
Creator uint32 // The item’s creator code.
}
NSFileProviderTypeAndCreator - A structure that contains the file type and file creator codes for an item.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/FileProvider/NSFileProviderTypeAndCreator
type NSFileProviderUserInfoKey ¶
type NSFileProviderUserInfoKey = string
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInfoKey
var ( // FileProviderUserInfoExperimentIDKey is system interpreted user info key When setting a value to that user info on a domain, the system will ingest this value. If user has given their consent for telemetry, this value will be used to decorate telemetry messages sent by the FileProvider subsystem. The telemetry messages can be then later on retrieved by developers along with the other metrics through the CloudKit console as detailed here: https://developer.apple.com/documentation/fileprovider/exporting-file-provider-metrics-data?language=objc This will help developers triaging data they receive from testing population compared to regular users The value must either be a NSNumber between [0 - 31]. If it’s not in that range, or if it is not a NSNumber, any call to addDomain with that invalid UserInfo dictionary will fail with a EINVAL POSIX NSError. To update this value, the provider must call addDomain with an updated userInfo dictionary. // // See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInfoKey/experimentID FileProviderUserInfoExperimentIDKey NSFileProviderUserInfoKey )
type NSFileProviderUserInteractionSuppressing ¶
type NSFileProviderUserInteractionSuppressing interface {
objectivec.IObject
// Asks the File Provider extension if the user suppressed the specified interaction.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInteractionSuppressing/isInteractionSuppressed(forIdentifier:)
IsInteractionSuppressedForIdentifier(suppressionIdentifier string) bool
// Tells the File Provider extension that the user wants to suppress the user interaction.
//
// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInteractionSuppressing/setInteractionSuppressed(_:forIdentifier:)
SetInteractionSuppressedForIdentifier(suppression bool, suppressionIdentifier string)
}
Support for suppressing user-interaction alerts.
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInteractionSuppressing
type NSFileProviderUserInteractionSuppressingObject ¶
type NSFileProviderUserInteractionSuppressingObject struct {
objectivec.Object
}
NSFileProviderUserInteractionSuppressingObject wraps an existing Objective-C object that conforms to the NSFileProviderUserInteractionSuppressing protocol.
func NSFileProviderUserInteractionSuppressingObjectFromID ¶
func NSFileProviderUserInteractionSuppressingObjectFromID(id objc.ID) NSFileProviderUserInteractionSuppressingObject
NSFileProviderUserInteractionSuppressingObjectFromID constructs a NSFileProviderUserInteractionSuppressingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (NSFileProviderUserInteractionSuppressingObject) BaseObject ¶
func (o NSFileProviderUserInteractionSuppressingObject) BaseObject() objectivec.Object
func (NSFileProviderUserInteractionSuppressingObject) IsInteractionSuppressedForIdentifier ¶
func (o NSFileProviderUserInteractionSuppressingObject) IsInteractionSuppressedForIdentifier(suppressionIdentifier string) bool
Asks the File Provider extension if the user suppressed the specified interaction.
suppressionIdentifier: A unique identifier for the user interaction.
func (NSFileProviderUserInteractionSuppressingObject) SetInteractionSuppressedForIdentifier ¶
func (o NSFileProviderUserInteractionSuppressingObject) SetInteractionSuppressedForIdentifier(suppression bool, suppressionIdentifier string)
Tells the File Provider extension that the user wants to suppress the user interaction.
suppression: A Boolean value that indicates whether the user wants to suppress the specified user interaction.
suppressionIdentifier: A unique identifier for the user interaction.
type NSFileProviderVolumeUnsupportedReason ¶
type NSFileProviderVolumeUnsupportedReason uint
See: https://developer.apple.com/documentation/FileProvider/NSFileProviderVolumeUnsupportedReason
const ( NSFileProviderVolumeUnsupportedReasonNetwork NSFileProviderVolumeUnsupportedReason = 16 NSFileProviderVolumeUnsupportedReasonNonAPFS NSFileProviderVolumeUnsupportedReason = 2 NSFileProviderVolumeUnsupportedReasonNonEncrypted NSFileProviderVolumeUnsupportedReason = 4 NSFileProviderVolumeUnsupportedReasonNone NSFileProviderVolumeUnsupportedReason = 0 NSFileProviderVolumeUnsupportedReasonQuarantined NSFileProviderVolumeUnsupportedReason = 32 NSFileProviderVolumeUnsupportedReasonReadOnly NSFileProviderVolumeUnsupportedReason = 8 NSFileProviderVolumeUnsupportedReasonUnknown NSFileProviderVolumeUnsupportedReason = 1 )
func (NSFileProviderVolumeUnsupportedReason) String ¶
func (e NSFileProviderVolumeUnsupportedReason) String() string
type StringDataErrorHandler ¶
type StringDataErrorHandler = func(*string, *foundation.NSData, error)
StringDataErrorHandler handles A block that you call once for each item in the `itemIdentifiers` array. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type StringStringErrorHandler ¶
StringStringErrorHandler handles A block that the system calls after it gets the items identifier. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- [NSFileProviderManager.GetIdentifierForUserVisibleFileAtURLCompletionHandler]
type URLErrorHandler ¶
type URLErrorHandler = func(*foundation.NSURL, error)
URLErrorHandler handles A block that the system calls after determining the item’s URL. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- NSFileProviderManager.GetUserVisibleURLForItemIdentifierCompletionHandler
- [NSFileProviderManager.RemoveDomainModeCompletionHandler]
type URLFileProviderItemErrorHandler ¶
type URLFileProviderItemErrorHandler = func(*foundation.NSURL, NSFileProviderItem, error)
URLFileProviderItemErrorHandler handles A block that you call after downloading the update. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler ¶
type URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler = func(*foundation.NSURL, NSFileProviderItem, foundation.NSRange, NSFileProviderMaterializationFlags, error)
URLFileProviderItemNSRangeNSFileProviderMaterializationFlagsErrorHandler handles A block that you call after downloading the item from your remote storage. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type VoidHandler ¶
type VoidHandler = func()
VoidHandler handles A block that you call after you finish processing the changes.
Used by:
- [NSFileProviderReplicatedExtension.ImportDidFinishWithCompletionHandler]
- [NSFileProviderReplicatedExtension.MaterializedItemsDidChangeWithCompletionHandler]
- [NSFileProviderReplicatedExtension.PendingItemsDidChangeWithCompletionHandler]
Source Files
¶
- blocks.gen.go
- doc.gen.go
- enums.gen.go
- file_provider_change_observer_protocol.gen.go
- file_provider_custom_action_protocol.gen.go
- file_provider_domain_state_protocol.gen.go
- file_provider_enumerating_protocol.gen.go
- file_provider_enumeration_observer_protocol.gen.go
- file_provider_enumerator_protocol.gen.go
- file_provider_external_volume_handling_protocol.gen.go
- file_provider_incremental_content_fetching_protocol.gen.go
- file_provider_item_decorating_protocol.gen.go
- file_provider_item_protocol.gen.go
- file_provider_known_folder_supporting_protocol.gen.go
- file_provider_partial_content_fetching_protocol.gen.go
- file_provider_pending_set_enumerator_protocol.gen.go
- file_provider_replicated_extension_protocol.gen.go
- file_provider_search_enumeration_observer_protocol.gen.go
- file_provider_search_enumerator_protocol.gen.go
- file_provider_search_result_protocol.gen.go
- file_provider_searching_protocol.gen.go
- file_provider_service_source_protocol.gen.go
- file_provider_servicing_protocol.gen.go
- file_provider_testing_children_enumeration_protocol.gen.go
- file_provider_testing_collision_resolution_protocol.gen.go
- file_provider_testing_content_fetch_protocol.gen.go
- file_provider_testing_creation_protocol.gen.go
- file_provider_testing_deletion_protocol.gen.go
- file_provider_testing_ingestion_protocol.gen.go
- file_provider_testing_lookup_protocol.gen.go
- file_provider_testing_modification_protocol.gen.go
- file_provider_testing_operation_protocol.gen.go
- file_provider_thumbnailing_protocol.gen.go
- file_provider_user_interaction_suppressing_protocol.gen.go
- functions.gen.go
- generate.go
- global_vars.gen.go
- ns_file_provider_domain.gen.go
- ns_file_provider_domain_version.gen.go
- ns_file_provider_item_version.gen.go
- ns_file_provider_known_folder_location.gen.go
- ns_file_provider_known_folder_locations.gen.go
- ns_file_provider_manager.gen.go
- ns_file_provider_request.gen.go
- ns_file_provider_string_search_request.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go