OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file has been imported from |
| 6 // https://github.com/flutter/engine/blob/master/sky/services/activity/activity.
mojom |
| 7 [DartPackage="mojo_services"] |
| 8 module activity; |
| 9 |
| 10 struct StringExtra { |
| 11 string name; |
| 12 string value; |
| 13 }; |
| 14 |
| 15 struct ComponentName { |
| 16 string package_name; |
| 17 string class_name; |
| 18 }; |
| 19 |
| 20 struct Intent { |
| 21 string action; |
| 22 string url; |
| 23 uint32 flags; |
| 24 ComponentName? component; |
| 25 array<StringExtra>? string_extras; |
| 26 string? type; |
| 27 }; |
| 28 |
| 29 struct TaskDescription { |
| 30 string? label; |
| 31 uint32 primaryColor; |
| 32 }; |
| 33 |
| 34 enum SystemUIVisibility { |
| 35 STANDARD, |
| 36 FULLSCREEN, |
| 37 IMMERSIVE, |
| 38 }; |
| 39 |
| 40 // See http://developer.android.com/intl/es/reference/android/R.attr.html#screen
Orientation |
| 41 enum ScreenOrientation { |
| 42 UNSPECIFIED, |
| 43 LANDSCAPE, |
| 44 PORTRAIT, |
| 45 NOSENSOR, |
| 46 }; |
| 47 |
| 48 // TODO(abarth): This interface seems very specific to Android. Do we want to |
| 49 // have a higher-level abstraction here? Do we want a collection |
| 50 // of services that only work on specific platforms? We need to |
| 51 // figure out how to rationalize this interface across platforms. |
| 52 [ServiceName="activity::Activity"] |
| 53 interface Activity { |
| 54 GetUserFeedback(UserFeedback& user_feedback); |
| 55 |
| 56 StartActivity(Intent intent); |
| 57 FinishCurrentActivity(); |
| 58 SetTaskDescription(TaskDescription description); |
| 59 SetSystemUIVisibility(SystemUIVisibility visibility); |
| 60 SetRequestedOrientation(ScreenOrientation orientation); |
| 61 }; |
| 62 |
| 63 [ServiceName="activity::PathService"] |
| 64 interface PathService { |
| 65 // Where the application files are. |
| 66 GetAppDataDir() => (string path); |
| 67 |
| 68 // Where to store long-term files. |
| 69 GetFilesDir() => (string path); |
| 70 |
| 71 // Where to store short-term files. |
| 72 GetCacheDir() => (string path); |
| 73 }; |
| 74 |
| 75 enum HapticFeedbackType { |
| 76 LONG_PRESS, |
| 77 VIRTUAL_KEY, |
| 78 KEYBOARD_TAP, |
| 79 CLOCK_TICK, |
| 80 }; |
| 81 |
| 82 enum AuralFeedbackType { |
| 83 CLICK, |
| 84 NAVIGATION_LEFT, |
| 85 NAVIGATION_UP, |
| 86 NAVIGATION_RIGHT, |
| 87 NAVIGATION_DOWN, |
| 88 }; |
| 89 |
| 90 interface UserFeedback { |
| 91 PerformHapticFeedback(HapticFeedbackType type); |
| 92 PerformAuralFeedback(AuralFeedbackType type); |
| 93 }; |
OLD | NEW |