2017-09-17 00:30:26 +02:00
|
|
|
|
//
|
|
|
|
|
// AccountDelegate.swift
|
|
|
|
|
// Account
|
|
|
|
|
//
|
|
|
|
|
// Created by Brent Simmons on 9/16/17.
|
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
2017-10-08 02:20:19 +02:00
|
|
|
|
import RSWeb
|
2017-09-17 00:30:26 +02:00
|
|
|
|
|
|
|
|
|
public protocol AccountDelegate {
|
|
|
|
|
|
2017-09-28 22:16:47 +02:00
|
|
|
|
// Local account does not; some synced accounts might.
|
|
|
|
|
var supportsSubFolders: Bool { get }
|
2017-10-07 23:40:14 +02:00
|
|
|
|
|
2017-10-08 02:43:10 +02:00
|
|
|
|
var refreshProgress: DownloadProgress { get }
|
2017-09-17 00:30:26 +02:00
|
|
|
|
|
2019-04-26 21:21:17 +02:00
|
|
|
|
func refreshAll(for: Account)
|
2017-10-19 04:14:40 +02:00
|
|
|
|
|
2017-12-20 02:48:30 +01:00
|
|
|
|
// Called at the end of account’s init method.
|
|
|
|
|
|
|
|
|
|
func accountDidInitialize(_ account: Account)
|
|
|
|
|
|
2017-10-19 04:14:40 +02:00
|
|
|
|
// Called at the end of initializing an Account using data from disk.
|
|
|
|
|
// Delegate has complete control over what goes in userInfo and what it means.
|
|
|
|
|
// Called even if userInfo is nil, since the delegate might have other
|
|
|
|
|
// things to do at init time anyway.
|
|
|
|
|
func update(account: Account, withUserInfo: NSDictionary?)
|
|
|
|
|
|
|
|
|
|
// Saved to disk with other Account data. Could be called at any time.
|
|
|
|
|
// And called many times.
|
|
|
|
|
func userInfo(for: Account) -> NSDictionary?
|
2017-09-17 00:30:26 +02:00
|
|
|
|
}
|