| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| [DartPackage="sky_services"] |
| module activity; |
| |
| struct StringExtra { |
| string name; |
| string value; |
| }; |
| |
| struct ComponentName { |
| string package_name; |
| string class_name; |
| }; |
| |
| struct Intent { |
| string action; |
| string url; |
| uint32 flags; |
| ComponentName? component; |
| array<StringExtra>? string_extras; |
| }; |
| |
| struct TaskDescription { |
| string? label; |
| uint32 primaryColor; |
| }; |
| |
| enum SystemUIVisibility { |
| STANDARD, |
| FULLSCREEN, |
| IMMERSIVE, |
| }; |
| |
| // TODO(abarth): This interface seems very specific to Android. Do we want to |
| // have a higher-level abstraction here? Do we want a collection |
| // of services that only work on specific platforms? We need to |
| // figure out how to rationalize this interface across platforms. |
| interface Activity { |
| GetUserFeedback(UserFeedback& user_feedback); |
| |
| StartActivity(Intent intent); |
| FinishCurrentActivity(); |
| SetTaskDescription(TaskDescription description); |
| SetSystemUIVisibility(SystemUIVisibility visibility); |
| |
| // These are stored off the Activity on Android, but probably belong in a |
| // separate FileSystem service. |
| |
| // Where to store long-term files. |
| GetFilesDir() => (string path); |
| |
| // Where to store short-term files. |
| GetCacheDir() => (string path); |
| }; |
| |
| enum HapticFeedbackType { |
| LONG_PRESS, |
| VIRTUAL_KEY, |
| KEYBOARD_TAP, |
| CLOCK_TICK, |
| }; |
| |
| enum AuralFeedbackType { |
| CLICK, |
| NAVIGATION_LEFT, |
| NAVIGATION_UP, |
| NAVIGATION_RIGHT, |
| NAVIGATION_DOWN, |
| }; |
| |
| interface UserFeedback { |
| PerformHapticFeedback(HapticFeedbackType type); |
| PerformAuralFeedback(AuralFeedbackType type); |
| }; |