package App::POS::Printer::TOSHIBA;

use strict;
use warnings;

use base qw( App::Class );

sub tweak_content {}

sub init {
  my $self = shift;
}

sub logo {
  return "";
}

sub document_start {
  return
    chr(0x1B).
    chr(0x40).
    chr(0x1B).
    chr(0x63).
    chr(0x34).
    chr(0x02).
    chr(0x1B).
    chr(0x74).
    chr(0x03);
}

sub document_end {
  return
    chr(0x1B).
    chr(0x64).
    chr(0x08).
    chr(0x1B).
    chr(0x69);
}

sub print_invert {
  return
    chr(0x1B).
    chr(0x7B).
    chr(0x01);
}

sub print_normal {
  return
    chr(0x1B).
    chr(0x7B).
    chr(0x00);
}

sub black {
  return
    chr(0x1B).
    chr(0x72).
    chr(0x00);
}

sub red {
  return
    chr(0x1b).
    chr(0x45).
    chr(0x01);
}

sub bold {
  return
    chr(0x1B).
    chr(0x45).
    chr(0x00);
}

sub size_small {
  return
    chr(0x1B).
    chr(0x4D).
    chr(0x01);
}

sub size_double {
  return
    chr(0x1B).
    chr(0x21).
    chr(0x20);
}

sub size_huge {
  return
    chr(0x1D).
    chr(0x21).
    chr(0x71);
}

sub size_normal {
  return
    chr(0x1B).
    chr(0x21).
    chr(0x00);
}

sub underlined {
  return
    chr(0x1B).
    chr(0x2D).
    chr(0x01);
}

sub underlined_off {
  return
    chr(0x1B).
    chr(0x2D).
    chr(0x00);
}

sub line_change {
  return
    chr(0x0D).
    chr(0x0A);
}

sub cashdrawer1_open {
  return
    chr(0x1B).
    chr(0x70).
    chr(0x00).
    chr(0x60).
    chr(0xFF);
}

sub cashdrawer2_open {
  return
    chr(0x1B).
    chr(0x70).
    chr(0x01).
    chr(0x60).
    chr(0xFF);
}

sub paper_cut {
  return
    chr(0x1B).
    chr(0x64).
    chr(0x08).
    chr(0x1B).
    chr(0x69);
}

sub bell {
  return
    chr(0x07);
}

sub line_spacing_normal {
  return "";
}

sub line_spacing_big {
  return "";
}

sub justify_right {
  return
    chr(0x1B).chr(0x61).2
}
sub justify_center {
  return
    chr(0x1B).chr(0x61).1;
}

sub justify_left {
  return
    chr(0x1B).chr(0x61).0;
}

sub barcode {
  return barcode_ean13();
  #return barcode_39();
}

sub barcode_39 {
  return (
    chr(0x1B).chr(0x61).1,
    chr(0x1D)."h".chr(50),
    chr(0x1D)."k".chr(4),
    "#BARCODE#".chr(0),
  );
}

sub barcode_ean13 {
  return (
    chr(0x1B).chr(0x61).1,
    chr(0x1D)."h".chr(50),
    chr(0x1D)."k".chr(2),
    "#BARCODE#".chr(0),
  );
}

sub barcode_small {
  return ();
}

sub barcode_big {
  return ();
}

1;

