//
// Aspia Project
// Copyright (C) 2016-2024 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

syntax = "proto3";

option optimize_for = LITE_RUNTIME;

package proto;

message Resolution
{
    int32 width  = 1;
    int32 height = 2;
}

message Point
{
    int32 x = 1;
    int32 y = 2;
}

// Extension name: "select_screen"
// Sent by client to host for screen or screen resolution selection.
message Screen
{
    int64 id              = 1;
    string title          = 2;
    Point position        = 3;
    Resolution resolution = 4;
    Point dpi             = 5;
}

// Extension name: "select_screen"
// Sent by host to client. Contains a list of screens on the host.
message ScreenList
{
    repeated Screen screen         = 1; // List of screens on the remote computer.
    int64 current_screen           = 2; // ID of current screen.
    int64 primary_screen           = 3; // ID of primary screen.
    repeated Resolution resolution = 4; // List of resolutions for current screen.
}

// Extension name: "preferred_size"
// Sent by client to host.
message PreferredSize
{
    int32 width  = 1;
    int32 height = 2;
}

// Extension name: "video_pause", "audio_pause"
// Sent by client to host.
message Pause
{
    bool enable = 1;
}

// Extension name: "power_control"
// Sent by client to host.
message PowerControl
{
    enum Action
    {
        ACTION_UNKNOWN          = 0;
        ACTION_SHUTDOWN         = 1;
        ACTION_REBOOT           = 2;
        ACTION_LOGOFF           = 3;
        ACTION_LOCK             = 4;
        ACTION_REBOOT_SAFE_MODE = 5;
    }

    Action action = 1;
}

// Extension name: "video_recording"
// Sent by host to client and by client to host.
message VideoRecording
{
    enum Action
    {
        ACTION_UNKNOWN = 0;
        ACTION_STARTED = 1;
        ACTION_STOPPED = 2;
    }

    Action action = 1;
}

// Extension name: "screen_type"
// Sent by host to client.
message ScreenType
{
    enum Type
    {
        TYPE_UNKNOWN = 0;
        TYPE_DESKTOP = 1;
        TYPE_LOCK    = 2;
        TYPE_LOGIN   = 3;
        TYPE_OTHER   = 4;
    }

    Type type   = 1;
    string name = 2;
}
