blob: 231fba5e284b0d7c69a8ed4f7054510624e0e783 [file] [log] [blame]
// Copyright 2017 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.sys;
/// Information about a Module instance in a story.
resource table ModuleData {
/// The URL of the Module binary.
1: string:MAX module_url;
/// The named path leading up to this Module instance. The last name in this
/// array is the name by which the Module was started by the parent Module
/// instance calling StartModule().
2: vector<string:MAX>:MAX module_path;
3: reserved;
/// The way in which this Module instance was first started in the story,
/// either by request from another Module instance (INTERNAL) or by request
/// from outside the story (i.e. by suggestion from an agent - EXTERNAL).
4: ModuleSource module_source;
/// The `surface_relation` that was used to start this Module instance with.
/// The same is used when re-inflating the Module instance when the story is
/// resumed. A SurfaceRelation value of null represents an embedded Module
/// instance (started by EmbedModule()) that is not managed by the story shell.
5: SurfaceRelation surface_relation;
/// True if this module was removed from its story either through
/// ModuleController.Stop() or ModuleContext.RemoveSelfFromStory().
6: bool module_deleted;
/// The intent that was issued to start add this Module instance to the story.
/// Some Module instances may have been added not by an Intent, for example as
/// the initial module of a story. For those the field may be null.
/// TODO(thatguy,mesch): This field should now always be set, so make it
/// required once the framework is cleaned up enough to guarantee this
/// statement.
7: Intent intent;
/// If true, this module was started by a parent module using
/// ModuleContext.EmbedModule(), and its view is not managed by the
/// StoryShell.
8: bool is_embedded;
/// Collection of user-defined key-value attributes that describe this surface (module).
/// The `Annotation.value` field of each `Annotation` is always set.
9: vector<Annotation>:MAX_ANNOTATIONS_PER_MODULE annotations;
/// Services passed to the module.
/// This is only set for modules that represent elements.
10: fuchsia.sys.ServiceList additional_services;
enum ModuleSource {
/// Module that was added to the story from within the story by another
/// module using ModuleContext.AddModuleToStory() or
/// ModuleContext.EmbedModule().
/// Module that was added to the story from outside the story using
/// PuppetMaster.