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