Databaseconnectionclasses  0.5.3
hk_dsdatavisible.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_DSDATAVISIBLE
12 #define HK_DSDATAVISIBLE
13 #include "hk_dsvisible.h"
14 #include <vector>
15 using namespace std;
16 class hk_column;
17 class hk_form;
20 
21 
22 
33 {
34  friend class hk_column;
35  public:
37  virtual ~hk_dsdatavisible();
45  void set_columnname(const hk_string& c,bool registerchange=true);
46  void set_columnname(const hk_string& c, bool registerchange, int coloccurance);
51  hk_column* column(void);
52  hk_string columnname(void) const;
56  virtual void set_datasource(hk_datasource* d);
57  hk_datasource* datasource(void);
58  virtual void savedata(ostream& s );
59  virtual void loaddata(xmlNodePtr definition);
63  bool use_defaultvalue(void);
77  void set_defaultvalue(const hk_string& def,bool registerchange=true);
81  hk_string raw_defaultvalue(void);
85  hk_string defaultvalue(void);
89  void reset_default(bool registerchange=true);
90 
91  void set_numberformat(bool use_numberseparator=false, int commadigits=-1,bool registerchange=true);
92  void set_numberformat(bool use_numberseparator, int commadigits,bool registerchange,bool force_setting);
93  bool use_numberseparator(void);
97  int commadigits(void);
98  int precision(void);
99  static void set_defaultnumberformat(bool use_thousandsseparator,int precision);
100  static bool defaultuse_numberseparator(void);
101  static int defaultprecision(void);
105  virtual hk_string value_at(unsigned long row);
106  virtual hk_string value(void);
110  virtual void set_value(const hk_string&);
111 
112  unsigned int find(unsigned int from,unsigned int to,const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false,bool backwards=false);
113  unsigned int find(const hk_string& searchtext,bool wholephrase=false,bool casesensitive=false,bool backwards=false);
114 
115  void set_on_valuechanged_action(const hk_string&,bool registerchange=true,bool force_setting=true);
116  hk_string on_valuechanged_action(void);
117  virtual bool action_on_valuechanged(void);
118 
119  virtual hk_string tag_value(int tagnumber, bool& ok);
120 bool set_filtervalue(const hk_string&);
121  hk_string filtervalue(bool withcolumnnames=false) const;
122 
123  static bool parsed_value(hk_string& v,hk_connection* c);
124  virtual void update_filter(void){}
125  protected:
129  void set_data_has_changed(void);
130  virtual bool datasource_disable(void);
131  virtual bool datasource_enable(void);
132  virtual void datasource_delete(void);
133  virtual bool before_columns_deleted(void);
134  virtual void widget_specific_set_column(void);
135  virtual void widget_specific_numberformat(void);
136  virtual void widget_specific_set_defaultvalue(void){}
137  virtual void columndata_has_changed(void){}
138  virtual void before_insert_row(void);
139  virtual void new_column_pointer_created(void);
140  virtual bool presentationmode_changed(void);
141  hk_column* p_column;
142 
143  hk_string p_filterreplacevalue;
144  hk_string p_filtervalueend;
145 
146  private:
147  void set_column(void);
148  bool p_virginname;//used to find out whether to automatically set defaultvalues
149  static bool p_defaultthousandsseparator;
150  static int p_defaultprecision;
151  hk_dsdatavisiblemodeprivate* p_designdata;
152  hk_dsdatavisiblemodeprivate* p_viewdata;
153  hk_dsdatavisibleprivate* p_private;
154 
155 
156 }
157 
158 
159 ;
160 #endif
base class for visible widgets without column data connection
Definition: hk_dsvisible.h:31
connects to the SQL Server
Definition: hk_connection.h:31
base class for forms
Definition: hk_form.h:43
virtual void savedata(ostream &s)
Definition: hk_class.cpp:251
virtual void loaddata(xmlNodePtr definition)
Definition: hk_class.cpp:262
represents a resultquery or a table of a database.
Definition: hk_datasource.h:45
unsigned int find(unsigned int from, unsigned int to, const hk_string &searchtext, bool wholephrase=false, bool casesensitive=false, bool backwards=false)
Definition: hk_column.cpp:530
base class for multidatasource based classes like forms and reports
Definition: hk_presentation.h:40
base class for visible widgets with data connection
Definition: hk_dsdatavisible.h:32
Definition: hk_dsdatavisible.cpp:34
represents one column of a datasource.
Definition: hk_column.h:34
Definition: hk_dsdatavisible.cpp:62