GlobalContext

public protocol GlobalContext : class

A context global for all windows.

  • Returns Marta application configuration.

    Declaration

    Swift

    var application: MartaApplication
  • The preloaded theme.

    Declaration

    Swift

    var theme: Theme
  • The action repository.

    Declaration

    Swift

    var actionRepository: ActionRepository
  • The local file system instance.

    Declaration

    Swift

    var localFileSystem: LocalFileSystem
  • Returns the value for the particular configuration key.

    Declaration

    Swift

    func get<T>(_ key: ConfigurationKey<T>) -> T
  • Returns the value for the particular configuration key from the current theme.

    Declaration

    Swift

    func getTheme<T>(_ key: ConfigurationKey<T>) -> T
  • Modifies the value for the particular configuration key.

    The configuration will be eventually written to the state.json file. If you want to save it simultaneously, use saveConfiguration().

    Declaration

    Swift

    func set<T>(_ key: ConfigurationKey<T>, _ value: T)
  • Writes the new state to the state.json file.

    Declaration

    Swift

    func saveConfiguration()
  • A global queue for asynchronous operations.

    Declaration

    Swift

    var asyncQueue: AsyncOperationQueue
  • Returns Marta service for the given key.

    Declaration

    Swift

    func getService<T : Service>(_ key: Key<T>) -> T
  • Returns Marta service for the given key, or nil if the service is not found.

    Declaration

    Swift

    func findService<T : Service>(_ key: Key<T>) -> T?