* @package MCMS\System\Component */ interface iComEditor extends iComponent { // param key constances const P_KEY_LOCALE = 'locale'; const P_KEY_VARIANT = 'variant'; const P_KEY_SIZE = 'size'; // param value constances const P_VALUE_LOCALE_DEFAULT = ''; const P_VALUE_SIZE_DEFAULT = -1; const P_VALUE_VAR_SHORT = 'short'; const P_VALUE_VAR_DEFAULT = 'default'; const P_VALUE_VAR_LONG = 'long'; /** * * @return string the handled datatype (string, int, float, date, datetime, text, * html, ...) */ public static function getHandledDataType(); /** * loads the data of the element from an object. * the object attribute name has * to match the form element name. * * @param $object iModel * a model object * @return boolean true if the value was loaded successfull, false if the value hasn't * been found */ public function loadFromObject(\MCMS\Model\iModel $object); // define the form element id public function getID(); public function setID($id); public function isReadOnly(); public function setReadOnly($value); // define the form element name public function getName(); public function setName($name); // typical params public function getParams(); public function getParam($key, $default = NULL); public function setParam($key, $value); public function delParam($key); // getter/setter for the id of the parent form. // this id can be used to unique scripts inside a form public function getFormID(); public function setFormID($id); public function getCSSClass(); public function setCSSClass($data); public function resetCSSClass(); // reset to default public function isRequired(); public function setRequired($required); public function getValue(); public function setValue($data); /** * generates the content into an array with the structure:
* html: the html code
* js: generic javascript code which will be added into the form
* js_import: array of javascript files which should be imported
* js_submit: javascript function call which will be added to the submit event, * function has to return true if valid
* * @return array the generated content */ public function generate($parent); }