Databaseconnectionclasses
0.5.3
|
basic class for all other defined classes. More...
#include <hk_class.h>
Public Types | |
enum | enum_interaction { noninteractive, interactive } |
enum | enum_measuresystem { cm, inch } |
enum | enum_tagtype { normaltag, mastertag } |
Public Member Functions | |
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) |
Static Public Member Functions | |
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) |
Protected Member Functions | |
hk_interpreter * | new_interpreter (const hk_string &interpreter, hk_presentation *) |
basic class for all other defined classes.
hk_class is the basic class for all other defined classes. It has some methods to support a simple debugging.
this enum will be used from other class members if their behaviour should be different e.g. if called from the command line in a script (then they should be noninteractive) or as a GUI application, where the user should interactively enter a password when the previous login failed.
|
static |
just writes </tag> to a stream. Use this function if you want to end a section
Referenced by hk_datasource::save_datasourcedefinition(), save_preferences(), hk_dsimage::savedata(), hk_dsquery::savedata(), hk_module::savedata(), hk_colour::savedata(), hk_dsgridcolumn::savedata(), hk_font::savedata(), hk_dscombobox::savedata(), hk_dsdatavisible::savedata(), hk_qbe::savedata(), hk_presentation::savedata(), hk_button::savedata(), hk_visible::savedata(), hk_form::savedata(), hk_report::savedata(), hk_connection::savedata(), hk_database::savedata(), and hk_datasource::savedata().
|
static |
called from loaddata to load a variable value originally stored with set_tagvalue
where | a text where the wished value has to be filtered out |
tag | the tag name. See set_tagvalue for details |
value | the found value will be returned in this parameter |
position | if there are more than one values for a variable (i.e. a list of columnnames),first position is 1 give the wished position of the value. |
Referenced by hk_datasource::load_datasourcedefinition(), hk_dsimage::loaddata(), hk_dsquery::loaddata(), hk_module::loaddata(), hk_dsvisible::loaddata(), hk_colour::loaddata(), hk_dsgridcolumn::loaddata(), hk_font::loaddata(), hk_dscombobox::loaddata(), hk_dsdatavisible::loaddata(), hk_subform::loaddata(), hk_qbe::loaddata(), hk_dsgrid::loaddata(), hk_presentation::loaddata(), hk_label::loaddata(), hk_button::loaddata(), hk_visible::loaddata(), hk_form::loaddata(), hk_report::loaddata(), hk_connection::loaddata(), hk_database::loaddata(), and hk_datasource::loaddata().
|
static |
tries to translate the message t by using the translatingfunction set with set_translatefunction.
Referenced by hk_datasource::add_reference(), hk_datasource::ask_name(), hk_column::asstring_at(), hk_connection::check_capabilities(), hk_column::columntype_name(), hk_connection::connect(), hk_database::copy_table(), hk_connection::create_database(), hk_datasource::create_table_now(), hk_dsdatavisible::defaultvalue(), hk_connection::delete_database(), hk_database::delete_file(), hk_datasource::delete_rows(), hk_database::delete_table(), hk_mysqldatasource::driver_specific_enable(), hk_connection::drivername(), hk_datasource::drop_index(), hk_importcsv::execute(), hk_datasource::load_datasourcedefinition(), hk_form::load_form(), hk_presentation::loaddata(), hk_storagedatasource::memory_error(), hk_drivermanager::new_connection(), hk_database::new_table(), hk_report::print_report(), hk_database::rename_file(), hk_form::save_form(), hk_presentation::savedata(), hk_report::set_borders(), hk_reportdata::set_configurefunction(), hk_reportdata::set_datacountfunction(), hk_dscombobox::set_datasource(), hk_datasource::set_depending_on(), hk_datasource::set_depending_on_presentationdatasource(), hk_visible::set_identifier(), hk_dscombobox::set_listdatasource(), hk_dscombobox::set_listpresentationdatasource(), set_locale(), hk_connection::set_newpassword(), hk_report::set_recodefunction(), hk_reportsection::set_replacefunction(), hk_reportdata::set_replacefunction(), hk_connection::show_newpassworddialog(), and show_yesnodialog().
void hk_class::hkclassname | ( | const hk_string & | n | ) |
The classname is for internal debugging use only It will be shown in front of all debugging messages.
References hkclassname(), and hkdebug().
Referenced by hkclassname(), hk_dsdatavisible::loaddata(), hk_presentation::new_datasource(), and hk_datasource::set_name().
void hk_class::hkdebug | ( | const hk_string & | d | ) | const |
if wanna_debug is true hkdebug prints on standard output the classname and the message d.
d | is the message that will be printed. |
Referenced by hk_reportdata::actual_string(), hk_reportsection::actual_string(), hk_importcsv::add_columnname(), hk_subform::add_depending_fields(), hk_reportsection::add_depending_fields(), hk_datasource::add_depending_fields(), hk_datasource::alter_column(), hk_datasource::alter_index(), hk_datasource::alter_table_now(), hk_datasource::ask_name(), hk_listvisible::before_columns_deleted(), hk_importcsv::before_columns_deleted(), hk_report::before_columns_deleted(), hk_dbvisible::before_source_vanishes(), hk_listvisible::before_source_vanishes(), hk_dsvisible::before_source_vanishes(), hk_dsgrid::change_columnposition(), hk_presentation::clear_datasourcelist(), hk_datasource::clear_depending_fields(), hk_datasource::clear_filter(), hk_datasource::clear_sorting(), hk_form::clear_visiblelist(), hk_dsdatavisible::column(), hk_datasource::column_by_name(), hk_connection::connect(), hk_database::copy_table(), hk_reportdata::count(), hk_connection::create_database(), hk_datasource::create_index(), hk_datasource::create_table_now(), hk_importcsv::create_valuelist(), hk_connection::database_exists(), hk_dsdatavisible::datasource_delete(), hk_dsvisible::datasource_delete(), hk_dsgrid::datasource_disable(), hk_dsdatavisible::datasource_disable(), hk_dsvisible::datasource_disable(), hk_report::datasource_disable(), hk_dscombobox::datasource_enable(), hk_dsgrid::datasource_enable(), hk_listvisible::datasource_enable(), hk_dsdatavisible::datasource_enable(), hk_dsvisible::datasource_enable(), hk_datasource::datasource_used(), hk_datetime::date_asstring(), hk_datetime::datetime_asstring(), hk_datasource::delete_actualrow(), hk_datasource::delete_column(), hk_database::delete_file(), hk_datasource::delete_rows(), hk_database::delete_table(), hk_datasource::disable(), hk_mysqldatasource::driver_specific_columns(), hk_mysqldatasource::driver_specific_enable(), hk_storagedatasource::driver_specific_enable(), hk_mysqldatabase::driver_specific_tablelist(), hk_datasource::drop_index(), hk_datasource::enable(), hk_actionquery::execute(), hk_importcsv::execute(), hk_database::existing_presentation(), hk_column::find(), hk_report::formatheight(), hk_report::formatwidth(), hk_presentation::get_datasource(), hk_datasource::goto_first(), hk_datasource::goto_next(), hk_datasource::goto_previous(), hk_datasource::goto_random(), hk_datasource::goto_row(), hk_dsgrid::gridcolumn(), hkclassname(), hk_reportsection::horizontal2relativ(), hk_report::init_report(), hk_reportsectionpair::init_sections(), hk_column::is_findstring(), hk_database::load(), hk_database::load_datasource(), hk_datasource::load_datasourcedefinition(), hk_form::load_form(), hk_column::load_from_file(), hk_dsvisible::loaddata(), hk_dsgridcolumn::loaddata(), hk_dscombobox::loaddata(), hk_dsdatavisible::loaddata(), hk_subform::loaddata(), hk_qbe::loaddata(), hk_dsgrid::loaddata(), hk_presentation::loaddata(), hk_button::loaddata(), hk_visible::loaddata(), hk_form::loaddata(), hk_report::loaddata(), hk_connection::loaddata(), hk_datasource::loaddata(), hk_database::new_actionquery(), hk_form::new_bool(), hk_form::new_button(), hk_datasource::new_column(), hk_form::new_combobox(), hk_drivermanager::new_connection(), hk_reportsection::new_data(), hk_connection::new_database(), hk_presentation::new_datasource(), hk_form::new_grid(), hk_form::new_label(), hk_form::new_lineedit(), hk_form::new_memo(), hk_database::new_resultquery(), hk_form::new_rowselector(), hk_report::new_sectionpair(), hk_reportsection::new_uniquevalue(), hk_report::print_report(), hk_reportsection::relativ2horizontal(), hk_reportsection::relativ2vertical(), hk_column::reset_changed_data(), hk_reportsection::reset_count(), hk_dsdatavisible::reset_default(), hk_report::rowcount(), hk_form::save_form(), hk_column::save_to_file(), hk_dsvisible::savedata(), hk_dsgridcolumn::savedata(), hk_dscombobox::savedata(), hk_subform::savedata(), hk_qbe::savedata(), hk_dsgrid::savedata(), hk_presentation::savedata(), hk_button::savedata(), hk_visible::savedata(), hk_form::savedata(), hk_report::savedata(), hk_datasource::savedata(), hk_button::set_action(), hk_importcsv::set_append_rows(), hk_column::set_asbinary(), hk_column::set_asbool(), hk_datasource::set_automatic_data_update(), hk_report::set_borders(), hk_dsgridcolumn::set_columntype(), hk_column::set_columntype(), hk_dsgridcolumn::set_columnwidth(), hk_reportdata::set_configurefunction(), hk_presentation::set_database(), hk_reportdata::set_datacountfunction(), hk_dscombobox::set_datasource(), hk_dsdatavisible::set_datasource(), hk_listvisible::set_datasource(), hk_reportsection::set_datasource(), hk_datetime::set_date(), hk_datetime::set_date_asstring(), hk_datetime::set_dateformat(), hk_datetime::set_datetime(), hk_datetime::set_datetime_asstring(), hk_datetime::set_datetimeformat(), hk_dsdatavisible::set_defaultvalue(), hk_datasource::set_depending_on(), hk_datasource::set_depending_on_presentationdatasource(), hk_presentation::set_designsize(), hk_form::set_designsize(), hk_dsgridcolumn::set_displayname(), hk_dsgrid::set_enablingbehaviour(), hk_importcsv::set_filedefinition(), hk_importcsv::set_filename(), hk_datasource::set_filter(), hk_importcsv::set_firstrow_contains_fieldnames(), hk_label::set_frame(), hk_reportdata::set_frame(), hk_dsgrid::set_gridcolumns(), hk_dsgrid::set_gridcolumnwidth(), hk_dsgrid::set_hold_rowdefinition(), hk_dscombobox::set_listcolumnname(), hk_dscombobox::set_listdatasource(), hk_dscombobox::set_listpresentationdatasource(), hk_subform::set_name(), hk_column::set_name(), hk_datasource::set_name(), hk_database::set_name(), hk_connection::set_newpassword(), hk_column::set_notnull(), hk_datetime::set_now(), hk_visible::set_on_click_action(), hk_report::set_pageformat(), hk_report::set_pagenamecolumn(), hk_report::set_periodic(), hk_column::set_primary(), hk_column::set_readonly(), hk_datasource::set_readonly(), hk_report::set_recodefunction(), hk_reportsection::set_replacefunction(), hk_reportdata::set_replacefunction(), hk_reportsectionpair::set_sections(), hk_column::set_size(), hk_datasource::set_sorting(), hk_actionquery::set_sql(), hk_datasource::set_sql(), hk_reportsection::set_subreport(), hk_datetime::set_time(), hk_datetime::set_time_asstring(), hk_datetime::set_timeformat(), hk_report::set_topline(), hk_reportsection::set_unique(), hk_dsdatavisible::set_value(), hk_dscombobox::set_viewcolumnname(), hk_datasource::setmode_altertable(), hk_datasource::setmode_createtable(), hk_datasource::setmode_insertrow(), hk_datasource::setmode_normal(), hk_connection::show_newpassworddialog(), hk_datasource::store_changed_data(), hk_subform::subform(), hk_database::table_exists(), hk_datetime::time_asstring(), hk_dscombobox::value_at(), hk_dsdatavisible::value_at(), hk_reportsection::vertical2relativ(), hk_dscombobox::widget_specific_row_change(), and hk_connection::~hk_connection().
|
virtual |
loads the object's values out of the definition string. Especially used to load queries, forms and reports
Reimplemented in hk_database, hk_connection, hk_report, hk_form, hk_visible, hk_button, hk_label, hk_presentation, hk_dsgrid, hk_qbe, hk_subform, hk_dsdatavisible, hk_dscombobox, hk_font, hk_dsgridcolumn, hk_colour, hk_tabvisible, hk_dsvisible, hk_module, hk_dsquery, and hk_dsimage.
|
static |
true if widgets can't get in design mode
Referenced by hk_connection::copy_database(), hk_database::copy_table(), hk_importcsv::execute(), hk_presentation::set_mode(), and hk_datasource::setmode_createtable().
|
static |
This function stores all preferences of the hk_classes library in the file ~/.hk_classes/preferences like the defaultdateformat, and hk_report::printcommand
References end_mastertag(), set_tagvalue(), and start_mastertag().
|
virtual |
stores the object's values to stream s. Especially used to store queries, forms and reports
Reimplemented in hk_database, hk_connection, hk_report, hk_form, hk_visible, hk_button, hk_label, hk_presentation, hk_dsgrid, hk_qbe, hk_subform, hk_dsdatavisible, hk_dscombobox, hk_font, hk_dsgridcolumn, hk_colour, hk_tabvisible, hk_dsvisible, hk_module, hk_dsquery, and hk_dsimage.
|
static |
d | if true hk_debug will print messages of ALL classes even if wanna_debug is false for a particular class. |
|
static |
sets the locale which is used for the regional formats (e.g. dataformat). Default is "" that means that the environment variable is queried and set
References hk_translate(), and show_warningmessage().
|
static |
if true all dialogs and messages will be shown. if false only important messages(errors and warnings) will be shown.
s | default = true |
|
static |
you can write your own GUI dependend function to print a string value dialog by defining a function of stringvalue_dialogtype
|
static |
Each value will be stored between delimiting tags in the form <tag>value</tag>
stream | a stream to which the value will be written |
tag | the tag name |
value | the value to be stored |
Referenced by hk_datasource::save_datasourcedefinition(), save_preferences(), hk_dsimage::savedata(), hk_dsquery::savedata(), hk_module::savedata(), hk_colour::savedata(), hk_dsgridcolumn::savedata(), hk_font::savedata(), hk_dscombobox::savedata(), hk_dsdatavisible::savedata(), hk_qbe::savedata(), hk_presentation::savedata(), hk_label::savedata(), hk_button::savedata(), hk_visible::savedata(), hk_form::savedata(), hk_report::savedata(), hk_connection::savedata(), hk_database::savedata(), and hk_datasource::savedata().
|
static |
you can write your own GUI dependend function to print warning messages by defining a function of messagewindowtype
|
static |
you can write your own GUI dependend function to print yes_no message by defining a function of dialogtype
|
static |
prints a question by using a function set with set_stringvaluedialog. If none is set the question will be print to standard error (cerr). The user has to answer the question by entering a string (i.e. a filename).
t | the shown question |
Referenced by hk_datasource::ask_name().
|
static |
prints a warning message by using a function set with set_warningmessage. If none is set the message will be print to standard error (cerr).
Referenced by hk_datasource::add_reference(), hk_datasource::alter_table_now(), hk_connection::connect(), hk_database::copy_table(), hk_connection::create_database(), hk_datasource::create_table_now(), hk_connection::delete_database(), hk_datasource::delete_rows(), hk_database::delete_table(), hk_mysqldatabase::driver_specific_tablelist(), hk_datasource::drop_index(), hk_importcsv::execute(), hk_datasource::load_datasourcedefinition(), hk_form::load_form(), hk_presentation::loaddata(), hk_storagedatasource::memory_error(), hk_drivermanager::new_connection(), hk_database::new_table(), hk_report::print_report(), hk_database::rename_file(), hk_form::save_form(), hk_report::set_borders(), hk_column::set_columntype(), hk_reportdata::set_configurefunction(), hk_reportdata::set_datacountfunction(), hk_dscombobox::set_datasource(), hk_datasource::set_depending_on(), hk_datasource::set_depending_on_presentationdatasource(), hk_visible::set_identifier(), hk_dscombobox::set_listdatasource(), hk_dscombobox::set_listpresentationdatasource(), set_locale(), hk_column::set_name(), hk_connection::set_newpassword(), hk_column::set_notnull(), hk_column::set_primary(), hk_column::set_readonly(), hk_report::set_recodefunction(), hk_reportsection::set_replacefunction(), hk_reportdata::set_replacefunction(), hk_column::set_size(), and hk_connection::show_newpassworddialog().
|
static |
prints a question by using a function set with set_yesnomessage. If none is set the question will be print to standard error (cerr). The user has either to answer the question with yes or no.
m | the shown question |
default_value | if set_show_pedantic == false the default_value will be returned without asking. |
References hk_translate().
Referenced by hk_database::copy_table(), hk_connection::delete_database(), hk_database::delete_file(), hk_datasource::delete_rows(), hk_database::delete_table(), and hk_importcsv::execute().
|
static |
just writes <tag> to a stream. Use this function if you want to begin a section. Don't forget to call end_mastertag
Referenced by hk_datasource::save_datasourcedefinition(), save_preferences(), hk_dsimage::savedata(), hk_dsquery::savedata(), hk_module::savedata(), hk_colour::savedata(), hk_dsgridcolumn::savedata(), hk_font::savedata(), hk_dscombobox::savedata(), hk_dsdatavisible::savedata(), hk_qbe::savedata(), hk_presentation::savedata(), hk_button::savedata(), hk_visible::savedata(), hk_form::savedata(), hk_report::savedata(), hk_connection::savedata(), hk_database::savedata(), and hk_datasource::savedata().
void hk_class::wanna_debug | ( | bool | d | ) |
d | if true hk_debug will print messages of the class else there is no output. |
References wanna_debug().
Referenced by hk_importcsv::create_valuelist(), and wanna_debug().