00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_DSVISIBLE
00012 #define HK_DSVISIBLE
00013 #include "hk_definitions.h"
00014 #include "hk_visible.h"
00015 #include "hk_datetime.h"
00016 using namespace std;
00017 class hk_dsvisiblemodeprivate;
00018 class hk_dsvisibleprivate;
00029 class hk_dsvisible:public hk_visible
00030
00031 {
00032 friend class hk_datasource;
00033 public:
00034 hk_dsvisible(hk_presentation* presentation=NULL);
00035 virtual ~hk_dsvisible(void);
00036 virtual void set_datasource(hk_datasource* d);
00037 virtual bool set_presentationdatasource(long n, bool registerchange=true);
00038 long presentationdatasource(void);
00039 hk_datasource* datasource(void);
00040 virtual void savedata(ostream& s, bool savedatasource,bool saveall);
00041 virtual void savedata(ostream& s );
00042 virtual void loaddata(const hk_string& definition);
00043 void set_readonly(bool readonly);
00044 bool is_readonly(void) const;
00049 void set_before_row_change_action(const hk_string&, bool registerchange=true);
00050 hk_string before_row_change_action(void);
00055 void set_after_row_change_action(const hk_string&, bool registerchange=true);
00056 hk_string after_row_change_action(void);
00061 void set_before_update_action(const hk_string&, bool registerchange=true);
00062 hk_string before_update_action(void);
00067 void set_after_update_action(const hk_string&, bool registerchange=true);
00068 hk_string after_update_action(void);
00073 void set_before_delete_action(const hk_string&, bool registerchange=true);
00074 hk_string before_delete_action(void);
00079 void set_after_delete_action(const hk_string&, bool registerchange=true);
00080 hk_string after_delete_action(void);
00085 void set_before_insert_action(const hk_string&, bool registerchange=true);
00086 hk_string before_insert_action(void);
00091 void set_after_insert_action(const hk_string&, bool registerchange=true);
00092 hk_string after_insert_action(void);
00093
00094 protected:
00095 void row_change(void);
00096
00097 void insert_mode(void);
00105 virtual void widget_specific_insert_mode(void){}
00113 virtual bool widget_specific_row_change(void) {return false;}
00119 virtual void widget_specific_enable_disable(void){}
00120 virtual void widget_specific_enable(void){}
00121 virtual void widget_specific_disable(void){}
00122 virtual void widget_specific_row_added(void){}
00123 virtual void widget_specific_row_deleted(void){}
00129 virtual void before_row_change(void);
00130 virtual void before_store_changed_data(void);
00131 virtual void after_store_changed_data(void);
00132 virtual void before_insert_row(void){}
00133 virtual void before_datasource_enables(void){}
00138 virtual bool datasource_disable(void);
00143 virtual bool datasource_enable(void);
00148 virtual void datasource_delete(void);
00155 virtual void row_added(void);
00156 virtual void row_deleted(void);
00157 virtual bool columns_new_created(void){return true;}
00158 virtual void list_changes(listtype type);
00167 virtual bool before_columns_deleted(void){return true;}
00173 virtual bool table_structure_changes(void){return true;}
00180 virtual void before_source_vanishes(void);
00186 virtual void widget_specific_presentationdatasource(long){}
00187 virtual void presentationmode_changed(void);
00188 hk_datasource* p_datasource;
00189 hk_datetime p_date;
00190 #ifdef HK_DEBUG
00191 hk_string debug_p_columnname;
00192 #endif
00193 private:
00194 void action_before_store_changed_data(void);
00195 void action_after_store_changed_data(void);
00196 void action_before_row_change(void);
00197 void action_after_row_change(void);
00198 void action_before_delete(void);
00199 void action_after_delete(void);
00200 void action_before_insert(void);
00201 void action_after_insert(void);
00202 hk_dsvisiblemodeprivate* p_designdata;
00203 hk_dsvisiblemodeprivate* p_viewdata;
00204 hk_dsvisibleprivate* p_private;
00205
00206 bool p_already_handled;
00207
00208 };
00209 #endif