2016-12-27 11:32:55 +03:00
|
|
|
/**
|
|
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
|
|
* See LICENSE
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
protocol PreviewRenderer: class {
|
|
|
|
|
2017-01-01 09:52:02 +03:00
|
|
|
static var identifier: String { get }
|
|
|
|
static func prefData(from: [String: Any]) -> StandardPrefData?
|
|
|
|
|
|
|
|
var identifier: String { get }
|
|
|
|
var prefData: StandardPrefData? { get }
|
|
|
|
|
2016-12-30 06:32:08 +03:00
|
|
|
var toolbar: NSView? { get }
|
|
|
|
var menuItems: [NSMenuItem]? { get }
|
|
|
|
|
|
|
|
func canRender(fileExtension: String) -> Bool
|
2016-12-27 11:32:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
enum PreviewRendererAction {
|
|
|
|
|
|
|
|
case htmlString(renderer: PreviewRenderer, html: String, baseUrl: URL)
|
|
|
|
case view(renderer: PreviewRenderer, view: NSView)
|
|
|
|
|
|
|
|
case scroll(to: Position)
|
|
|
|
|
|
|
|
case error(renderer: PreviewRenderer)
|
|
|
|
}
|