// Copyright 2024 Google LLC
//
// 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";

package designcompose.definition.plugin;

import "definition/element/color.proto";

option java_multiple_files = true;
option java_package = "com.android.designcompose.definition.plugin";
option optimize_for = LITE_RUNTIME;

// Some frame properties are only available through the plugin API and are
// needed to implement Reactions properly. They're included in this FrameExtras
// struct.
message FrameExtras {
  // The number of children of this frame that are fixed.
  uint32 fixed_children = 1;
  // How the overlay is positioned.
  OverlayPositionType overlay_position_type = 2;
  // The background of the overlay.
  OverlayBackground overlay_background = 3;
  // How the overlay interacts with the background.
  OverlayBackgroundInteraction overlay_background_interaction = 4;
}

// Defines the position of an overlay within a frame.
enum OverlayPositionType {
  OVERLAY_POSITION_TYPE_UNSPECIFIED = 0;
  OVERLAY_POSITION_TYPE_CENTER = 1;
  OVERLAY_POSITION_TYPE_TOP_LEFT = 2;
  OVERLAY_POSITION_TYPE_TOP_CENTER = 3;
  OVERLAY_POSITION_TYPE_TOP_RIGHT = 4;
  OVERLAY_POSITION_TYPE_BOTTOM_LEFT = 5;
  OVERLAY_POSITION_TYPE_BOTTOM_CENTER = 6;
  OVERLAY_POSITION_TYPE_BOTTOM_RIGHT = 7;
  OVERLAY_POSITION_TYPE_MANUAL = 8;
}

// The color of the overlay background.
message OverlayBackground {
  definition.element.FloatColor color = 1;
}

// Defines how an overlay interacts with its background. It specifies whether
// the overlay can be closed by clicking outside of it or if there's no
// interaction.
enum OverlayBackgroundInteraction {
  OVERLAY_BACKGROUND_INTERACTION_UNSPECIFIED = 0;
  OVERLAY_BACKGROUND_INTERACTION_NONE = 1;
  OVERLAY_BACKGROUND_INTERACTION_CLOSE_ON_CLICK_OUTSIDE = 2;
}
