use p101_is::Register;
use rust_decimal::Decimal;
use crate::message::Operator;

/// The trait defines common aspects of a printer device.
/// It defines:
/// - two function for writing text to whatever output media
/// - a function to get printer's name
pub trait PrinterProvider {
    fn get_name(&self) -> &str;

    /// Prints the text in the value area, right padded.
    fn print_value(&mut self, value: Decimal);

    /// Prints the register in the register column.
    fn print_register(&mut self, register: Register);

    /// Prints the operator in the operator column.
    fn print(&mut self, value: Decimal, register: Register, operator: Operator);

    /// Advance the "paper" to a new line.
    fn newline(&mut self);
}
