/*
 * Copyright 2020-2021 Exactpro (Exactpro Systems Limited)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

option java_multiple_files = false;
option java_package = "com.exactpro.th2.act.grpc.hand.rhactions";
option java_outer_classname = "RhWinActionsMessages";

import "google/protobuf/wrappers.proto";

message WinLocator {
  string locator = 1;
  string matcher = 2;
  google.protobuf.Int32Value matcherIndex = 3;
}

message WinOpen {
    string id = 2;
    string execute = 3;
    string workDir = 4;
    string appFile = 5;
    string appArgs = 6;
}

message WinClick {
  enum Button {
    LEFT = 0;
    RIGHT = 1;
    MIDDLE = 2;
    DOUBLE = 3;
  }
  enum AttachedBorder {
    NONE = 0;
    LEFT_TOP = 1;
    LEFT_BOTTOM = 2;
    RIGHT_TOP = 3;
    RIGHT_BOTTOM = 4;
  }
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  Button button = 4;
  google.protobuf.Int32Value xOffset = 5;
  google.protobuf.Int32Value yOffset = 6;
  AttachedBorder attachedBorder = 7;
}

message WinSendText {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string text = 4;
  string clearBefore = 5;
  string isDirectText = 6;
}

message WinGetActiveWindow {
  string id = 2;
  string execute = 3;
  string windowName = 4;
  string accessibilityId = 5;
  int32 maxTimeout = 6;
}

message MaximizeMainWindow {
  string id = 2;
  string execute = 3;
}

message WinGetElementAttribute {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string attributeName = 4;
}

message WinWait {
  string id = 2;
  string execute = 3;
  uint32 millis = 4;
}

message WinToggleCheckBox {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string expectedState = 4;
}

message WinClickContextMenu {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
}

message WinCheckElement {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
}

message WinGetWindow {
  string id = 2;
  string execute = 3;
  string windowName = 4;
  string accessibilityId = 5;
}

message WinSearchElement {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
}

message WinWaitForAttribute {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string attributeName = 4;
  string expectedValue = 5;
  string maxTimeout = 6;
  string checkInterval = 7;
  string fromRoot = 8;
}

message WinScrollUsingText {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string textToSend = 4;
  string maxIterations = 5;
  repeated WinLocator textLocators = 6;
}

message WinGetDataFromClipboard {
  string id = 2;
  string execute = 3;
}

message WinTableClick {
  option deprecated = true;
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string searchParams = 4;
  string targetColumn = 5;
  string columnIndex = 6;
}

message WinTableSearch {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string searchParams = 4;
  string targetColumn = 5;
  string columnIndex = 6;
  string firstRowIndex = 7;
  string rowNameFormat = 8;
  string rowElementNameFormat = 9;
  string rowElementValueFormat = 10;
  string saveResult = 11;
}

message WinWaitForElement {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
  string timeout = 4;
  string fromRoot = 5;
}

message WinGetScreenshot {
  repeated WinLocator locators = 1;
  string id = 2;
  string execute = 3;
}