blob: bb718d24e5f91caf5a6b2007e6b640f4393ff31f [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;
using fuchsia.modular.auth;
using fuchsia.speech;
using fuchsia.ui.policy;
// This interface is implemented by a user shell. Dependencies are passed to it
// in Initialize() on startup. The user shell is also expected to implement
// Lifecycle in order to receive a Terminate() call on teardown.
//
// In one component instance there can only be one UserShell service instance.
// The ViewOwner request is sent to the separate ViewProvider service. This way,
// the user shell may be implemented as a flutter component.
//
// Teardown may be initiated by the user shell calling
// UserShellContext.Logout(), by the user runner being terminated, or by the
// system shutting down.
[Discoverable] // Created by user shell components.
interface UserShell {
1: Initialize(UserShellContext user_shell_context);
};
// This interface allows the |UserShell| to request capabilities from the
// |UserRunner| in a way that is more explicit about the services that are
// offered than a generic |ServiceProvider|.
interface UserShellContext {
// The account associated with the currently logged-in user. It's NULL if
// logged into GUEST mode.
1: GetAccount() -> (fuchsia.modular.auth.Account? account);
2: GetAgentProvider(request<AgentProvider> @request);
3: GetComponentContext(request<ComponentContext> @request);
4: GetDeviceName() -> (string device_name);
5: GetFocusController(request<FocusController> @request);
6: GetFocusProvider(request<FocusProvider> @request);
7: GetIntelligenceServices(request<IntelligenceServices> @request);
8: GetLink(request<Link> @request);
9: GetPresentation(request<fuchsia.ui.policy.Presentation> @request);
10: GetSpeechToText(request<fuchsia.speech.SpeechToText> @request);
11: GetStoryProvider(request<StoryProvider> @request);
12: GetSuggestionProvider(request<SuggestionProvider> @request);
13: GetVisibleStoriesController(request<VisibleStoriesController> @request);
// Requests logout of the user. This causes the device runner to tear down the
// |UserRunner| instance of the user.
16: Logout();
};
// User shell provides this service to the framework which may plumb it to
// different subscribers, such as story shell and intelligence provider.
//
// EXPERIMENTAL Service that allows consumers of a given story to get a
// connection to a Presentation, and visual state services provided by the user
// shell. This allows story shell implementations to coordinate event and focus
// handling. An analog mechanism exists between DeviceShell and UserShell.
[Discoverable] // Created by user shell components.
interface UserShellPresentationProvider {
// When a StoryShell calls StoryShellContext.GetPresentation(), this request
// arrives here.
1: GetPresentation(string story_id, request<fuchsia.ui.policy.Presentation> @request);
// When a StoryShell calls StoryShellContext.WatchVisualState(), this request
// arrives here.
2: WatchVisualState(string story_id, StoryVisualStateWatcher watcher);
};