home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / REPORT.HPP < prev    next >
C/C++ Source or Header  |  1997-01-16  |  13KB  |  388 lines

  1. //----------------------------------------------------------------------------
  2. // Report.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: Report.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef ReportHPP
  6. #define ReportHPP
  7. //----------------------------------------------------------------------------
  8. #include <Bde.hpp>
  9. #include <Messages.hpp>
  10. #include <DsgnIntf.hpp>
  11. #include <DB.hpp>
  12. #include <DdeMan.hpp>
  13. #include <Forms.hpp>
  14. #include <Controls.hpp>
  15. #include <Classes.hpp>
  16. #include <Windows.hpp>
  17. #include <SysUtils.hpp>
  18. #include <System.hpp>
  19. #pragma warn -par
  20. #pragma warn -hid 
  21. #pragma warn -inl
  22.  
  23. namespace Report
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. class __declspec(delphiclass) EReportError;
  27. class __declspec(pascalimplementation) EReportError : public Sysutils::Exception
  28. {
  29.     typedef Sysutils::Exception inherited;
  30.     
  31. public:
  32.     /* Exception.Create */ __fastcall EReportError(const System::AnsiString Msg) : Sysutils::Exception(
  33.         Msg) { }
  34.     /* Exception.CreateFmt */ __fastcall EReportError(const System::AnsiString Msg, const System::TVarRec 
  35.         *Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  36.     /* Exception.CreateRes */ __fastcall EReportError(int Ident) : Sysutils::Exception(Ident) { }
  37.     /* Exception.CreateResFmt */ __fastcall EReportError(int Ident, const System::TVarRec *Args, const 
  38.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  39.     /* Exception.CreateHelp */ __fastcall EReportError(const System::AnsiString Msg, int AHelpContext) : 
  40.         Sysutils::Exception(Msg, AHelpContext) { }
  41.     /* Exception.CreateFmtHelp */ __fastcall EReportError(const System::AnsiString Msg, const System::TVarRec 
  42.         *Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  43.         ) { }
  44.     /* Exception.CreateResHelp */ __fastcall EReportError(int Ident, int AHelpContext) : Sysutils::Exception(
  45.         Ident, AHelpContext) { }
  46.     /* Exception.CreateResFmtHelp */ __fastcall EReportError(int Ident, const System::TVarRec *Args, const 
  47.         int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
  48.     
  49. public:
  50.     /* TObject.Destroy */ __fastcall virtual ~EReportError(void) { }
  51.     
  52. };
  53.  
  54. #pragma option -b
  55. enum TLaunchType { ltDefault, ltRunTime, ltDesignTime };
  56. #pragma option -b.
  57. class __declspec(delphiclass) TReport;
  58. class __declspec(delphiclass) TReportManager;
  59. struct TCallInfo;
  60. typedef TCallInfo *PCallInfo;
  61.  
  62. struct TSQLStruct;
  63. typedef TSQLStruct *PSQLStruct;
  64.  
  65. struct TExecInfo;
  66. typedef TExecInfo *PExecInfo;
  67.  
  68. struct TStartExecInfo;
  69. typedef TStartExecInfo *PStartExecInfo;
  70.  
  71. struct TDataElement;
  72. typedef TDataElement *PDataElement;
  73.  
  74. struct TMemoStruct;
  75. typedef TMemoStruct *PMemoStruct;
  76.  
  77. class __declspec(pascalimplementation) TReportManager : public Classes::TComponent
  78. {
  79.     typedef Classes::TComponent inherited;
  80.     
  81. private:
  82.     Classes::TList* FReports;
  83.     Classes::TList* FDataSets;
  84.     HWND FHandle;
  85.     System::AnsiString FLastError;
  86.     bool FUpdated;
  87.     void __fastcall ServerProc(PCallInfo Value);
  88.     void __fastcall WndProc(Messages::TMessage &Message);
  89.     
  90. public:
  91.     __fastcall virtual TReportManager(Classes::TComponent* AOwner);
  92.     __fastcall virtual ~TReportManager(void);
  93.     void __fastcall Add(TReport* Value);
  94.     void __fastcall AddDataSet(Classes::TComponent* Root);
  95.     void __fastcall Clear(void);
  96.     DWord __fastcall EndSQL(PSQLStruct SQLStruct);
  97.     DWord __fastcall ExecuteSQL(PExecInfo ExecInfo, PStartExecInfo StartExecInfo);
  98.     DWord __fastcall GetColumnList(char * Buffer);
  99.     DWord __fastcall GetData(Db::TDataSet* DataSet, PDataElement pStmtMem);
  100.     Db::TDataSet* __fastcall GetDataSet(int Index);
  101.     Db::TDataSet* __fastcall GetDataSetByName( System::AnsiString Value);
  102.     Classes::TList* __fastcall GetDataSets(void);
  103.     DWord __fastcall GetMemo(PMemoStruct MemoStruct);
  104.     DWord __fastcall GetNext(PSQLStruct SQLStruct, DWord &MoreData);
  105.     TReport* __fastcall GetReport(int Index);
  106.     void __fastcall GetTableList(char * Buffer);
  107.     HIDESBASE void __fastcall Remove(TReport* Value);
  108.     void __fastcall UpdateDataSets(void);
  109.     bool __fastcall ValidDataType(Db::TFieldType Value);
  110.     __property Classes::TList* DataSets = {read=GetDataSets, nodefault};
  111.     __property Classes::TList* Reports = {read=FReports, nodefault};
  112.     __property Db::TDataSet* DataSet[int Index] = {read=GetDataSet};
  113.     __property HWND Handle = {read=FHandle, nodefault};
  114.     __property TReport* Report[int Index] = {read=GetReport};
  115.     __property bool Updated = {read=FUpdated, nodefault};
  116. };
  117.  
  118. class __declspec(pascalimplementation) TReport : public Classes::TComponent
  119. {
  120.     typedef Classes::TComponent inherited;
  121.     
  122. private:
  123.     TReportManager* FOwner;
  124.     System::AnsiString FReportName;
  125.     System::AnsiString FReportDir;
  126.     Word FNumCopies;
  127.     Word FStartPage;
  128.     Word FEndPage;
  129.     Word FMaxRecords;
  130.     bool FRunTime;
  131.     bool FStartedApp;
  132.     bool FAutoUnload;
  133.     Classes::TStrings* FInitialValues;
  134.     bool FLoaded;
  135.     int FVersionMajor;
  136.     int FVersionMinor;
  137.     HWND FReportHandle;
  138.     bool FPreview;
  139.     TLaunchType FLaunchType;
  140.     bool __fastcall GetBusy(void);
  141.     Classes::TStrings* __fastcall GetInitialValues(void);
  142.     HWND __fastcall GetReportHandle(void);
  143.     void __fastcall RunApp(void);
  144.     bool __fastcall StartApplication(void);
  145.     bool __fastcall ReportActive(void);
  146.     int __fastcall RunReport(void);
  147.     void __fastcall SetInitialValues(Classes::TStrings* Value);
  148.     bool __fastcall UseRunTime(void);
  149.     
  150. protected:
  151.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  152.         );
  153.     
  154. public:
  155.     __fastcall virtual TReport(Classes::TComponent* AOwner);
  156.     __fastcall virtual ~TReport(void);
  157.     int __fastcall CloseApplication(bool ShowDialogs);
  158.     int __fastcall CloseReport(bool ShowDialogs);
  159.     int __fastcall Connect(Word ServerType, const System::AnsiString ServerName, const System::AnsiString 
  160.         UserName, const System::AnsiString Password, const System::AnsiString DatabaseName);
  161.     int __fastcall Print(void);
  162.     int __fastcall RecalcReport(void);
  163.     int __fastcall Run(void);
  164.     int __fastcall RunMacro(const System::AnsiString Macro);
  165.     int __fastcall SetVariable(const System::AnsiString Name, const System::AnsiString Value);
  166.     int __fastcall SetVariableLines(const System::AnsiString Name, Classes::TStrings* Value);
  167.     __property HWND ReportHandle = {read=FReportHandle, nodefault};
  168.     __property bool Busy = {read=GetBusy, nodefault};
  169.     __property int VersionMajor = {read=FVersionMajor, nodefault};
  170.     __property int VersionMinor = {read=FVersionMinor, nodefault};
  171.     
  172. __published:
  173.     __property System::AnsiString ReportName = {read=FReportName, write=FReportName, nodefault};
  174.     __property System::AnsiString ReportDir = {read=FReportDir, write=FReportDir, nodefault};
  175.     __property Word PrintCopies = {read=FNumCopies, write=FNumCopies, default=1};
  176.     __property Word StartPage = {read=FStartPage, write=FStartPage, default=1};
  177.     __property Word EndPage = {read=FEndPage, write=FEndPage, default=9999};
  178.     __property Word MaxRecords = {read=FMaxRecords, write=FMaxRecords, default=0};
  179.     __property bool AutoUnload = {read=FAutoUnload, write=FAutoUnload, default=0};
  180.     __property Classes::TStrings* InitialValues = {read=GetInitialValues, write=SetInitialValues, nodefault
  181.         };
  182.     __property bool Preview = {read=FPreview, write=FPreview, default=0};
  183.     __property TLaunchType LaunchType = {read=FLaunchType, write=FLaunchType, default=0};
  184. };
  185.  
  186. #pragma option -b
  187. enum TCallType { ctNone, ctDesignId, ctExecuteSQL, ctEndSQL, ctGetError, ctGetTableList, ctGetColumnList, 
  188.     ctGetNext, ctGetMemo };
  189. #pragma option -b.
  190. #pragma pack(push, 1)
  191. struct Report_3
  192. {
  193.     
  194. } ;
  195. #pragma pack(pop)
  196.  
  197. struct TCallInfo
  198. {
  199.     int ProcessId;
  200.     TCallType CallType;
  201.     DWord ErrorCode;
  202.     Report_3 Data;
  203. } ;
  204.  
  205. struct TRSDateTime;
  206. typedef TRSDateTime *PRSDateTime;
  207.  
  208. struct TRSDateTime
  209. {
  210.     Word Year;
  211.     Word Month;
  212.     Word Day;
  213.     Word Hour;
  214.     Word Min;
  215.     Word Sec;
  216.     Word MSec;
  217. } ;
  218.  
  219. #pragma pack(push, 1)
  220. struct Report_4
  221. {
  222.     
  223. } ;
  224. #pragma pack(pop)
  225.  
  226. #pragma pack(push, 1)
  227. struct TDataElement
  228. {
  229.     int FieldType;
  230.     char ColumnName[32];
  231.     Word FieldLength;
  232.     DWord Null;
  233.     Report_4 Data;
  234. } ;
  235. #pragma pack(pop)
  236.  
  237. struct TExecInfo
  238. {
  239.     Db::TDataSet* DataSet;
  240.     DWord MoreRecords;
  241.     Word NumCols;
  242. } ;
  243.  
  244. struct TStartExecInfo
  245. {
  246.     int StmtIndex;
  247.     char StmtName[20];
  248.     char MemoName[20];
  249.     char TableName[64];
  250. } ;
  251.  
  252. struct TMemoStruct
  253. {
  254.     Db::TDataSet* DataSet;
  255.     int Index;
  256.     char ColumnName[32];
  257.     int Pos;
  258. } ;
  259.  
  260. struct TSQLStruct
  261. {
  262.     Db::TDataSet* DataSet;
  263.     int Index;
  264. } ;
  265.  
  266. class __declspec(delphiclass) TReportEditor;
  267. class __declspec(pascalimplementation) TReportEditor : public Dsgnintf::TComponentEditor
  268. {
  269.     typedef Dsgnintf::TComponentEditor inherited;
  270.     
  271. private:
  272.     virtual void __fastcall Edit(void);
  273.     virtual void __fastcall ExecuteVerb(int Index);
  274.     virtual System::AnsiString __fastcall GetVerb(int Index);
  275.     virtual int __fastcall GetVerbCount(void);
  276. public:
  277.     /* TComponentEditor.Create */ __fastcall virtual TReportEditor(Classes::TComponent* AComponent, Dsgnintf::TFormDesigner* 
  278.         ADesigner) : Dsgnintf::TComponentEditor(AComponent, ADesigner) { }
  279.     
  280. public:
  281.     /* TObject.Destroy */ __fastcall virtual ~TReportEditor(void) { }
  282.     
  283. };
  284.  
  285. class __declspec(delphiclass) TReportDirProperty;
  286. class __declspec(pascalimplementation) TReportDirProperty : public Dsgnintf::TPropertyEditor
  287. {
  288.     typedef Dsgnintf::TPropertyEditor inherited;
  289.     
  290. public:
  291.     virtual System::AnsiString __fastcall GetValue(void);
  292.     virtual void __fastcall SetValue(const System::AnsiString Value);
  293.     virtual Dsgnintf::TPropertyAttributes __fastcall GetAttributes(void);
  294.     virtual void __fastcall Edit(void);
  295. public:
  296.     /* TPropertyEditor.Destroy */ __fastcall virtual ~TReportDirProperty(void) { }
  297.     
  298. public:
  299.     /* TObject.Create */ __fastcall TReportDirProperty(void) : Dsgnintf::TPropertyEditor() { }
  300.     
  301. };
  302.  
  303. class __declspec(delphiclass) TReportNameProperty;
  304. class __declspec(pascalimplementation) TReportNameProperty : public Dsgnintf::TPropertyEditor
  305. {
  306.     typedef Dsgnintf::TPropertyEditor inherited;
  307.     
  308. public:
  309.     virtual System::AnsiString __fastcall GetValue(void);
  310.     virtual void __fastcall SetValue(const System::AnsiString Value);
  311.     virtual Dsgnintf::TPropertyAttributes __fastcall GetAttributes(void);
  312.     virtual void __fastcall Edit(void);
  313. public:
  314.     /* TPropertyEditor.Destroy */ __fastcall virtual ~TReportNameProperty(void) { }
  315.     
  316. public:
  317.     /* TObject.Create */ __fastcall TReportNameProperty(void) : Dsgnintf::TPropertyEditor() { }
  318.     
  319. };
  320.  
  321. //-- var, const, procedure ---------------------------------------------------
  322. #define ctDBase (Byte)(2)
  323. #define ctExcel (Byte)(3)
  324. #define ctParadox (Byte)(4)
  325. #define ctAscii (Byte)(5)
  326. #define ctSqlServer (Byte)(6)
  327. #define ctOracle (Byte)(7)
  328. #define ctDB2 (Byte)(8)
  329. #define ctNetSQL (Byte)(9)
  330. #define ctSybase (Byte)(10)
  331. #define ctBtrieve (Byte)(11)
  332. #define ctGupta (Byte)(12)
  333. #define ctIngres (Byte)(13)
  334. #define ctWatcom (Byte)(14)
  335. #define ctOcelot (Byte)(15)
  336. #define ctTeraData (Byte)(16)
  337. #define ctDB2Gupta (Byte)(17)
  338. #define ctAS400 (Byte)(18)
  339. #define ctUnify (Byte)(19)
  340. #define ctQry (Byte)(20)
  341. #define ctMinNative (Byte)(2)
  342. #define ctMaxNative (Byte)(20)
  343. #define ctODBCDBase (Byte)(40)
  344. #define ctODBCExcel (Byte)(41)
  345. #define ctODBCParadox (Byte)(42)
  346. #define ctODBCSqlServer (Byte)(43)
  347. #define ctODBCOracle (Byte)(44)
  348. #define ctODBCDB2 (Byte)(45)
  349. #define ctODBCNetSql (Byte)(46)
  350. #define ctODBCSybase (Byte)(47)
  351. #define ctODBCBtrieve (Byte)(48)
  352. #define ctODBCGupta (Byte)(49)
  353. #define ctODBCIngres (Byte)(50)
  354. #define ctODBCDB2Gupta (Byte)(51)
  355. #define ctODBCTeraData (Byte)(52)
  356. #define ctODBCAS400 (Byte)(53)
  357. #define ctODBCDWatcom (Byte)(54)
  358. #define ctODBCDefault (Byte)(55)
  359. #define ctODBCUnify (Byte)(56)
  360. #define ctMinODBC (Byte)(40)
  361. #define ctMaxODBC (Byte)(56)
  362. #define ctIDAPIStandard (Byte)(60)
  363. #define ctIDAPIParadox (Byte)(61)
  364. #define ctIDAPIDBase (Byte)(62)
  365. #define ctIDAPIAscii (Byte)(63)
  366. #define ctIDAPIOracle (Byte)(64)
  367. #define ctIDAPISybase (Byte)(65)
  368. #define ctIDAPINovSql (Byte)(66)
  369. #define ctIDAPIInterbase (Byte)(67)
  370. #define ctIDAPIIBMEE (Byte)(68)
  371. #define ctIDAPIDB2 (Byte)(69)
  372. #define ctIDAPIInformix (Byte)(70)
  373. #define ctMinIDAPI (Byte)(60)
  374. #define ctMaxIDAPI (Byte)(70)
  375. extern void __fastcall finalization(void);
  376.  
  377. }    /* namespace Report */
  378.  
  379. #pragma warn .par
  380. #pragma warn .hid 
  381. #pragma warn .inl
  382.  
  383. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  384. using namespace Report;
  385. #endif
  386. //-- end unit ----------------------------------------------------------------
  387. #endif    // Report
  388.