b6d60057f4
Files correlati : reports Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@12120 c028cbd2-c16b-5b4b-a496-9718f37d4682
96 lines
2.4 KiB
C++
Executable File
96 lines
2.4 KiB
C++
Executable File
#ifndef __REPRINT_H
|
|
#define __REPRINT_H
|
|
|
|
#ifndef __REPORT_H
|
|
#include <report.h>
|
|
#endif
|
|
|
|
class TBook : public TObject
|
|
{
|
|
size_t _page, _pages;
|
|
|
|
TPointer_array _index;
|
|
TFilename _file;
|
|
ofstream* _out;
|
|
bool _is_temporary;
|
|
|
|
DRAW_CTOOLS _tools;
|
|
TReport_font _font;
|
|
TRectangle _rect;
|
|
char _horizontal_alignment, _vertical_alignment;
|
|
|
|
size_t _pagefrom, _pageto, _copies;
|
|
|
|
protected:
|
|
PRINT_RCD* _rcd;
|
|
long _ph, _pw, _pvr, _phr;
|
|
bool _page_is_open;
|
|
|
|
virtual void define_frame(const TRectangle& rect);
|
|
virtual bool init();
|
|
|
|
public:
|
|
virtual bool open_page();
|
|
virtual bool close_page();
|
|
virtual bool main_loop();
|
|
|
|
void set_pen(COLOR color, int width = 0, PEN_STYLE style = P_SOLID);
|
|
void set_brush(COLOR color, PAT_STYLE pattern = PAT_SOLID);
|
|
void set_font(const TReport_font& font);
|
|
void set_text_color(COLOR fore, COLOR back = COLOR_WHITE, bool opaque = false);
|
|
void set_text_align(char halign ='L', char valign = 'T');
|
|
void draw_rectangle(const TRectangle& rect);
|
|
void draw_ellipse(const TRectangle& rect);
|
|
void draw_line(const TRectangle& rect);
|
|
void draw_image(const TRectangle& rect, const char* filename);
|
|
void draw_text(const TRectangle& rect, const char* text);
|
|
void draw_link(const TRectangle& rect, const char* text, const char* link);
|
|
|
|
TPoint page_size() const;
|
|
TPoint page_res() const;
|
|
size_t page() const { return _page; }
|
|
size_t pages() const { return _pages; }
|
|
|
|
virtual bool print_page(TWindow& win, size_t page);
|
|
|
|
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
|
|
virtual bool preview();
|
|
bool print_or_preview(); // Calls one of the above
|
|
|
|
TBook(const char* name);
|
|
virtual ~TBook();
|
|
};
|
|
|
|
|
|
class TReport_book : public TBook
|
|
{
|
|
TReport* _report;
|
|
long _logical_page_height, _logical_page_width;
|
|
long _logical_foot_pos;
|
|
bool _is_last_page, _page_break_allowed;
|
|
TPoint _delta;
|
|
|
|
protected:
|
|
virtual bool open_page();
|
|
virtual bool close_page();
|
|
|
|
TPoint log2dev(const TPoint& ptlog) const;
|
|
virtual void define_frame(const TRectangle& r);
|
|
|
|
bool init(TReport& rep);
|
|
long print_section(TReport_section& rs);
|
|
long print_section(char type, int level);
|
|
void create_links(const TReport_section& rs);
|
|
|
|
public:
|
|
bool add(TReport& report);
|
|
|
|
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
|
|
|
|
TReport_book(const char* name = NULL) : TBook(name) { }
|
|
};
|
|
|
|
void abort_printing();
|
|
|
|
#endif
|