1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Forms;
 9: 
10: 
11: /**
12:  * Defines method that must be implemented to allow a component to act like a form control.
13:  */
14: interface IControl
15: {
16: 
17:     /**
18:      * Sets control's value.
19:      * @param  mixed
20:      * @return void
21:      */
22:     function setValue($value);
23: 
24:     /**
25:      * Returns control's value.
26:      * @return mixed
27:      */
28:     function getValue();
29: 
30:     /**
31:      * @return void
32:      */
33:     function validate();
34: 
35:     /**
36:      * Returns errors corresponding to control.
37:      * @return array
38:      */
39:     function getErrors();
40: 
41:     /**
42:      * Is control value excluded from $form->getValues() result?
43:      * @return bool
44:      */
45:     function isOmitted();
46: 
47:     /**
48:      * Returns translated string.
49:      * @param  string
50:      * @param  int      plural count
51:      * @return string
52:      */
53:     function translate($s, $count = NULL);
54: 
55: }
56: