NetNewsWire/Frameworks/Account/AccountDelegate.swift

54 lines
2.6 KiB
Swift
Raw Normal View History

//
// AccountDelegate.swift
2019-07-09 08:06:40 +02:00
// NetNewsWire
//
// Created by Brent Simmons on 9/16/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import Articles
import RSWeb
protocol AccountDelegate {
2017-09-28 22:16:47 +02:00
// Local account does not; some synced accounts might.
var isSubfoldersSupported: Bool { get }
var isTagBasedSystem: Bool { get }
var isOPMLImportSupported: Bool { get }
var isOPMLImportInProgress: 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 }
func refreshAll(for account: Account, completion: @escaping (Result<Void, Error>) -> Void)
func sendArticleStatus(for account: Account, completion: @escaping (() -> Void))
func refreshArticleStatus(for account: Account, completion: @escaping (() -> Void))
func importOPML(for account:Account, opmlFile: URL, completion: @escaping (Result<Void, Error>) -> Void)
func addFolder(for account: Account, name: String, completion: @escaping (Result<Folder, Error>) -> 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 removeFolder(for account: Account, with folder: Folder, completion: @escaping (Result<Void, Error>) -> Void)
2019-05-07 00:34:41 +02:00
func createFeed(for account: Account, url: String, name: String?, container: Container, completion: @escaping (Result<Feed, Error>) -> Void)
2019-05-09 00:41:19 +02:00
func renameFeed(for account: Account, with feed: Feed, to name: String, completion: @escaping (Result<Void, Error>) -> Void)
func addFeed(for account: Account, with: Feed, to container: Container, completion: @escaping (Result<Void, Error>) -> Void)
func removeFeed(for account: Account, with feed: Feed, from container: Container, completion: @escaping (Result<Void, Error>) -> Void)
func moveFeed(for account: Account, with feed: Feed, from: Container, to: Container, completion: @escaping (Result<Void, Error>) -> Void)
func restoreFeed(for account: Account, feed: Feed, container: Container, completion: @escaping (Result<Void, Error>) -> Void)
2019-05-09 23:09:21 +02:00
func restoreFolder(for account: Account, folder: Folder, completion: @escaping (Result<Void, Error>) -> Void)
func markArticles(for account: Account, articles: Set<Article>, statusKey: ArticleStatus.Key, flag: Bool) -> Set<Article>?
// Called at the end of accounts init method.
func accountDidInitialize(_ account: Account)
static func validateCredentials(transport: Transport, credentials: Credentials, endpoint: URL?, completion: @escaping (Result<Credentials?, Error>) -> Void)
2019-05-05 10:25:21 +02:00
}