hk_reportdata.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_classes library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file COPYING included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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 
00075 class hk_reportdata :public hk_dsdatavisible
00076 {
00077     friend class hk_reportsection;
00078     public:
00099         void set_data(const hk_string& d,bool registerchange=true);
00100         hk_string data(void);
00101         void set_beforedata(const hk_string& b,bool registerchange=true);
00102         void set_afterdata(const hk_string& a,bool registerchange=true);
00103         hk_string beforedata();
00104         hk_string afterdata();
00112         hk_string actual_string(void);
00116         void count(void);
00123         void    set_runningcount(bool c=true,bool registerchange=true);
00124         bool    runningcount(void);
00125         virtual     hk_font font(void);
00130         void set_datacountfunction(const hk_string& f,bool registerchange);
00131         hk_string datacountfunctionstring(void);
00132 
00133         reportdatacounttype* datacountfunction(void);
00140         void    set_topline(bool l=true,bool registerchange=true);
00146         void    set_bottomline(bool l=true,bool registerchange=true);
00153         void    set_leftline(bool l=true,bool registerchange=true);
00160         void    set_rightline(bool l=true,bool registerchange=true);
00168         void    set_diagonalluro(bool l=true,bool registerchange=true);
00175         void    set_diagonalloru(bool l=true,bool registerchange=true);
00176         bool    diagonalloru(void);
00177         bool    topline(void);
00178         bool    bottomline(void);
00179         bool    leftline(void);
00180         bool    rightline(void);
00181         bool    diagonalluro(void);
00187         void    set_frame(bool l=true,bool registerchange=true);
00193         void    set_linebreak(bool b=true,bool registerchange=true);
00194         bool    linebreak(void);
00195         void    set_dynamic_height(bool dynamic,bool registerchange=true);
00196         bool    dynamic_height(void) const;
00197 
00201         void    set_configurefunction(const hk_string& f,bool registerchange=true);
00202         data_configurefunctiontype* configurefunction(void);
00203         hk_string configurefunctionstring(void);
00204 
00205         virtual void    savedata(ostream& s,bool userdefined=false);
00206         virtual void  loaddata(xmlNodePtr definition,bool userdefined=false);
00207         void    neutralize_definition(bool registerchange);
00208 
00209         static void add_configurefunctiontype(const hk_string& name,data_configurefunctiontype* f);
00210         static list<hk_string>* configurefunctionlist(void);
00211 
00212         static void add_datacountfunctiontype(const hk_string& name,reportdatacounttype* f);
00213         static list<hk_string>* datacountfunctionlist(void);
00214 
00218         void        set_replacefunction(const hk_string& f,bool registerchange=true);
00219         static void add_datareplacefunctiontype(const hk_string& name,data_replacefunctiontype* f);
00220         static list<hk_string>* datareplacefunctionlist(void);
00221         void reset_count();
00225         hk_report* report(void);
00229         hk_reportsection* section(void);
00230 
00231         virtual void lower_widget(bool registerchange=true);
00232         virtual void raise_widget(bool registerchange=true);
00233         void set_on_print_action(const hk_string&,bool registerchange=true);
00234         hk_string on_print_action(void);
00235         list<hk_string>*  value_in_lines();
00236         
00237         unsigned int    height(void) ;
00238         bool data_fully_printed(void);
00239         void reset_data_fully_printed(void);
00240         int pagescount(void);
00241 virtual hk_string tag_value(int tagnumber, bool& ok);
00242 virtual hk_string column_value(const hk_string& colname,bool& ok);
00243 void    set_is_image(bool,bool registerchange=true );
00244 bool    is_image(void);
00245 
00246     protected:
00247         hk_reportdata(hk_reportsection*);
00248         virtual     ~hk_reportdata(void);
00249         virtual void new_column_pointer_created(void);
00250         virtual void sizetype_changed(void);
00251         virtual bool    presentationmode_changed(void);
00252 virtual bool action_on_print(void);
00253 
00254     private:
00255       void clear_counting(void);
00256 
00257         typedef  map<hk_string,data_configurefunctiontype*,less<hk_string> >  reportdataconfigurelisttype ;
00258         static    reportdataconfigurelisttype  p_reportdataconfigurefunctions;
00259         static  list<hk_string> p_reportdataconfigurelist;
00260 
00261         hk_report* p_report;
00262         hk_reportsection* p_section;
00263 
00264         typedef  map<hk_string,reportdatacounttype*,less<hk_string> >  datacountlisttype ;
00265         static    datacountlisttype  p_datacountfunctions;
00266         static  list<hk_string> p_datacountfunctionlist;
00267 
00268         typedef  map<hk_string,data_replacefunctiontype*,less<hk_string> >  datareplacelisttype ;
00269         static    datareplacelisttype  p_datareplacefunctions;
00270         static  list<hk_string> p_datareplacefunctionlist;
00271         hk_reportdatamodeprivate* p_designdata;
00272         hk_reportdatamodeprivate* p_viewdata;
00273         hk_reportdataprivate* p_private;
00274 
00275 
00276 
00277 };
00278 #endif
00279 

Generated on Tue Nov 28 02:48:08 2006 for Databaseconnectionclasses by  doxygen 1.5.0