00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_REPORTDATA
00012 #define HK_REPORTDATA
00013 #include "hk_definitions.h"
00014 #include "hk_dsdatavisible.h"
00015 #include <list>
00016 #include <vector>
00017 #include <iostream>
00018 #include <fstream>
00019 #include <time.h>
00020 #include <map>
00021 using namespace std;
00022
00023 class hk_reportsection;
00024 class hk_reportdata;
00025 class hk_report;
00026 class hk_reportdatamodeprivate;
00027 class hk_reportdataprivate;
00028
00076 class hk_reportdata :public hk_dsdatavisible
00077 {
00078 friend class hk_reportsection;
00079 public:
00100 void set_data(const hk_string& d,bool registerchange=true);
00101 hk_string data(void);
00102 void set_beforedata(const hk_string& b,bool registerchange=true);
00103 void set_afterdata(const hk_string& a,bool registerchange=true);
00104 hk_string beforedata();
00105 hk_string afterdata();
00113 hk_string actual_string(void);
00117 void count(void);
00124 void set_runningcount(bool c=true,bool registerchange=true);
00125 bool runningcount(void);
00126 virtual hk_font font(void);
00131 void set_datacountfunction(const hk_string& f,bool registerchange);
00132 hk_string datacountfunctionstring(void);
00133
00134 reportdatacounttype* datacountfunction(void);
00141 void set_topline(bool l=true,bool registerchange=true);
00147 void set_bottomline(bool l=true,bool registerchange=true);
00154 void set_leftline(bool l=true,bool registerchange=true);
00161 void set_rightline(bool l=true,bool registerchange=true);
00169 void set_diagonalluro(bool l=true,bool registerchange=true);
00176 void set_diagonalloru(bool l=true,bool registerchange=true);
00177 bool diagonalloru(void);
00178 bool topline(void);
00179 bool bottomline(void);
00180 bool leftline(void);
00181 bool rightline(void);
00182 bool diagonalluro(void);
00188 void set_frame(bool l=true,bool registerchange=true);
00194 void set_wordbreak(bool b=true,bool registerchange=true);
00195 bool wordbreak(void);
00199 void set_configurefunction(const hk_string& f,bool registerchange=true);
00200 data_configurefunctiontype* configurefunction(void);
00201 hk_string configurefunctionstring(void);
00202
00203 virtual void savedata(ostream& s,bool userdefined=false);
00204 virtual void loaddata(const hk_string& definition,bool userdefined=false);
00205 void neutralize_definition(bool registerchange);
00206
00207 static void add_configurefunctiontype(const hk_string& name,data_configurefunctiontype* f);
00208 static list<hk_string>* configurefunctionlist(void);
00209
00210 static void add_datacountfunctiontype(const hk_string& name,reportdatacounttype* f);
00211 static list<hk_string>* datacountfunctionlist(void);
00212
00216 void set_replacefunction(const hk_string& f,bool registerchange=true);
00217 static void add_datareplacefunctiontype(const hk_string& name,data_replacefunctiontype* f);
00218 static list<hk_string>* datareplacefunctionlist(void);
00219 void reset_count();
00223 hk_report* report(void);
00227 hk_reportsection* section(void);
00228
00229 virtual void lower_widget(bool registerchange=true);
00230 virtual void raise_widget(bool registerchange=true);
00231 void set_on_print_action(const hk_string&,bool registerchange=true);
00232 hk_string on_print_action(void);
00233
00234 protected:
00235 hk_reportdata(hk_reportsection*);
00236 virtual ~hk_reportdata(void);
00237 virtual hk_string replace(const hk_string& where);
00238 virtual void new_column_pointer_created(void);
00239 virtual void sizetype_changed(void);
00240 virtual bool presentationmode_changed(void);
00241 virtual bool action_on_print(void);
00242
00243 private:
00244 void clear_counting(void);
00245
00246 typedef map<hk_string,data_configurefunctiontype*,less<hk_string> > reportdataconfigurelisttype ;
00247 static reportdataconfigurelisttype p_reportdataconfigurefunctions;
00248 static list<hk_string> p_reportdataconfigurelist;
00249
00250 hk_report* p_report;
00251 hk_reportsection* p_section;
00252
00253 typedef map<hk_string,reportdatacounttype*,less<hk_string> > datacountlisttype ;
00254 static datacountlisttype p_datacountfunctions;
00255 static list<hk_string> p_datacountfunctionlist;
00256
00257 typedef map<hk_string,data_replacefunctiontype*,less<hk_string> > datareplacelisttype ;
00258 static datareplacelisttype p_datareplacefunctions;
00259 static list<hk_string> p_datareplacefunctionlist;
00260 hk_reportdatamodeprivate* p_designdata;
00261 hk_reportdatamodeprivate* p_viewdata;
00262 hk_reportdataprivate* p_private;
00263
00264
00265
00266 };
00267 #endif
00268