| // Copyright 2019 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.app.discover; |
| |
| using fuchsia.mem; |
| |
| using ActionName = string:ACTION_NAME_MAX_LENGTH; |
| using ParameterTypeName = string:PARAMETER_TYPE_NAME_MAX_LENGTH; |
| using SurfaceId = string:SURFACE_ID_MAX_LENGTH; |
| |
| /// Error code for story related services. |
| enum StoryDiscoverError : int32 { |
| /// If the story storage fails to respond to the SetProperty request. |
| STORAGE = 1; |
| |
| /// If the given value fails to be converted to a story property. |
| VMO_STRING_CONVERSION = 2; |
| |
| /// If the key for a story property is invalid. |
| INVALID_KEY = 3; |
| }; |
| |
| /// Provided to session shells to communicate with discover. |
| [Discoverable] |
| protocol SessionDiscoverContext { |
| /// The session shell can act as the story shell. Gets a a story control |
| /// service. |
| GetStoryContext(StoryId story_id, request<StoryDiscoverContext> request); |
| }; |
| |
| //// Provided to story shell to communicate with discover. |
| [Discoverable] |
| protocol StoryDiscoverContext { |
| /// Sets the value for the given story property |key|. |
| SetProperty(string key, fuchsia.mem.Buffer value) -> () error StoryDiscoverError; |
| |
| /// Gets the value for the given story property |key|. |
| GetProperty(string key) -> (fuchsia.mem.Buffer value) error StoryDiscoverError; |
| |
| /// Gets the surface data for the given |surface_id|. |
| GetSurfaceData(SurfaceId surface_id) -> (SurfaceData surface_data); |
| }; |
| |
| /// Information about a surface in the story. |
| table SurfaceData { |
| /// The name of the action that triggered the creation of that surface. |
| 1: ActionName action; |
| |
| /// The types of the parameters for each parameter of the action. |
| 2: vector<ParameterTypeName> parameter_types; |
| }; |
| |
| const uint32 ACTION_NAME_MAX_LENGTH = 512; |
| const uint32 PARAMETER_TYPE_NAME_MAX_LENGTH = 512; |
| const uint32 SURFACE_ID_MAX_LENGTH = 1024; |