/*
 * Copyright 2021 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.
 *
 * ---------------------------------------------------------------------
 *
 * Portions of this file were modified and ported to Vala by Victor Vintorez in 2026.
 * These modifications are licensed under the European Union Public License (EUPL),
 * Version 1.2 or later. You may obtain a copy of the License at:
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 */

using GLib;

namespace MaterialColorUtilities {
	/** All available spec versions. */
	public enum SpecVersion {
		SPEC_2021,
		SPEC_2025,
		SPEC_2026,
	}

	/** An interface defining all the necessary methods that could be different between specs. */
	public interface ColorSpec : Object {
		////////////////////////////////////////////////////////////////
		// Main Palettes                                              //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor primary_palette_key_color { owned get; }
		public abstract DynamicColor secondary_palette_key_color { owned get; }
		public abstract DynamicColor tertiary_palette_key_color { owned get; }
		public abstract DynamicColor neutral_palette_key_color { owned get; }
		public abstract DynamicColor neutral_variant_palette_key_color { owned get; }
		public abstract DynamicColor? error_palette_key_color { owned get; }

		////////////////////////////////////////////////////////////////
		// Surfaces [S]                                               //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor background { owned get; }
		public abstract DynamicColor on_background { owned get; }
		public abstract DynamicColor surface { owned get; }
		public abstract DynamicColor surface_dim { owned get; }
		public abstract DynamicColor surface_bright { owned get; }
		public abstract DynamicColor surface_container_lowest { owned get; }
		public abstract DynamicColor surface_container_low { owned get; }
		public abstract DynamicColor surface_container { owned get; }
		public abstract DynamicColor surface_container_high { owned get; }
		public abstract DynamicColor surface_container_highest { owned get; }
		public abstract DynamicColor on_surface { owned get; }
		public abstract DynamicColor surface_variant { owned get; }
		public abstract DynamicColor on_surface_variant { owned get; }
		public abstract DynamicColor inverse_surface { owned get; }
		public abstract DynamicColor inverse_on_surface { owned get; }
		public abstract DynamicColor outline { owned get; }
		public abstract DynamicColor outline_variant { owned get; }
		public abstract DynamicColor shadow { owned get; }
		public abstract DynamicColor scrim { owned get; }
		public abstract DynamicColor surface_tint { owned get; }

		////////////////////////////////////////////////////////////////
		// Primaries [P]                                              //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor primary { owned get; }
		public abstract DynamicColor? primary_dim { owned get; }
		public abstract DynamicColor on_primary { owned get; }
		public abstract DynamicColor primary_container { owned get; }
		public abstract DynamicColor on_primary_container { owned get; }
		public abstract DynamicColor inverse_primary { owned get; }

		////////////////////////////////////////////////////////////////
		// Secondaries [Q]                                            //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor secondary { owned get; }
		public abstract DynamicColor? secondary_dim { owned get; }
		public abstract DynamicColor on_secondary { owned get; }
		public abstract DynamicColor secondary_container { owned get; }
		public abstract DynamicColor on_secondary_container { owned get; }

		////////////////////////////////////////////////////////////////
		// Tertiaries [T]                                             //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor tertiary { owned get; }
		public abstract DynamicColor? tertiary_dim { owned get; }
		public abstract DynamicColor on_tertiary { owned get; }
		public abstract DynamicColor tertiary_container { owned get; }
		public abstract DynamicColor on_tertiary_container { owned get; }

		////////////////////////////////////////////////////////////////
		// Errors [E]                                                 //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor error { owned get; }
		public abstract DynamicColor? error_dim { owned get; }
		public abstract DynamicColor on_error { owned get; }
		public abstract DynamicColor error_container { owned get; }
		public abstract DynamicColor on_error_container { owned get; }

		////////////////////////////////////////////////////////////////
		// Primary Fixed Colors [PF]                                  //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor primary_fixed { owned get; }
		public abstract DynamicColor primary_fixed_dim { owned get; }
		public abstract DynamicColor on_primary_fixed { owned get; }
		public abstract DynamicColor on_primary_fixed_variant { owned get; }

		////////////////////////////////////////////////////////////////
		// Secondary Fixed Colors [QF]                                //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor secondary_fixed { owned get; }
		public abstract DynamicColor secondary_fixed_dim { owned get; }
		public abstract DynamicColor on_secondary_fixed { owned get; }
		public abstract DynamicColor on_secondary_fixed_variant { owned get; }

		////////////////////////////////////////////////////////////////
		// Tertiary Fixed Colors [TF]                                 //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor tertiary_fixed { owned get; }
		public abstract DynamicColor tertiary_fixed_dim { owned get; }
		public abstract DynamicColor on_tertiary_fixed { owned get; }
		public abstract DynamicColor on_tertiary_fixed_variant { owned get; }

		//////////////////////////////////////////////////////////////////
		// Android-only Colors                                          //
		//////////////////////////////////////////////////////////////////

		public abstract DynamicColor control_activated { owned get; }
		public abstract DynamicColor control_normal { owned get; }
		public abstract DynamicColor control_highlight { owned get; }
		public abstract DynamicColor text_primary_inverse { owned get; }
		public abstract DynamicColor text_secondary_and_tertiary_inverse { owned get; }
		public abstract DynamicColor text_primary_inverse_disable_only { owned get; }
		public abstract DynamicColor text_secondary_and_tertiary_inverse_disabled { owned get; }
		public abstract DynamicColor text_hint_inverse { owned get; }

		////////////////////////////////////////////////////////////////
		// Other                                                      //
		////////////////////////////////////////////////////////////////

		public abstract DynamicColor highest_surface (DynamicScheme s);

		/////////////////////////////////////////////////////////////////
		// Color value calculations                                    //
		/////////////////////////////////////////////////////////////////

		public abstract Hct get_hct (DynamicScheme scheme, DynamicColor color);

		public abstract double get_tone (DynamicScheme scheme, DynamicColor color);

		//////////////////////////////////////////////////////////////////
		// Scheme Palettes                                              //
		//////////////////////////////////////////////////////////////////

		public abstract TonalPalette get_primary_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);

		public abstract TonalPalette get_secondary_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);

		public abstract TonalPalette get_tertiary_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);

		public abstract TonalPalette get_neutral_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);

		public abstract TonalPalette get_neutral_variant_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);

		public abstract TonalPalette ? get_error_palette (Variant variant, Hct source_color_hct, bool is_dark, Platform platform, double contrast_level);
	}
}
