NetNewsWire/Frameworks/Account/AccountDelegate.swift

37 lines
1.4 KiB
Swift
Raw Normal View History

//
// AccountDelegate.swift
// Account
//
// Created by Brent Simmons on 9/16/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import RSWeb
protocol AccountDelegate {
2017-09-28 22:16:47 +02:00
// Local account does not; some synced accounts might.
var supportsSubFolders: Bool { get }
var server: String? { get }
2019-05-05 10:25:21 +02:00
var credentials: Credentials? { get set }
var accountMetadata: AccountMetadata? { get set }
var refreshProgress: DownloadProgress { get }
2019-05-09 00:41:19 +02:00
func refreshAll(for account: Account, completion: (() -> Void)?)
2019-05-09 00:41:19 +02:00
func renameFolder(for account: Account, with folder: Folder, to name: String, completion: @escaping (Result<Void, Error>) -> Void)
func deleteFolder(for account: Account, with folder: Folder, completion: @escaping (Result<Void, Error>) -> Void)
2019-05-07 00:34:41 +02:00
2019-05-09 00:41:19 +02:00
func createFeed(for account: Account, with name: String?, url: String, completion: @escaping (Result<AccountCreateFeedResult, Error>) -> Void)
func renameFeed(for account: Account, with feed: Feed, to name: String, completion: @escaping (Result<Void, Error>) -> Void)
2019-05-09 14:25:45 +02:00
func deleteFeed(for account: Account, container: Container, feed: Feed, completion: @escaping (Result<Void, Error>) -> Void)
2019-05-09 00:41:19 +02:00
// Called at the end of accounts init method.
func accountDidInitialize(_ account: Account)
2019-05-06 17:53:20 +02:00
static func validateCredentials(transport: Transport, credentials: Credentials, completion: @escaping (Result<Bool, Error>) -> Void)
2019-05-05 10:25:21 +02:00
}