File: FPUIExtensionService.swift

package info (click to toggle)
nextcloud-desktop 4.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,740 kB
  • sloc: cpp: 119,301; objc: 752; python: 606; ansic: 389; sh: 377; makefile: 44; javascript: 32; xml: 6
file content (44 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
//  FPUIExtensionCommunicationProtocol.swift
//  FileProviderExt
//
//  SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
//  SPDX-License-Identifier: GPL-2.0-or-later
//

import FileProvider
import NextcloudKit

///
/// The descriptive identifier for the service exposed at certain locations.
///
/// This does not need to be branded because it is scoped by the app-specific file provider domains in the file system already.
///
let fpUiExtensionServiceName = NSFileProviderServiceName("com.nextcloud.desktopclient.FPUIExtensionService")

///
/// The requirements of the service exposed and dedicated to the file provider user interface extension.
///
@objc protocol FPUIExtensionService {
    ///
    /// Request (re)authentication with the available credentials.
    ///
    /// - Returns: An error in case of failure, otherwise `nil`.
    ///
    func authenticate() async -> NSError?

    ///
    /// Fetch the user agent used by the underlying NextcloudKit.
    ///
    func userAgent() async -> NSString?

    ///
    /// Fetch the credentials used by the file provider extension.
    ///
    func credentials() async -> NSDictionary

    ///
    /// Get a server URL for the given local file provider item.
    ///
    func itemServerPath(identifier: NSFileProviderItemIdentifier) async -> NSString?
}