fileprovider

package
v0.6.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 11 Imported by: 0

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

Extension types

Extension management

Provided items

Domains

Errors

Data export

Global variables and macros

Variables

Type Aliases

Enumerations

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
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
)
View Source
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
)
View Source
var (
	// FileProviderErrorDomain is the error domain for the File Provider extension.
	//
	// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderErrorDomain
	FileProviderErrorDomain foundation.NSErrorDomain
)
View Source
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:

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 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:

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:

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

Accessing data

Syncing Desktop and Documents folders

Supporting search

Testing

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

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

Accessing Version Data

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location

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

Working with items

Performing actions

Working with domains

Syncing Desktop and Documents folders

Working with external volumes

Using services

Testing

Handling errors

Collecting diagnostic reports

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

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

Instance Properties

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderStringSearchRequest

type NSError

type NSError = _undefined

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/didDeleteItems(withIdentifiers:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/finishEnumeratingChanges(upTo:moreComing:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/finishEnumeratingWithError(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderChangeObserver/suggestedBatchSize

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

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

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 (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`.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderCustomAction/performAction(identifier:onItemsWithIdentifiers:completionHandler:)

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

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

Accessing data

Syncing Desktop and Documents folders

Supporting search

Testing

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/init(displayName:userInfo:volumeURL:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/init(identifier:displayName:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/init(identifier:displayName:pathRelativeToDocumentStorage:)

func NewNSFileProviderDomain

func NewNSFileProviderDomain() NSFileProviderDomain

NewNSFileProviderDomain creates a new NSFileProviderDomain instance.

func (NSFileProviderDomain) Autorelease

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) Init

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/init(displayName:userInfo:volumeURL:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/init(identifier:displayName:)

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) 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).

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/supportsStringSearchRequest

func (NSFileProviderDomain) TestingModes

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/testingModes-swift.property

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

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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderDomainClass) 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

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 (NSFileProviderDomainStateObject) DomainVersion

An opaque object that uniquely identifies the domain’s version.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomainState/domainVersion

func (NSFileProviderDomainStateObject) UserInfo

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderDomain/TestingModes-swift.struct

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

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

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

Autorelease adds the receiver to the current autorelease pool.

func (NSFileProviderDomainVersion) EncodeWithCoder

func (f NSFileProviderDomainVersion) EncodeWithCoder(coder foundation.INSCoder)

func (NSFileProviderDomainVersion) Init

Init initializes the instance.

func (NSFileProviderDomainVersion) Next

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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderDomainVersionClass) 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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerating/enumerator(for:request:)

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 (NSFileProviderEnumerationObserverObject) DidEnumerateItems

func (o NSFileProviderEnumerationObserverObject) DidEnumerateItems(updatedItems []objectivec.IObject)

Provides a batch of enumerated items.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/didEnumerate(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumerating(upTo:)

func (NSFileProviderEnumerationObserverObject) FinishEnumeratingWithError

func (o NSFileProviderEnumerationObserverObject) FinishEnumeratingWithError(error_ foundation.NSError)

Tells the observer that an error occurred during item enumeration.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumeratingWithError(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerationObserver/suggestedPageSize

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 (NSFileProviderEnumeratorObject) CurrentSyncAnchorWithCompletionHandler

func (o NSFileProviderEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)

Returns the current sync anchor.

Discussion

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/currentSyncAnchor(completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/enumerateChanges(for:from:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/enumerateItems(for:startingAt:)

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: An error indicating that the system is unable to service requests for the domain temporarily, and you can try again later.
	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 (NSFileProviderExternalVolumeHandlingObject) ShouldConnectExternalDomainWithCompletionHandler

func (o NSFileProviderExternalVolumeHandlingObject) ShouldConnectExternalDomainWithCompletionHandler(completionHandler ErrorHandler)

Determines whether to connect to a domain from another device.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderExternalVolumeHandling/shouldConnectExternalDomain(completionHandler:)

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

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

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderIncrementalContentFetching/fetchContents(for:version:usingExistingContentsAt:existingVersion:request:completionHandler:)

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

	// A Boolean value that indicates whether the item is shared with other users.
	//
	// See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isShared
	IsShared() bool

	// A Boolean value that indicates whether the item was shared by the current user.
	//
	// 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

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 (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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/contentModificationDate

func (NSFileProviderItemObject) ContentType

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

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) 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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isMostRecentVersionDownloaded

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/isSharedByCurrentUser

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) ItemVersion

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) ParentItemIdentifier

func (o NSFileProviderItemObject) ParentItemIdentifier() NSFileProviderItemIdentifier

The persistent identifier of the item’s parent folder.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/parentItemIdentifier

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

An abstract data blob representing the tags associated with the item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemProtocol/tagData

func (NSFileProviderItemObject) TypeAndCreator

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

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

Accessing Version Data

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion/init(contentVersion:metadataVersion:)

func NewNSFileProviderItemVersion

func NewNSFileProviderItemVersion() NSFileProviderItemVersion

NewNSFileProviderItemVersion creates a new NSFileProviderItemVersion instance.

func (NSFileProviderItemVersion) Autorelease

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

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion/init(contentVersion:metadataVersion:)

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

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderItemVersion/beforeFirstSyncComponent

func (NSFileProviderItemVersionClass) Class

Class returns the underlying Objective-C class pointer.

type NSFileProviderKnownFolderLocation

type NSFileProviderKnownFolderLocation struct {
	objectivec.Object
}

Initializers

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location/init(existingItemIdentifier:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location/init(parentItemIdentifier:filename:)

func NewNSFileProviderKnownFolderLocation

func NewNSFileProviderKnownFolderLocation() NSFileProviderKnownFolderLocation

NewNSFileProviderKnownFolderLocation creates a new NSFileProviderKnownFolderLocation instance.

func (NSFileProviderKnownFolderLocation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (NSFileProviderKnownFolderLocation) Init

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location/init(existingItemIdentifier:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolderLocations/Location/init(parentItemIdentifier:filename:)

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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderKnownFolderLocationClass) 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

Configuring folder options

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

Autorelease adds the receiver to the current autorelease pool.

func (NSFileProviderKnownFolderLocations) Init

Init initializes the instance.

func (NSFileProviderKnownFolderLocations) SetDesktopLocation

func (NSFileProviderKnownFolderLocations) SetDocumentsLocation

func (f NSFileProviderKnownFolderLocations) SetShouldCreateBinaryCompatibilitySymlink(value 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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderKnownFolderLocationsClass) 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

type NSFileProviderKnownFolders

type NSFileProviderKnownFolders uint

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderKnownFolders

const (
	NSFileProviderDesktop   NSFileProviderKnownFolders = 1
	NSFileProviderDocuments NSFileProviderKnownFolders = 2
)

func (NSFileProviderKnownFolders) 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

Working with items

Performing actions

Working with domains

Syncing Desktop and Documents folders

Working with external volumes

Using services

Testing

Handling errors

Collecting diagnostic reports

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

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/claimKnownFolders(_:localizedReason:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/disconnect(reason:options:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/enumeratorForMaterializedItems()

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].

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/enumeratorForPendingItems()

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/evictItem(identifier:completionHandler:)

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) 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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/getUserVisibleURL(for:completionHandler:)

func (NSFileProviderManager) GlobalProgressForKind

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

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/listAvailableTestingOperations()

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/reconnect(completionHandler:)

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/register(_:forItemWithIdentifier:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/reimportItems(below:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/releaseKnownFolders(_:localizedReason:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/requestDiagnosticCollection(for:errorReason:completionHandler:)

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) 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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/signalEnumerator(for:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/signalErrorResolved(_:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/waitForChanges(below:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/waitForStabilization(completionHandler:)

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

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/add(_:completionHandler:)

func (NSFileProviderManagerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (NSFileProviderManagerClass) Class

Class returns the underlying Objective-C class pointer.

func (NSFileProviderManagerClass) GetDomains

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/getDomainsWithCompletionHandler(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/getIdentifierForUserVisibleFile(at:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/import(_:fromDirectoryAt:completionHandler:)

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/removeAllDomains(completionHandler:)

func (NSFileProviderManagerClass) RemoveDomain

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/remove(_:completionHandler:)

func (NSFileProviderManagerClass) RemoveDomainMode

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

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderManager/remove(_:mode:completionHandler:)

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

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

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

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPartialContentFetching/fetchPartialContents(for:version:request:minimalRange:aligningTo:options:completionHandler:)

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 (NSFileProviderPendingSetEnumeratorObject) CurrentSyncAnchorWithCompletionHandler

func (o NSFileProviderPendingSetEnumeratorObject) CurrentSyncAnchorWithCompletionHandler(completionHandler DataHandler)

Returns the current sync anchor.

Discussion

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/currentSyncAnchor(completionHandler:)

func (NSFileProviderPendingSetEnumeratorObject) DomainVersion

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`.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator/domainVersion

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/enumerateChanges(for:from:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/enumerateItems(for:startingAt:)

func (NSFileProviderPendingSetEnumeratorObject) Invalidate

Stops the enumeration of items and changes.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerator/invalidate()

func (NSFileProviderPendingSetEnumeratorObject) RefreshInterval

The amount of time, in seconds, between updates to the pending set.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderPendingSetEnumerator/refreshInterval

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/createItem(basedOn:fields:contents:options:request:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/deleteItem(identifier:baseVersion:options:request:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderEnumerating/enumerator(for:request:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/fetchContents(for:version:request:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/importDidFinish(completionHandler:)

func (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/invalidate()

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/item(for:request:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/materializedItemsDidChange(completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderReplicatedExtension/pendingItemsDidChange(completionHandler:)

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

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

Autorelease adds the receiver to the current autorelease pool.

func (NSFileProviderRequest) DomainVersion

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

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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderRequestClass) 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 (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`.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/didEnumerate(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/finishEnumerating(upTo:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/finishEnumeratingWithError(_:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerationObserver/maximumNumberOfResultsPerPage

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 (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`.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchEnumerator/enumerateSearchResults(for:startingAt:)

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

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 (NSFileProviderSearchResultObject) ContentModificationDate

func (o NSFileProviderSearchResultObject) ContentModificationDate() foundation.NSDate

The result file’s content modification date.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/contentModificationDate

func (NSFileProviderSearchResultObject) CreationDate

The result file’s creation date.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/creationDate

func (NSFileProviderSearchResultObject) Filename

The result’s file name.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearchResult/filename

func (NSFileProviderSearchResultObject) ItemIdentifier

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

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 (NSFileProviderSearchingObject) SearchEnumeratorForStringSearchRequest

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderSearching/searchEnumerator(for:)

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 (NSFileProviderServiceSourceObject) MakeListenerEndpointAndReturnError

func (o NSFileProviderServiceSourceObject) MakeListenerEndpointAndReturnError() (foundation.NSXPCListenerEndpoint, error)

Returns an endpoint object that lets the host app communicate with the File Provider extension.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServiceSource/makeListenerEndpoint()

func (NSFileProviderServiceSourceObject) ServiceName

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderServicing/supportedServiceSources(for:completionHandler:)

type NSFileProviderStringSearchRequest

type NSFileProviderStringSearchRequest struct {
	objectivec.Object
}

A type that contains details of a string-based search request.

Working with request properties

Instance Properties

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

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderStringSearchRequest/desiredNumberOfResults

func (NSFileProviderStringSearchRequest) Init

Init initializes the instance.

func (NSFileProviderStringSearchRequest) Query

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

Alloc allocates memory for a new instance of the class.

func (NSFileProviderStringSearchRequestClass) 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 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 (NSFileProviderTestingChildrenEnumerationObject) ItemIdentifier

The containing identifier’s unique identifier.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingChildrenEnumeration/itemIdentifier

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 (NSFileProviderTestingCollisionResolutionObject) RenamedItem

A description of the renamed item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCollisionResolution/renamedItem

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

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 (NSFileProviderTestingContentFetchObject) ItemIdentifier

The containing item’s unique identifier.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingContentFetch/itemIdentifier

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 (NSFileProviderTestingCreationObject) DomainVersion

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

A description of the item stored at the source.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingCreation/sourceItem

type NSFileProviderTestingDeletion

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 (NSFileProviderTestingDeletionObject) DomainVersion

The domain’s version when the source location deleted the item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/domainVersion

func (NSFileProviderTestingDeletionObject) SourceItemIdentifier

The unique identifier for the source item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/sourceItemIdentifier

func (NSFileProviderTestingDeletionObject) TargetItemIdentifier

The unique identifier for the target item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetItemIdentifier

func (NSFileProviderTestingDeletionObject) TargetSide

The target location for the delete operation.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingDeletion/targetSide

type NSFileProviderTestingIngestion

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 (NSFileProviderTestingIngestionObject) Item

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

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

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

type NSFileProviderTestingModification

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 (NSFileProviderTestingModificationObject) DomainVersion

The domain’s version when the change occurred.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/domainVersion

func (NSFileProviderTestingModificationObject) SourceItem

A description of the source item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/sourceItem

func (NSFileProviderTestingModificationObject) TargetItemIdentifier

The unique identifier for the target item.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetItemIdentifier

func (NSFileProviderTestingModificationObject) TargetSide

The target location for the modification operation.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderTestingModification/targetSide

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

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

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

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderThumbnailing/fetchThumbnails(for:requestedSize:perThumbnailCompletionHandler:completionHandler:)

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 (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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInteractionSuppressing/isInteractionSuppressed(forIdentifier:)

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.

See: https://developer.apple.com/documentation/FileProvider/NSFileProviderUserInteractionSuppressing/setInteractionSuppressed(_:forIdentifier:)

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

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

type StringStringErrorHandler = func(*string, string, error)

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:

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL