package jp.co.cyberagent.stf.proto;

option java_outer_classname = "Wire";

enum MessageType {
    DO_IDENTIFY = 1;
    DO_KEYEVENT = 2;
    DO_TYPE = 3;
    DO_WAKE = 4;
    DO_ADD_ACCOUNT_MENU = 24;
    DO_REMOVE_ACCOUNT = 20;
    GET_ACCOUNTS = 26;
    GET_BROWSERS = 5;
    GET_CLIPBOARD = 6;
    GET_DISPLAY = 19;
    GET_PROPERTIES = 7;
    GET_RINGER_MODE = 27;
    GET_SD_STATUS = 25;
    GET_VERSION = 8;
    GET_WIFI_STATUS = 23;
    SET_CLIPBOARD = 9;
    SET_KEYGUARD_STATE = 10;
    SET_RINGER_MODE = 21;
    SET_ROTATION = 12;
    SET_WAKE_LOCK = 11;
    SET_WIFI_ENABLED = 22;
    EVENT_AIRPLANE_MODE = 13;
    EVENT_BATTERY = 14;
    EVENT_CONNECTIVITY = 15;
    EVENT_PHONE_STATE = 16;
    EVENT_ROTATION = 17;
    EVENT_BROWSER_PACKAGE = 18;
}

message Envelope {
    optional uint32 id = 1;
    required MessageType type = 2;
    required bytes message = 3;
}

// Events

message AirplaneModeEvent {
    required bool enabled = 1;
}

message BatteryEvent {
    required string status = 1;
    required string health = 2;
    required string source = 3;
    required uint32 level = 4;
    required uint32 scale = 5;
    required double temp = 6;
    required double voltage = 7;
}

message BrowserApp {
    required string name = 1;
    required string component = 2;
    required bool selected = 3;
    required bool system = 4;
}

message BrowserPackageEvent {
    required bool selected = 1;
    repeated BrowserApp apps = 2;
}

message ConnectivityEvent {
    required bool connected = 1;
    optional string type = 2;
    optional string subtype = 3;
    optional bool failover = 4;
    optional bool roaming = 5;
}

message PhoneStateEvent {
    required string state = 1;
    required bool manual = 2;
    optional string operator = 3;
}

message RotationEvent {
    required int32 rotation = 1;
}

// Service

message GetVersionRequest {
}

message GetVersionResponse {
    required bool success = 1;
    optional string version = 2;
}

message SetKeyguardStateRequest {
    required bool enabled = 1;
}

message SetKeyguardStateResponse {
    required bool success = 1;
}

message SetWakeLockRequest {
    required bool enabled = 1;
}

message SetWakeLockResponse {
    required bool success = 1;
}

enum ClipboardType {
    TEXT = 1;
}

message SetClipboardRequest {
    required ClipboardType type = 1;
    optional string text = 2;
}

message SetClipboardResponse {
    required bool success = 1;
}

message GetClipboardRequest {
    required ClipboardType type = 1;
}

message GetClipboardResponse {
    required bool success = 1;
    optional ClipboardType type = 2;
    optional string text = 3;
}

message GetBrowsersRequest {
}

message GetBrowsersResponse {
    required bool success = 1;
    required bool selected = 2;
    repeated BrowserApp apps = 3;
}

message GetDisplayRequest {
    required int32 id = 1;
}

message GetDisplayResponse {
    required bool success = 1;
    optional int32 width = 2;
    optional int32 height = 3;
    optional float xdpi = 4;
    optional float ydpi = 5;
    optional float fps = 6;
    optional float density = 7;
    optional int32 rotation = 8;
    optional bool secure = 9;
}

message Property {
    required string name = 1;
    required string value = 2;
}

message GetPropertiesRequest {
    repeated string properties = 1;
}

message GetPropertiesResponse {
    required bool success = 1;
    repeated Property properties = 2;
}

message DoIdentifyRequest {
    required string serial = 1;
}

message DoIdentifyResponse {
    required bool success = 1;
}

message GetAccountsRequest {
    optional string type = 1;
}

message GetAccountsResponse {
    required bool success = 1;
    repeated string accounts = 2;
}

message DoAddAccountMenuRequest {
}

message DoAddAccountMenuResponse {
    required bool success = 1;
}

message DoRemoveAccountRequest {
    required string type = 1;
    optional string account = 2;
}

message DoRemoveAccountResponse {
    required bool success = 1;
}

enum RingerMode {
    SILENT = 0;
    VIBRATE = 1;
    NORMAL = 2;
}

message SetRingerModeRequest {
    required RingerMode mode = 1;
}

message SetRingerModeResponse {
    required bool success = 1;
}

message GetRingerModeRequest {
}

message GetRingerModeResponse {
    required bool success = 1;
    required RingerMode mode = 2;
}

message SetWifiEnabledRequest {
    required bool enabled = 1;
}

message SetWifiEnabledResponse {
    required bool success = 1;
}

message GetWifiStatusRequest {
}

message GetWifiStatusResponse {
    required bool success = 1;
    required bool status = 2;
}

message GetSdStatusRequest {
}

message GetSdStatusResponse {
    required bool success = 1;
    required bool mounted = 2;
}

// Agent

enum KeyEvent {
    DOWN = 0;
    UP = 1;
    PRESS = 2;
}

message KeyEventRequest {
    required KeyEvent event = 1;
    required int32 keyCode = 2;
    optional bool shiftKey = 3;
    optional bool ctrlKey = 4;
    optional bool altKey = 5;
    optional bool metaKey = 6;
    optional bool symKey = 7;
    optional bool functionKey = 8;
    optional bool capsLockKey = 9;
    optional bool scrollLockKey = 10;
    optional bool numLockKey = 11;
}

message DoTypeRequest {
    required string text = 1;
}

message SetRotationRequest {
    required int32 rotation = 1;
    required bool lock = 2;
}

message DoWakeRequest {
}
