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