Databaseconnectionclasses  0.5.3
hk_reportdata.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_REPORTDATA
12 #define HK_REPORTDATA
13 #include "hk_definitions.h"
14 #include "hk_dsdatavisible.h"
15 #include <list>
16 #include <vector>
17 #include <iostream>
18 #include <fstream>
19 #include <time.h>
20 #include <map>
21 using namespace std;
22 
23 class hk_reportsection;
24 class hk_reportdata;
25 class hk_report;
28 
76 {
77  friend class hk_reportsection;
78  public:
99  void set_data(const hk_string& d,bool registerchange=true);
100  hk_string data(void);
101  void set_beforedata(const hk_string& b,bool registerchange=true);
102  void set_afterdata(const hk_string& a,bool registerchange=true);
103  hk_string beforedata();
104  hk_string afterdata();
112  hk_string actual_string(void);
116  void count(void);
123  void set_runningcount(bool c=true,bool registerchange=true);
124  bool runningcount(void);
125  virtual hk_font font(void);
130  void set_datacountfunction(const hk_string& f,bool registerchange);
131  hk_string datacountfunctionstring(void);
132 
133  reportdatacounttype* datacountfunction(void);
140  void set_topline(bool l=true,bool registerchange=true);
146  void set_bottomline(bool l=true,bool registerchange=true);
153  void set_leftline(bool l=true,bool registerchange=true);
160  void set_rightline(bool l=true,bool registerchange=true);
168  void set_diagonalluro(bool l=true,bool registerchange=true);
175  void set_diagonalloru(bool l=true,bool registerchange=true);
176  bool diagonalloru(void);
177  bool topline(void);
178  bool bottomline(void);
179  bool leftline(void);
180  bool rightline(void);
181  bool diagonalluro(void);
187  void set_frame(bool l=true,bool registerchange=true);
193  void set_linebreak(bool b=true,bool registerchange=true);
194  bool linebreak(void);
195  void set_dynamic_height(bool dynamic,bool registerchange=true);
196  bool dynamic_height(void) const;
197 
201  void set_configurefunction(const hk_string& f,bool registerchange=true);
202  data_configurefunctiontype* configurefunction(void);
203  hk_string configurefunctionstring(void);
204 
205  virtual void savedata(ostream& s,bool userdefined=false);
206  virtual void loaddata(xmlNodePtr definition,bool userdefined=false);
207  void neutralize_definition(bool registerchange);
208 
209  static void add_configurefunctiontype(const hk_string& name,data_configurefunctiontype* f);
210  static list<hk_string>* configurefunctionlist(void);
211 
212  static void add_datacountfunctiontype(const hk_string& name,reportdatacounttype* f);
213  static list<hk_string>* datacountfunctionlist(void);
214 
218  void set_replacefunction(const hk_string& f,bool registerchange=true);
219  static void add_datareplacefunctiontype(const hk_string& name,data_replacefunctiontype* f);
220  static list<hk_string>* datareplacefunctionlist(void);
221  void reset_count();
225  hk_report* report(void);
229  hk_reportsection* section(void);
230 
231  virtual void lower_widget(bool registerchange=true);
232  virtual void raise_widget(bool registerchange=true);
233  void set_on_print_action(const hk_string&,bool registerchange=true);
234  hk_string on_print_action(void);
235  list<hk_string>* value_in_lines();
236 
237  unsigned int height(void) ;
238  bool data_fully_printed(void);
239  void reset_data_fully_printed(void);
240  int pagescount(void);
241 virtual hk_string tag_value(int tagnumber, bool& ok);
242 virtual hk_string column_value(const hk_string& colname,bool& ok);
243 void set_is_image(bool,bool registerchange=true );
244 bool is_image(void);
245 
246  protected:
248  virtual ~hk_reportdata(void);
249  virtual void new_column_pointer_created(void);
250  virtual void sizetype_changed(void);
251  virtual bool presentationmode_changed(void);
252 virtual bool action_on_print(void);
253 
254  private:
255  void clear_counting(void);
256 
257  typedef map<hk_string,data_configurefunctiontype*,less<hk_string> > reportdataconfigurelisttype ;
258  static reportdataconfigurelisttype p_reportdataconfigurefunctions;
259  static list<hk_string> p_reportdataconfigurelist;
260 
261  hk_report* p_report;
262  hk_reportsection* p_section;
263 
264  typedef map<hk_string,reportdatacounttype*,less<hk_string> > datacountlisttype ;
265  static datacountlisttype p_datacountfunctions;
266  static list<hk_string> p_datacountfunctionlist;
267 
268  typedef map<hk_string,data_replacefunctiontype*,less<hk_string> > datareplacelisttype ;
269  static datareplacelisttype p_datareplacefunctions;
270  static list<hk_string> p_datareplacefunctionlist;
271  hk_reportdatamodeprivate* p_designdata;
272  hk_reportdatamodeprivate* p_viewdata;
273  hk_reportdataprivate* p_private;
274 
275 
276 
277 };
278 #endif
279 
void reset_count(void)
Definition: hk_reportsection.cpp:326
represents a font
Definition: hk_font.h:26
represents a section of the report.
Definition: hk_reportsection.h:92
represents the data of a field within a section.
Definition: hk_reportdata.h:75
base class for visible widgets with data connection
Definition: hk_dsdatavisible.h:32
virtual bool actual_string(void)
Definition: hk_reportsection.cpp:420
basic class to create reports
Definition: hk_report.h:52
Definition: hk_reportdata.cpp:24
Definition: hk_reportdata.cpp:69
void set_replacefunction(const hk_string &f, bool registerchange=true)
Definition: hk_reportsection.cpp:265