#ifndef __PAGEPRNT_H #define __PAGEPRNT_H #ifndef __ASSOC_H #include #endif #ifndef __WINDOW_H #include #endif class TReport_font : public TObject { enum { DEFAULT_FONT_SIZE = 10 }; TString _name; int _size, _cpi; bool _bold, _italic, _underline; TArray _physical; public: const TString& name() const { return _name; } int size() const { return _size; } XVT_FNTID get_xvt_font(WINDOW win, int size) const; TReport_font(); virtual ~TReport_font() { } }; class TReport_section : public TArray { const TReport_section* _father; char _type; // Head,Body,Tail int _level; // 0,1,2,... TReport_font* _font; public: char type() const { return _type; } int level() const { return _level; } void description(TString& str) const; const TReport_font& font() const; TReport_section(const TReport_section* f, char t, int l); virtual ~TReport_section(); }; class TReport_field : public TObject { TReport_section* _section; char _type; // Text, String, Numeric, Date, Line, Rectangle, Image short _x, _y; // Coordinate in centesimi short _width, _height; // Dimensioni in centesimi COLOR _color; TString _picture, _field; TReport_font* _font; bool _selected; public: char type() const { return _type; } const TReport_font& font() const; const TString& picture() const { return _picture; } void set_pos(short x, short y); void set_size(short w, short h); void get_rect(RCT& rct) const; COLOR color() const { return _color; } void select(bool ok = true) { _selected = ok; } bool selected() const { return _selected; } void offset(const TPoint& pt); TReport_field(TReport_section* sec); }; class TReport : public TObject { TAssoc_array _sections; int _cpi, _lpi; protected: void build_section_key(char type, int level, TString& key) const; public: TReport_section* find_section(char type, int level) const; TReport_section& section(char type, int level); TReport_section& background_section(char type) { return section(type, 0); } int cpi() const { return _cpi; } int lpi() const { return _lpi; } TReport(); }; class TPage_printer : public TWindow { protected: long _pw, _ph, _phr, _pvr; // Printer width, height, horizontal and vertical resolution word _copies; word _pagefrom; word _pageto; bool _aborted; public: virtual int pages() const pure; virtual bool print_page(int p) pure; virtual const char* form_name() const; virtual const char* font_name() const; virtual int font_size() const; virtual bool ask_pages(); virtual bool print(); TPage_printer(); virtual ~TPage_printer(); }; #endif