home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 February
/
PCWorld_2000-02_cd.bin
/
Software
/
TemaCD
/
tcvpa
/
data1.cab
/
MyFileGroup
/
INCLUDE
/
tcReport.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-03
|
4KB
|
144 lines
#ifndef _INC_TCREPORT_HPP
#define _INC_TCREPORT_HPP
#include <TcPch.hpp>
#include <Lio.hpp>
#include <TcWinExt.hpp>
#include <TcCoreEx.hpp>
#include <TcRp1.h>
#include <TcRp2.h>
#include <TcImgVi.h>
class TC_CReportClient;
class TC_CReportPreview;
BOOL tcInitReport () ;
#define TC_EVENT_RptClient "RptClien"
// **********************************************************************
struct TC_EvRptClient
: TC_Event
{
public:
enum EEvCode {
id_FileName,
id_ThreadEnter,
id_Execute,
id_FetchNext,
id_PaintBegin,
id_PaintEnd,
id_ThreadExit,
id_PrintDone,
};
public: EEvCode code ;
public: TC_CReportClient* client ;
union {
public: LPCSTR file_name ;
public: LPCSTR section ;
public: TcRp1PaintStruct* paint_struct ;
}; // union
public: TC_EvRptClient (EEvCode evCode, TC_CReportClient *rptClient)
{
event = TC_EVENT_RptClient;
code = evCode;
client = rptClient;
file_name = 0;
} // end of func
// **********************************************************************
}; // end of class TC_EvRptClient
// **********************************************************************
// **********************************************************************
class TC_CReportClient
: public TC_CEventMaster
{
friend class TC_CReportPreview;
public:
enum EMode {
mode_Print,
mode_Preview,
};
private: DWORD m_Server ;
private: HWND m_hWndParent ;
private: TC_CReportClient** m_ThisPtr ;
protected: int m_WaitStatus ;
protected: int m_DoneStatus ;
private: BOOL m_IsPreview ;
private: TC_CReportPreview* m_PreviewFrm ;
protected: int m_CurPage ;
protected: int m_TotalPages ;
public: TC_CReportClient (HWND parent, EMode rptMode, TC_CReportClient **thisPtr) ;
public: virtual ~TC_CReportClient () ;
protected: virtual TC_CReportClient* Clone (HWND parent, EMode mode, TC_CReportClient **thisPtr) ;
public: BOOL Start () ;
protected: void PrevPage () ;
protected: void NextPage () ;
public: BOOL IsPrinting () ;
public: BOOL IsPreview () ;
protected: static DWORD CALLBACK CallBackProc (TC_CReportClient *obj, DWORD cmd, DWORD arg) ;
protected: long ThisCallBackProc (int cmd, long arg) ;
public: void SetVar (LPCSTR name, LPCSTR val) ;
public: void SetVar (LPCSTR name, TC_CDate &date, LPCSTR fmt=0) ;
public: void SetVar (LPCSTR name, TC_CTime &time, LPCSTR fmt=0) ;
public: void SetVar (LPCSTR name, char chr) ;
public: void SetVar (LPCSTR name, TC_CBCD &bcd, char *fmt=0) ;
public: void SetVar (LPCSTR name, short sh, char *fmt=0) ;
public: void SetVar (LPCSTR name, long l, char *fmt=0) ;
public: void SetVar (LPCSTR name, float f, char *fmt=0) ;
public: void SetVar (LPCSTR name, double d, char *fmt=0) ;
protected: LPCSTR FileName () ;
protected: BOOL CB_ThreadEnter () ;
protected: BOOL CB_Execute (LPCSTR rpt_section) ;
protected: BOOL CB_FetchNext (LPCSTR rpt_section) ;
protected: BOOL CB_PaintBegin (TcRp1PaintStruct *ps) ;
protected: BOOL CB_PaintEnd (TcRp1PaintStruct *ps) ;
protected: BOOL CB_ThreadExit () ;
protected: BOOL CB_PrintDone (int status) ;
protected: BOOL Ev_Router (TC_EvRptClient *ev) ;
}; // end of class TC_CReportClient
// **********************************************************************
// **********************************************************************
class TC_CReportPreview
: public TC_CWindow
{
friend class TC_CReportClient;
protected: TC_CWindow* m_Tb ;
protected: TC_CToolbarMaster* m_TbMaster ;
protected: TC_CReportClient* m_ClientPrint ;
protected: TC_CReportClient* m_ClientView ;
protected: HWND m_hWndStatus ;
public:
enum {
TbBtn_PrevPage,
TbBtn_NextPage,
TbBtn_Shrink8,
TbBtn_Shrink4,
TbBtn_Shrink2,
TbBtn_OrigSize,
TbBtn_Enlarge2,
TbBtn_Print,
};
protected: static char bmpToolbar [];
public: TC_CReportPreview (TC_CReportClient *rptView) ;
public: ~TC_CReportPreview () ;
public: BOOL Form_Creator (TC_CWindow *frame) ;
public: AWindow * mc_View;
protected: void ToolbarMaker () ;
protected: void UpdateToolbar () ;
public: void Print () ;
public: BOOL Ev_WmChar (TC_Event_WM *ev) ;
public: BOOL Ev_ToolbarCmd (TC_Event *ev) ;
public: BOOL Ev_WmDestroy (TC_Event*) ;
}; // end of class TC_CReportPreview
// **********************************************************************
#endif // _INC_TCREPORT_HPP