2017-09-16 15:30:26 -07:00
|
|
|
|
//
|
|
|
|
|
// AccountDelegate.swift
|
|
|
|
|
// Account
|
|
|
|
|
//
|
|
|
|
|
// Created by Brent Simmons on 9/16/17.
|
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
2017-10-07 17:20:19 -07:00
|
|
|
|
import RSWeb
|
2017-09-16 15:30:26 -07:00
|
|
|
|
|
2019-05-05 07:21:26 -05:00
|
|
|
|
protocol AccountDelegate {
|
2017-09-16 15:30:26 -07:00
|
|
|
|
|
2017-09-28 13:16:47 -07:00
|
|
|
|
// Local account does not; some synced accounts might.
|
|
|
|
|
var supportsSubFolders: Bool { get }
|
2019-05-04 11:48:48 -05:00
|
|
|
|
var server: String? { get }
|
2019-05-05 03:25:21 -05:00
|
|
|
|
var credentials: Credentials? { get set }
|
2019-05-05 07:49:59 -05:00
|
|
|
|
var accountMetadata: AccountMetadata? { get set }
|
2017-10-07 14:40:14 -07:00
|
|
|
|
|
2017-10-07 17:43:10 -07:00
|
|
|
|
var refreshProgress: DownloadProgress { get }
|
2017-09-16 15:30:26 -07:00
|
|
|
|
|
2019-05-08 17:41:19 -05:00
|
|
|
|
func refreshAll(for account: Account, completion: (() -> Void)?)
|
2019-05-11 12:26:23 -05:00
|
|
|
|
func importOPML(for account:Account, opmlFile: URL, completion: @escaping (Result<Void, Error>) -> Void)
|
|
|
|
|
|
2019-05-08 17:41:19 -05: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-06 17:34:41 -05:00
|
|
|
|
|
2019-05-10 10:14:24 -05:00
|
|
|
|
func createFeed(for account: Account, url: String, completion: @escaping (Result<Feed, Error>) -> Void)
|
2019-05-08 17:41:19 -05:00
|
|
|
|
func renameFeed(for account: Account, with feed: Feed, to name: String, completion: @escaping (Result<Void, Error>) -> Void)
|
2019-05-09 13:31:18 -05:00
|
|
|
|
func deleteFeed(for account: Account, with feed: Feed, completion: @escaping (Result<Void, Error>) -> Void)
|
2019-05-08 17:41:19 -05:00
|
|
|
|
|
2019-05-09 13:31:18 -05:00
|
|
|
|
func addFeed(for account: Account, to container: Container, with: Feed, completion: @escaping (Result<Void, Error>) -> Void)
|
|
|
|
|
func removeFeed(for account: Account, from container: Container, with: Feed, completion: @escaping (Result<Void, Error>) -> Void)
|
|
|
|
|
|
2019-05-09 16:09:21 -05:00
|
|
|
|
func restoreFeed(for account: Account, feed: Feed, folder: Folder?, completion: @escaping (Result<Void, Error>) -> Void)
|
|
|
|
|
func restoreFolder(for account: Account, folder: Folder, completion: @escaping (Result<Void, Error>) -> Void)
|
|
|
|
|
|
2017-12-19 17:48:30 -08:00
|
|
|
|
// Called at the end of account’s init method.
|
|
|
|
|
func accountDidInitialize(_ account: Account)
|
|
|
|
|
|
2019-05-06 10:53:20 -05:00
|
|
|
|
static func validateCredentials(transport: Transport, credentials: Credentials, completion: @escaping (Result<Bool, Error>) -> Void)
|
2019-05-05 03:25:21 -05:00
|
|
|
|
|
2017-09-16 15:30:26 -07:00
|
|
|
|
}
|