      1  #ifndef INVOICEPRINTER_H
      2  #define INVOICEPRINTER_H
      3
      4  #include <string>
      5
      6  using namespace std;
      7
      8  /**
      9     Formats an invoice.
     10  */
     11  class InvoicePrinter
     12  {
     13  public:
     14     /**
     15        Prints the invoice header.
     16        @param s the header string
     17     */
     18     virtual void print_header(string s) = 0;
     19     /**
     20        Prints a string in the next table cell
     21        @param value the value to print
     22        @param pad_right true if the cell is padded on the right
     23        with spaces
     24     */
     25     virtual void print_string(string value, bool pad_right) = 0;
     26     /**
     27        Prints a number in the next table cell
     28        @param value the value to print
     29        @param precision the number of digits after the decimal point
     30     */
     31     virtual void print_number(double value, int precision) = 0;
     32     /**
     33        Prints the invoice footer.
     34        @param s the footer string
     35        @param total the total amount due
     36     */
     37     virtual void print_footer(string s, double total) = 0;
     38  };
     39
     40  #endif