00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_DEFINITIONS
00012 #define HK_DEFINITIONS
00013 #include "hk_string.h"
00014 #include <list>
00015 #include <stdlib.h>
00016 #include <stdio.h>
00017
00018 using namespace std;
00019
00020 #define HK_DEBUG
00021 #define HK_VERSION "074"
00022
00023
00024
00025
00026
00027
00028
00029 #ifdef HK_VERSION_NUMBER
00030 # undef HK_VERSION_NUMBER
00031 #endif
00032 #define HK_VERSION_NUMBER 0007004
00033
00034
00035 #ifdef HAVE_NO_SSTREAM
00036 #include <strstream.h>
00037 #define STRINGSTREAM strstream
00038 #else
00039 #include <sstream>
00040 #define STRINGSTREAM stringstream
00041 #endif
00042
00046 enum filetype{ft_table=1,ft_query=2,ft_form=3,ft_report=4,ft_view=6};
00047 enum listtype{lt_table=1,lt_query=2,lt_form=3,lt_report=4,lt_index=5,lt_view=6};
00048
00049 enum datasourcetype {dt_table=1,dt_query=2,dt_view=3};
00050 enum objecttype{ot_database=0,ot_table=1,ot_query=2,ot_form=3,ot_report=4,ot_view=6};
00051
00056 typedef class struct_raw_data
00057 {
00058 public:
00059 struct_raw_data(){length=0;data=NULL;}
00060 unsigned long length;
00061 char* data;
00062
00063 } ;
00064
00065 typedef class struct_connectionfields
00066 {
00067 public:
00068 struct_connectionfields(){cancel=false;save=false;allowdatabaseselect=true;};
00069 hk_string host;
00070 hk_string user;
00071 hk_string password;
00072 hk_string sql_delimiter;
00073 hk_string port;
00074 hk_string database;
00075 bool allowdatabaseselect;
00076 bool cancel;
00077 bool save;
00078 bool emulateboolean;
00079 } ;
00080
00081
00082 class struct_commands;
00083
00084 typedef class struct_commandlinefields
00085 {
00086 public:
00087 struct_commandlinefields()
00088 {
00089 runtime_only=false;
00090 p_guicommands=NULL;
00091 };
00092 hk_string driver;
00093 hk_string database;
00094 hk_string form;
00095
00096 hk_string host;
00097 hk_string user;
00098 hk_string password;
00099 hk_string port;
00100 bool runtime_only;
00101 struct_commands* p_guicommands;
00102 } ;
00103
00104
00105 int hk_random(int min,int max);
00106
00107 class hk_column;
00111 bool is_numerictype(hk_column*);
00115 bool is_integertype(hk_column*);
00119 bool is_realtype(hk_column*);
00120 double inch2cm(double);
00121 double cm2inch(double);
00122
00123 class hk_report;
00124 class hk_reportdata;
00125 class hk_reportsection;
00126
00127 typedef hk_string recodefunctiontype(const hk_string&,hk_report*);
00128 typedef hk_string data_replacefunctiontype(hk_reportdata*,const hk_string&);
00129 typedef bool report_configurefunction(hk_report*,int);
00130 typedef bool reporttypefunction(hk_report*,bool);
00131 typedef unsigned long reportsectioncounttype(hk_reportsection*);
00132 typedef void reportsectionautomaticcreatedatatype(hk_reportsection*);
00133 typedef unsigned long reportdatacounttype(hk_reportdata*);
00134 typedef void data_configurefunctiontype(hk_reportdata*);
00135
00136 typedef void voidfunction(void);
00137
00138 union number
00139 {
00140 long integer;
00141 double real;
00142 };
00143
00144 union longnumber
00145 {
00146 long int integer;
00147 long double real;
00148 };
00149
00150
00151 typedef class
00152 {
00153 public:
00154 hk_string dependingfield;
00155 hk_string masterfield;
00156 } dependingclass;
00157
00158
00159 typedef class referentialclass
00160 {
00161 public:
00162 referentialclass();
00163 bool operator=(const referentialclass&);
00164
00165
00166 hk_string p_name;
00167 hk_string p_masterdatasource;
00168 list<dependingclass> p_fields;
00169 bool p_deletecascade;
00170 bool p_updatecascade;
00171 } ;
00172
00173
00174 bool load_file(const hk_string& filename, struct_raw_data* result);
00175 bool save_file(const hk_string& filename, const struct_raw_data* data);
00176 bool save_textfile(const hk_string& filename, const hk_string& data);
00177 bool file_exists(const hk_string& filename);
00178 bool data2hex(struct_raw_data* data, hk_string& result);
00179 bool hex2data( const hk_string& data,unsigned long maxbytes, struct_raw_data* result);
00180
00181
00182 #endif //HK_DEFINITIONS
00183
00184
00185