|
|
hk_class is the basic class for all other defined classes. It has some methods to support a simple debugging.
enum enum_interaction {noninteractive,interactive} | enum_interaction |
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.
void hkclassname (const hk_string& n)
| hkclassname |
The classname is for internal debugging use only It will be shown in front of all debugging messages.
hk_string hkclassname (void)
| hkclassname |
[const]
void hkdebug (const hk_string& d)
| hkdebug |
[const]
if wanna_debug is true hkdebug prints on standard output the classname and the message d.
Parameters:
d | is the message that will be printed. |
void hkdebug (const hk_string& d, const hk_string& e)
| hkdebug |
[const]
void hkdebug (const hk_string& d, int i)
| hkdebug |
[const]
void hkdebug (const hk_string& d, double i)
| hkdebug |
[const]
void wanna_debug (bool d)
| wanna_debug |
Parameters:
d | if true hk_debug will print messages of the class else there is no output. |
bool wanna_debug (void)
| wanna_debug |
[const]
void set_generaldebug (bool d)
| set_generaldebug |
[static]
Parameters:
d | if true hk_debug will print messages of ALL classes even if wanna_debug is false for a particular class. |
bool generaldebug (void)
| generaldebug |
hk_string hk_translate (const hk_string& t)
| hk_translate |
[static]
tries to translate the message t by using the translatingfunction set with set_translatefunction.
Returns: the translated message. If translating was not possible it will return the parameter t unchanged.
void show_warningmessage (const hk_string& m)
| show_warningmessage |
[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).
void set_warningmessage (messagewindowtype* m)
| set_warningmessage |
[static]
you can write your own GUI dependend function to print warning messages by defining a function of messagewindowtype
bool show_yesnodialog (const hk_string& m, bool default_value)
| show_yesnodialog |
[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.
Parameters:
m | the shown question |
default_value | if set_show_pedantic == false the default_value will be returned without asking. |
void set_yesnodialog (yesno_dialogtype* d)
| set_yesnodialog |
[static]
you can write your own GUI dependend function to print yes_no message by defining a function of dialogtype
hk_string show_stringvaluedialog (const hk_string& t)
| show_stringvaluedialog |
[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).
Parameters:
t | the shown question |
Returns: the string the user gave as an answer
void set_stringvaluedialog (stringvalue_dialogtype* t)
| set_stringvaluedialog |
[static]
you can write your own GUI dependend function to print a string value dialog by defining a function of stringvalue_dialogtype
void set_translatefunction (translatefunctiontype* t)
| set_translatefunction |
[static]
void set_showpedantic (bool s)
| set_showpedantic |
[static]
if true all dialogs and messages will be shown. if false only important messages(errors and warnings) will be shown.
Parameters:
s | default = true |
bool showpedantic (void)
| showpedantic |
[static]
enum enum_measuresystem {cm,inch} | enum_measuresystem |
void set_measuresystem (enum_measuresystem)
| set_measuresystem |
[static]
enum_measuresystem measuresystem (void)
| measuresystem |
[static]
void savedata (ostream& s)
| savedata |
[virtual]
stores the object's values to stream s. Especially used to store queries, forms and reports
void loaddata (const hk_string& definition)
| loaddata |
[virtual]
loads the object's values out of the definition string. Especially used to load queries, forms and reports
enum enum_tagtype {normaltag,mastertag} | enum_tagtype |
bool get_tagvalue (const hk_string &where, const hk_string &tag, hk_string &value, int position=1,enum_tagtype tagtype=normaltag)
| get_tagvalue |
[static]
called from loaddata to load a variable value originally stored with set_tagvalue
Parameters:
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. |
Returns: true if the tag was found and the value could be set else false
bool get_tagvalue (const hk_string &where, const hk_string &tag, unsigned long &value, int position=1)
| get_tagvalue |
[static]
bool get_tagvalue (const hk_string &where, const hk_string &tag, unsigned int &value, int position=1)
| get_tagvalue |
[static]
bool get_tagvalue (const hk_string &where, const hk_string &tag, long &value, int position=1)
| get_tagvalue |
[static]
bool get_tagvalue (const hk_string &where, const hk_string &tag, int &value, int position=1)
| get_tagvalue |
[static]
bool get_tagvalue (const hk_string &where, const hk_string &tag, bool &value, int position=1)
| get_tagvalue |
[static]
void set_tagvalue (ostream& stream,const hk_string& tag,const hk_string& value)
| set_tagvalue |
[static]
Each value will be stored between delimiting tags in the form
Parameters:
stream | a stream to which the value will be written |
tag | the tag name |
value | the value to be stored |
void set_tagvalue (ostream& stream,const hk_string& tag,unsigned long value)
| set_tagvalue |
[static]
void set_tagvalue (ostream& stream,const hk_string& tag,unsigned int value)
| set_tagvalue |
[static]
void set_tagvalue (ostream& stream,const hk_string& tag,long value)
| set_tagvalue |
[static]
void set_tagvalue (ostream& stream,const hk_string& tag,int value)
| set_tagvalue |
[static]
void set_tagvalue (ostream& stream,const hk_string& tag,bool value)
| set_tagvalue |
[static]
void start_mastertag (ostream& stream,const hk_string& tag)
| start_mastertag |
[static]
just writes
void end_mastertag (ostream& stream,const hk_string& tag)
| end_mastertag |
[static]
just writes to a stream. Use this function if you want to end a section
void set_defaultdatetimeformat (const hk_string& timeformat,const hk_string& dateformat,const hk_string&datetimeformat)
| set_defaultdatetimeformat |
[static]
hk_string defaultdateformat (void)
| defaultdateformat |
[static]
hk_string defaulttimeformat (void)
| defaulttimeformat |
[static]
hk_string defaultdatetimeformat (void)
| defaultdatetimeformat |
[static]
void save_preferences (void)
| save_preferences |
[static]
This function stores all preferences of the hk_classes library in the file ~/.hk_classes/preferences like the defaultdateformat, and hk_report::printcommand
bool runtime_only (void)
| runtime_only |
[static]
true if widgets can't get in design mode
void set_locale (const hk_string& locale)
| set_locale |
[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
hk_string locale (void)
| locale |
[static]
void set_defaultdriver (const hk_string& d)
| set_defaultdriver |
[static]
hk_string defaultdriver (void)
| defaultdriver |
[static]
hk_class (void)
| hk_class |
[protected]
~hk_class (void)
| ~hk_class |
[protected virtual]
hk_interpreter* new_interpreter (const hk_string& interpreter,hk_presentation*)
| new_interpreter |
[protected]
static hk_string p_defaulttimeformat | p_defaulttimeformat |
[protected]
static hk_string p_defaultdateformat | p_defaultdateformat |
[protected]
static hk_string p_defaultdatetimeformat | p_defaultdatetimeformat |
[protected]
static bool p_runtime_only | p_runtime_only |
[protected]