4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Output;
14 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
17 * OutputInterface is the interface implemented by all Output classes.
19 * @author Fabien Potencier <fabien@symfony.com>
21 interface OutputInterface
23 const VERBOSITY_QUIET = 16;
24 const VERBOSITY_NORMAL = 32;
25 const VERBOSITY_VERBOSE = 64;
26 const VERBOSITY_VERY_VERBOSE = 128;
27 const VERBOSITY_DEBUG = 256;
29 const OUTPUT_NORMAL = 1;
31 const OUTPUT_PLAIN = 4;
34 * Writes a message to the output.
36 * @param string|array $messages The message as an array of strings or a single string
37 * @param bool $newline Whether to add a newline
38 * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
40 public function write($messages, $newline = false, $options = 0);
43 * Writes a message to the output and adds a newline at the end.
45 * @param string|array $messages The message as an array of strings or a single string
46 * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
48 public function writeln($messages, $options = 0);
51 * Sets the verbosity of the output.
53 * @param int $level The level of verbosity (one of the VERBOSITY constants)
55 public function setVerbosity($level);
58 * Gets the current verbosity of the output.
60 * @return int The current level of verbosity (one of the VERBOSITY constants)
62 public function getVerbosity();
65 * Returns whether verbosity is quiet (-q).
67 * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise
69 public function isQuiet();
72 * Returns whether verbosity is verbose (-v).
74 * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
76 public function isVerbose();
79 * Returns whether verbosity is very verbose (-vv).
81 * @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise
83 public function isVeryVerbose();
86 * Returns whether verbosity is debug (-vvv).
88 * @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise
90 public function isDebug();
93 * Sets the decorated flag.
95 * @param bool $decorated Whether to decorate the messages
97 public function setDecorated($decorated);
100 * Gets the decorated flag.
102 * @return bool true if the output will decorate messages, false otherwise
104 public function isDecorated();
106 public function setFormatter(OutputFormatterInterface $formatter);
109 * Returns current output formatter instance.
111 * @return OutputFormatterInterface
113 public function getFormatter();