<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Shared\Escher;

use TablePress\PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException;

class DggContainer
{
	/**
	 * Maximum shape index of all shapes in all drawings increased by one.
	 */
	private int $spIdMax;

	/**
	 * Total number of drawings saved.
	 */
	private int $cDgSaved;

	/**
	 * Total number of shapes saved (including group shapes).
	 */
	private int $cSpSaved;

	/**
	 * BLIP Store Container.
	 */
	private ?DggContainer\BstoreContainer $bstoreContainer = null;

	/**
	 * Array of options for the drawing group.
	 *
	 * @var mixed[]
	 */
	private array $OPT = [];

	/**
	 * Array of identifier clusters containing information about the maximum shape identifiers.
	 *
	 * @var mixed[]
	 */
	private array $IDCLs = [];

	/**
	 * Get maximum shape index of all shapes in all drawings (plus one).
	 */
	public function getSpIdMax(): int
	{
		return $this->spIdMax;
	}

	/**
	 * Set maximum shape index of all shapes in all drawings (plus one).
	 */
	public function setSpIdMax(int $value): void
	{
		$this->spIdMax = $value;
	}

	/**
	 * Get total number of drawings saved.
	 */
	public function getCDgSaved(): int
	{
		return $this->cDgSaved;
	}

	/**
	 * Set total number of drawings saved.
	 */
	public function setCDgSaved(int $value): void
	{
		$this->cDgSaved = $value;
	}

	/**
	 * Get total number of shapes saved (including group shapes).
	 */
	public function getCSpSaved(): int
	{
		return $this->cSpSaved;
	}

	/**
	 * Set total number of shapes saved (including group shapes).
	 */
	public function setCSpSaved(int $value): void
	{
		$this->cSpSaved = $value;
	}

	/**
	 * Get BLIP Store Container.
	 */
	public function getBstoreContainer(): ?DggContainer\BstoreContainer
	{
		return $this->bstoreContainer;
	}

	/**
	 * Get BLIP Store Container.
	 */
	public function getBstoreContainerOrThrow(): DggContainer\BstoreContainer
				{
					if (!isset($this->bstoreContainer)) {
						throw new SpreadsheetException('bstoreContainer is unexpectedly null');
					}
					return $this->bstoreContainer;
				}

	/**
	 * Set BLIP Store Container.
	 */
	public function setBstoreContainer(DggContainer\BstoreContainer $bstoreContainer): void
	{
		$this->bstoreContainer = $bstoreContainer;
	}

	/**
				 * Set an option for the drawing group.
				 *
				 * @param int $property The number specifies the option
				 * @param mixed $value
				 */
				public function setOPT(int $property, $value): void
	{
		$this->OPT[$property] = $value;
	}

	/**
				 * Get an option for the drawing group.
				 *
				 * @param int $property The number specifies the option
				 * @return mixed
				 */
				public function getOPT(int $property)
	{
		if (isset($this->OPT[$property])) {
			return $this->OPT[$property];
		}

		return null;
	}

	/**
	 * Get identifier clusters.
	 *
	 * @return mixed[]
	 */
	public function getIDCLs(): array
	{
		return $this->IDCLs;
	}

	/**
	 * Set identifier clusters. [<drawingId> => <max shape id>, ...].
	 *
	 * @param mixed[] $IDCLs
	 */
	public function setIDCLs(array $IDCLs): void
	{
		$this->IDCLs = $IDCLs;
	}
}
