<?php
require_once "SiemensXMLElement.php";

class IppForm extends SiemensXMLElement {
	
	const Proportion0_100 = "0_100";  //left column: 0% - right column: 100%
	const Proportion15_85 = "15_85";  //left column: 15% - right column: 85%
	const Proportion25_75 = "25_75";  //left column: 27% - right column: 75%
	const Proportion40_60 = "40_60";  //left column: 40% - right column: 60%
	const Proportion50_50 = "50_50";  //left column: 50% - right column: 50%
	const Proportion60_40 = "60_40";  //left column: 60% - right column: 40%
	const Proportion75_25 = "75_25";  //left column: 75% - right column: 25%
	
	private $proportion = null;
	
	public function __construct($proportion = IppForm::Proportion50_50,$itemCount=null) {
		
		$attributes = array();
		$attributes["Proportion"] = $proportion;
		$attributes["ItemCount"] = $itemCount;
		
		parent::__construct($attributes);
	}
	
	protected function name() {
		return "IppForm";
	}
	
	/**
	 * adds an option into the list. Please use this method instead of addUIElement directly, cause of the Count attribute!
	 * @param Option $option
	 */	
	public function addOption(IppImageItem $count) {
		
		$currentCount = @$this->attributes["ItemCount"];
		$this->attributes["ItemCount"] = (int) $currentCount + 1;

		$this->addUIElement($count);
		
	}
	
	
}