1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: */
11:
12: namespace Nette\Forms;
13:
14: use Nette;
15:
16:
17: /**
18: * Defines method that must be implemented to allow a component to act like a form control.
19: *
20: * @author David Grudl
21: */
22: interface IControl
23: {
24:
25: /**
26: * Loads HTTP data.
27: * @return void
28: */
29: function loadHttpData();
30:
31: /**
32: * Sets control's value.
33: * @param mixed
34: * @return void
35: */
36: function setValue($value);
37:
38: /**
39: * Returns control's value.
40: * @return mixed
41: */
42: function getValue();
43:
44: /**
45: * @return Rules
46: */
47: function getRules();
48:
49: /**
50: * Returns errors corresponding to control.
51: * @return array
52: */
53: function getErrors();
54:
55: /**
56: * Is control disabled?
57: * @return bool
58: */
59: function isDisabled();
60:
61: /**
62: * Returns translated string.
63: * @param string
64: * @param int plural count
65: * @return string
66: */
67: function translate($s, $count = NULL);
68:
69: }
70: