Databaseconnectionclasses  0.5.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hk_storagedatasource Class Reference
Inheritance diagram for hk_storagedatasource:
Inheritance graph
[legend]
Collaboration diagram for hk_storagedatasource:
Collaboration graph
[legend]

Public Member Functions

struct_raw_datacolumndata (unsigned long row, unsigned int fieldnr)
 
enum_datasourcetypes type ()
 
virtual void dump_data (void)
 
- Public Member Functions inherited from hk_datasource
virtual void set_name (const hk_string &n, bool registerchange=true)
 
virtual hk_string name (void)
 
enum_tablemodes mode (void)
 
void setmode_insertrow (void)
 
void delete_actualrow (enum_interaction c=interactive)
 
void setmode_normal (void)
 
void setmode_createtable (void)
 
void setmode_altertable (void)
 
hk_columnnew_column (void)
 
bool alter_column (const hk_string &col, const hk_string *name=NULL, hk_column::enum_columntype *newtype=NULL, long *size=NULL, const hk_string *defaultvalue=NULL, const bool *primary=NULL, const bool *notnull=NULL)
 
bool delete_column (const hk_string &col)
 
bool create_table_now (void)
 
bool alter_table_now (void)
 
bool create_view_now (void)
 
bool alter_view_now (void)
 
virtual bool goto_row (unsigned long r)
 
bool while_goto_row (void) const
 
bool goto_first (void)
 
bool goto_last (void)
 
bool goto_next (void)
 
bool goto_previous (void)
 
bool goto_random (void)
 
unsigned long row_position (void)
 
unsigned long max_rows (void)
 
bool set_accessmode (enum_accessmode)
 
enum_accessmode accessmode (void) const
 
bool enable (void)
 
bool while_enabling (void) const
 
bool disable (void)
 
bool while_disabling (void) const
 
bool set_enabled (bool e)
 
bool is_enabled (void) const
 
bool is_readonly (void) const
 
void set_readonly (bool r)
 
list< hk_column * > * columns (void)
 
list< hk_string > * columnnames (void)
 
hk_columncolumn_by_name (const hk_string &c)
 
hk_columncolumn_by_name (const hk_string &c, int colnumber)
 
int columnname_occurances (const hk_string &colname)
 
int columnname_occurance (hk_column *)
 
bool set_sql (const hk_string &s, bool rawsql=false, bool registerchange=true)
 
virtual bool set_query (hk_qbe *, bool registerchange=true)
 
hk_string sql (void) const
 
bool is_rawsql (void)
 
hk_string backendsql (void) const
 
list< indexclass > * indices (void)
 
bool index_exists (const hk_string &)
 
bool drop_index (const hk_string &i)
 
bool create_index (const hk_string &name, bool unique, list< hk_string > &fields)
 
bool alter_index (const hk_string &name, bool unique, list< hk_string > &fields)
 
enum_dependingmodes dependingmode (void)
 
bool set_depending_on (hk_datasource *d, bool react_on_data_changes=false, enum_dependingmodes mode=depending_standard)
 
hk_datasourcedepending_on (void)
 
void set_depending_on_is_left_join (bool, bool registerchange=true)
 
bool depending_on_is_left_join (void)
 
bool depending_on_react_on_data_changes (void)
 
list< hk_string > * depending_on_thisfields (void)
 
list< hk_string > * depending_on_masterfields (void)
 
bool set_depending_on_presentationdatasource (long d, bool react_on_data_changes=false, enum_dependingmodes mode=depending_standard, bool registerchange=true)
 
long depending_on_presentationdatasource (void)
 
void add_depending_fields (const hk_string &this_ds_field, const hk_string &master_ds_field, bool registerchange=true)
 
void clear_depending_fields (bool registerchange=true)
 
bool store_changed_data (enum_interaction c=interactive)
 
void set_ignore_changed_data (void)
 
bool ignore_changed_data (void) const
 
void set_filter (const hk_string &f, bool registerchange=true)
 
hk_string filter (void)
 
void set_temporaryfilter (const hk_string &f)
 
hk_string temporaryfilter (void)
 
void set_use_temporaryfilter (bool use)
 
bool use_temporaryfilter (void)
 
void set_internalfilter (const hk_string &f)
 
hk_string internalfilter (void)
 
void set_use_internalfilter (bool use)
 
bool use_internalfilter (void)
 
void clear_filter (bool registerchange=true)
 
void set_sorting (const hk_string &s, bool registerchange=true)
 
hk_string sorting (void)
 
void set_temporarysorting (const hk_string &s)
 
hk_string temporarysorting (void)
 
void set_use_temporarysorting (bool use)
 
bool use_temporarysorting (void)
 
void clear_sorting (bool registerchange=true)
 
void set_automatic_data_update (bool u)
 
bool is_automatic_data_update (void)
 
void set_sqldelimiter (const hk_string &)
 
void set_datetimeformat (const hk_string &datetime, const hk_string &date, const hk_string &time)
 
hk_string dateformat (void) const
 
hk_string datetimeformat (void) const
 
hk_string timeformat (void) const
 
hk_databasedatabase (void)
 
void savedata (ostream &s, bool saveall=true)
 
void loaddata (xmlNodePtr definition, bool loadsql=true)
 
long presentationnumber (void) const
 
bool datasource_used (void) const
 
bool ask_name (void)
 
virtual bool delete_rows (unsigned long from, unsigned long to, bool check_depending_datasources=true, enum_interaction c=interactive)
 
void transaction_begin (hk_string name="")
 
void transaction_commit (hk_string name="")
 
void transaction_rollback (hk_string name="")
 
void set_blockvisiblesignals (bool v)
 
bool blockvisiblesignals (void)
 
void set_blockserversignals (bool)
 
bool blockserversignals (void)
 
void set_blockdatasourcesignals (bool)
 
bool blockdatasourcesignals (void)
 
void save_datasourcedefinition (ostream &s)
 
bool load_datasourcedefinition (xmlNodePtr definition, bool use_xmltablename=true, bool ask=true)
 
hk_presentationpresentation (void)
 
void set_position (int x, int y, bool registerchange=true)
 
void set_size (int width, int height, bool registerchange=true)
 
int x (void) const
 
int y (void) const
 
int width (void) const
 
int height (void) const
 
void set_designsize (int w, int h, bool registerchange=true)
 
int designwidth () const
 
int designheight () const
 
void automatic_position_datasource (void)
 
list< hk_datasource * > * dependinglist (void)
 
bool previous_enable_problems (void) const
 
list< referentialclass > * referenceslist (void)
 
bool add_reference (const referentialclass &)
 
bool drop_reference (const hk_string &)
 
hk_string fieldorigin (const hk_string &)
 
hk_string totalfieldorigin (const hk_string &)
 
void reset_changed_data (void)
 
bool has_changed (void) const
 
hk_string systemcolumnname (const hk_string &n)
 
bool depending_on_datasource_deleterow_ok (void)
 
bool depending_on_datasource_before_delete_row (void)
 
bool depending_on_datasource_updaterow_ok (void)
 
bool check_store_changed_data ()
 
void set_progressdialog (progress_dialogtype *progressdialog)
 
progress_dialogtype * progressdialog (void) const
 
void set_progressinterval (int)
 
int progressinterval (void) const
 
- Public Member Functions inherited from hk_data
virtual hk_string name (void) const
 
virtual void set_name (const hk_string &n)
 
hk_string identifierdelimiter (void) const
 
hk_string textdelimiter (void) const
 
- Public Member Functions inherited from hk_class
void hkclassname (const hk_string &n)
 
hk_string hkclassname (void) const
 
void hkdebug (const hk_string &d) const
 
void hkdebug (const hk_string &d, const hk_string &e) const
 
void hkdebug (const hk_string &d, int i) const
 
void hkdebug (const hk_string &d, double i) const
 
void wanna_debug (bool d)
 
bool wanna_debug (void) const
 
bool generaldebug (void)
 
virtual void savedata (ostream &s)
 
virtual void loaddata (xmlNodePtr definition)
 

Protected Member Functions

void delete_data (void)
 
bool insert_data (struct_raw_data *datarow)
 
void memory_error (void)
 
 hk_storagedatasource (hk_database *d, hk_presentation *p)
 
bool driver_specific_enable (void)
 
bool driver_specific_disable (void)
 
virtual list< hk_column * > * driver_specific_columns (void)
 
virtual bool driver_specific_goto_row (unsigned long r)
 
virtual unsigned long driver_specific_max_rows (void)
 
virtual bool driver_specific_create_columns (void)
 
virtual bool driver_specific_update_data (void)
 
virtual bool driver_specific_insert_data (void)
 
virtual bool driver_specific_delete_data_at (unsigned long)
 
virtual bool driver_specific_batch_goto_previous (void)
 
virtual bool driver_specific_batch_goto_next (void)
 
void set_maxrows (unsigned long)
 
bool is_batchprevious (void)
 
- Protected Member Functions inherited from hk_datasource
 hk_datasource (hk_database *db, hk_presentation *p=NULL)
 
void column_remove (hk_column *col)
 
void visible_add (hk_dsvisible *v)
 
void visible_remove (hk_dsvisible *v)
 
virtual void driver_specific_transaction_begin (hk_string)
 
virtual void driver_specific_transaction_commit (hk_string)
 
virtual void driver_specific_transaction_rollback (hk_string)
 
virtual bool driver_specific_set_accessmode (enum_accessmode)
 
virtual bool driver_specific_batch_enable (void)
 
virtual bool driver_specific_batch_disable (void)
 
virtual hk_columndriver_specific_new_column (void)
 
virtual bool driver_specific_create_table_now (void)
 
virtual bool driver_specific_alter_table_now (void)
 
virtual bool driver_specific_create_view_now (void)
 
virtual bool driver_specific_alter_view_now (void)
 
virtual void driver_specific_before_drop_table (void)
 
virtual void filelist_changes (listtype t)
 
virtual list< indexclass > * driver_specific_indices (void)
 
virtual bool driver_specific_drop_index (const hk_string &i)
 
virtual bool driver_specific_create_index (const hk_string &name, bool unique, list< hk_string > &fields)
 
virtual void before_connection_disconnects (void)
 
virtual void before_source_vanishes (void)
 
virtual void driver_specific_after_copy_table ()
 
virtual bool driver_specific_load_view ()
 
virtual void driver_specific_create_viewsql ()
 
virtual bool driver_specific_add_reference (const referentialclass &)
 
virtual bool driver_specific_drop_reference (const hk_string &)
 
virtual void driver_specific_referenceslist (void)
 
void depending_ds_add (hk_datasource *d)
 
void depending_ds_remove (hk_datasource *d)
 
void depending_on_datasource_row_change (bool take_changed_data=false)
 
void depending_on_datasource_data_has_changed (void)
 
void depending_on_datasource_after_store_changed_data (void)
 
void depending_on_datasource_insertmode (void)
 
void depending_on_datasource_before_update_row (void)
 
void depending_on_datasource_after_update_row (void)
 
void reload_data (bool take_changed_data=false)
 
void create_actual_row_where_statement (void)
 
hk_string create_row_where_statement_at (unsigned long int position, bool withwhere=true)
 
void create_new_sql_statement (bool take_changed_data=false)
 
hk_string whole_datasource_where_statement (bool take_changed_data=false)
 
void print_sql (void)
 
void clear_columnlist (void)
 
void clear_modecolumnlists (void)
 
void clear_visiblelist (void)
 
void parse_sql (void)
 
virtual bool update_row (enum_interaction c=interactive)
 
virtual bool insert_row (enum_interaction c=interactive)
 
virtual bool delete_row (enum_interaction c=interactive)
 
void parse_fieldpart (void)
 
void parse_tablepart (void)
 
void set_has_changed (void)
 
void set_has_not_changed (void)
 
hk_string delimit_identifier (const hk_string &)
 
void inform_before_row_change (void)
 
void inform_visible_objects_batch_goto_next (void)
 
void inform_visible_objects_batch_goto_previous (void)
 
void inform_visible_objects_before_store_changed_data (void)
 
void inform_visible_objects_after_store_changed_data (void)
 
void inform_visible_objects_row_change (void)
 
void inform_visible_objects_row_add (void)
 
void inform_visible_objects_row_delete (void)
 
void inform_visible_objects_before_insert_row (void)
 
void inform_before_enable (void)
 
void inform_before_disable (void)
 
void inform_visible_objects_ds_disable (void)
 
void inform_visible_objects_ds_enable (void)
 
void inform_depending_ds_goto_row (void)
 
void inform_depending_ds_store_data (void)
 
void inform_depending_ds_data_has_changed (void)
 
void inform_depending_ds_after_store_changed_data (void)
 
void inform_depending_ds_before_update_row (void)
 
void inform_depending_ds_after_update_row (void)
 
void inform_depending_ds_disable (void)
 
void inform_depending_ds_enable (void)
 
void inform_depending_ds_insertmode (void)
 
void inform_visible_objects_new_columns_created (void)
 
void inform_visible_objects_before_columns_deleted (void)
 
void inform_visible_objects_insertmode (void)
 
void inform_when_table_structure_changes (void)
 
void inform_when_indexlist_changes (void)
 
void execute_visible_object_script_before_update (void)
 
void execute_visible_object_script_after_update (void)
 
void execute_visible_object_before_row_change (void)
 
void execute_visible_object_after_row_change (void)
 
void execute_visible_object_before_delete (void)
 
void execute_visible_object_after_delete (void)
 
void execute_visible_object_before_insert (void)
 
void execute_visible_object_after_insert (void)
 
hk_string new_referencename (const referentialclass &)
 
bool is_newreferencename (const hk_string &)
 
hk_string replace_dates (const hk_string &)
 
- Protected Member Functions inherited from hk_data
virtual bool driver_specific_name (const hk_string &n)
 
- Protected Member Functions inherited from hk_class
hk_interpreternew_interpreter (const hk_string &interpreter, hk_presentation *)
 

Protected Attributes

bool p_data_changed
 
long p_debug_counter
 
struct_raw_data p_d
 
- Protected Attributes inherited from hk_datasource
bool p_casesensitive
 
bool p_enabled
 
bool p_readonly
 
bool p_primary_key_used
 
bool p_ignore_changed_data
 
unsigned long p_counter
 
hk_databasep_database
 
list< hk_column * > * p_columns
 
list< class_altercolumnsp_altercolumns
 
list< hk_string > p_deletecolumns
 
list< hk_column * > p_newcolumns
 
list< hk_string > depending_this_fields
 
list< hk_string > depending_master_fields
 
struct_parsed_sqlp_parsed_sql
 
hk_string p_sql
 
hk_string p_viewsql
 
hk_string p_actual_row_where
 
bool p_automatic_data_update
 
hk_actionqueryp_actionquery
 
hk_string p_datetimeformat
 
hk_string p_dateformat
 
hk_string p_timeformat
 
hk_string p_sql_delimiter
 
hk_string p_true
 
hk_string p_false
 
bool p_depending_on_is_left_join
 
bool p_tablesql_set
 
list< hk_datasource * > p_dependinglist
 
enum_tablemodes p_mode
 
list< referentialclassp_references
 
- Protected Attributes inherited from hk_data
hk_string p_name
 
hk_string p_sqltextdelimiter
 
hk_string p_identifierdelimiter
 

Additional Inherited Members

- Public Types inherited from hk_datasource
enum  enum_tablemodes {
  mode_normal, mode_createtable, mode_altertable, mode_disabled,
  mode_insertrow, mode_deleterow, mode_unknown
}
 
enum  enum_accessmode { standard, batchread, batchwrite }
 
enum  enum_dependingmodes {
  depending_nohandle, depending_standard, depending_change, depending_delete,
  depending_changedelete
}
 
- Public Types inherited from hk_data
enum  enum_datasourcetypes {
  ds_table, ds_query, ds_actionquery, ds_view,
  ds_unknown
}
 
- Public Types inherited from hk_class
enum  enum_interaction { noninteractive, interactive }
 
enum  enum_measuresystem { cm, inch }
 
enum  enum_tagtype { normaltag, mastertag }
 
- Static Public Member Functions inherited from hk_datasource
static void set_enablefunction (voidfunction *, long counter)
 
- Static Public Member Functions inherited from hk_data
static bool print_sqlstatements (void)
 
static void set_print_sqlstatements (bool p)
 
- Static Public Member Functions inherited from hk_class
static void set_generaldebug (bool d)
 
static hk_string hk_translate (const hk_string &t)
 
static void show_warningmessage (const hk_string &m)
 
static void set_warningmessage (messagewindowtype *m)
 
static bool show_yesnodialog (const hk_string &m, bool default_value)
 
static void set_yesnodialog (yesno_dialogtype *d)
 
static hk_string show_stringvaluedialog (const hk_string &t)
 
static void set_stringvaluedialog (stringvalue_dialogtype *t)
 
static void set_translatefunction (translatefunctiontype *t)
 
static void set_filedialog (file_dialogtype *f)
 
static hk_string show_filedialog (const hk_string &f="", enum_operationmode m=file_open)
 
static void set_directorydialog (stringvalue_dialogtype *f)
 
static hk_string show_directorydialog (const hk_string &f="")
 
static void set_showpedantic (bool s)
 
static bool showpedantic (void)
 
static void set_measuresystem (enum_measuresystem)
 
static enum_measuresystem measuresystem (void)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, hk_string &value, int position=1, enum_tagtype tagtype=normaltag)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, unsigned long &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, unsigned int &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, long &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, int &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, bool &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr &where, const hk_string &tag)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, const hk_string &value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, unsigned long value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, unsigned int value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, long value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, int value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, bool value)
 
static void start_mastertag (ostream &stream, const hk_string &tag)
 
static void end_mastertag (ostream &stream, const hk_string &tag)
 
static void set_defaultdatetimeformat (const hk_string &timeformat, const hk_string &dateformat, const hk_string &datetimeformat)
 
static hk_string defaultdateformat (void)
 
static hk_string defaulttimeformat (void)
 
static hk_string defaultdatetimeformat (void)
 
static void save_preferences (void)
 
static bool runtime_only (void)
 
static void set_locale (const hk_string &locale)
 
static hk_string locale (void)
 
static void set_defaultdriver (const hk_string &d)
 
static hk_string defaultdriver (void)
 
static void set_default_automatic_data_update (bool)
 
static bool default_automatic_data_update (void)
 
- Static Protected Attributes inherited from hk_datasource
static voidfunction * p_enablefunction =NULL
 
static long p_enablefunctioncounter =0
 
- Static Protected Attributes inherited from hk_data
static bool p_print_sqlstatements =false
 
- Static Protected Attributes inherited from hk_class
static hk_string p_defaulttimeformat ="h:m:s"
 
static hk_string p_defaultdateformat ="D.M.Y"
 
static hk_string p_defaultdatetimeformat ="D.M.Y h:m:s"
 
static bool p_runtime_only =false
 

Member Function Documentation

void hk_storagedatasource::delete_data ( void  )
protected

deletes all internally stored data

References hk_datasource::columns().

list< hk_column * > * hk_storagedatasource::driver_specific_columns ( void  )
protectedvirtual

returns a list of the columns of the datasource. If the datasource is a table the list hast to be created even if the datasource is disabled. Fill the p_columns list for this reason and then return it. If necessary has to create one hk_column object per column and to add them to p_columns. Each column object has to get a unique number in its (protected) hk_column::p_fieldnr .

Reimplemented from hk_datasource.

Reimplemented in hk_mysqldatasource.

bool hk_storagedatasource::driver_specific_enable ( void  )
protectedvirtual

has to make sure that the columns-list has been created. It also has to provide access to the data of the datasource

Reimplemented from hk_datasource.

Reimplemented in hk_mysqldatasource, and hk_mysqltable.

References hk_class::hkdebug().

bool hk_storagedatasource::insert_data ( struct_raw_data datarow)
protected

adds a new row at the end of the datalist.

Parameters
datarowan array of struct_raw_data (define as struct_raw_data* datarow=new struct_raw_data[num_fields]) where num_fields is the number of fields existing datarow[0] represents the first column (column with fieldnr 0) etc

References hk_datasource::columns().

void hk_storagedatasource::memory_error ( void  )
protected

has to be called from driver_specific_enable in case of a memory allocation error. This function shows a error message

References hk_class::hk_translate(), and hk_class::show_warningmessage().

Referenced by hk_mysqldatasource::driver_specific_enable().


The documentation for this class was generated from the following files: