blob: 4c087c44600015336ad1e7cde36abacc5ab0c16c [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.modular;
/// This interface is used by the caller of ModuleContext.StartModule() to
/// control the started Module instance.
///
/// Closing this connection doesn't affect its Module instance; it just
/// relinquishes the ability of the caller to control the Module instance.
protocol ModuleController {
/// Requests that this module become the focused module in the story.
Focus();
/// Requests that this module be hidden in the story.
Defocus();
/// Requests the Module instance to stop. The running Module component's
/// Lifecycle::Terminate() method is called, the instance is shut down and
/// state within the framework is cleaned up.
///
/// The result callback is called once the Module's runtime has been torn down.
Stop() -> ();
/// Called with the current state when it changes.
/// DEPRECATED: Do not use this. ModuleState is a framework-internal concept
/// and should not be exposed outside.
-> OnStateChange(ModuleState new_state);
};