Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

record_t Class Reference

#import <record_t.h>

Inheritance diagram for record_t:

Object List of all members.

Public Member Functions

(id) init
(id) free
(void) add_record_that_joins:
(char *) record_by_function_key:
(int) add_field:::::::::
(int) add_field_mb:::::::::
(int) add_label:::
(int) add_label_mb:::
(time_t) dateformat_to_time_t::
(wchar_t *) time_t_to_dateformat:::
(long) id_of_record
(long) id_master_of_record
(void) set_id_of_record:
(void) set_id_master_of_record:
(record_state_tstate
(kort_action_taction_by_function_key:
(void) set_action_by_function_key:::::
(void) set_codetext_by_function_key:::
(void) set_codetext_for_last_field_for_enter:
(void) set_codetext_for_last_field_for_leave:
(char *) script_code_by_function_key:
(char *) script_code_for_leave_by_field:
(char *) script_code_for_enter_by_field:

Static Public Member Functions

(id) init_with_name:name:

Public Attributes

char * recordname
long record_id
long record_id_master
record_trecord_that_we_join_to
pointerlist_trecords_that_join_me
int nfields
int field_x [MAX_FIELDS_FOR_ONE_RECORD]
int field_y [MAX_FIELDS_FOR_ONE_RECORD]
int field_len [MAX_FIELDS_FOR_ONE_RECORD]
wchar_t * fieldlabels [MAX_FIELDS_FOR_ONE_RECORD]
field_type_t type_of_field [MAX_FIELDS_FOR_ONE_RECORD]
wchar_t * regex_of_field [MAX_FIELDS_FOR_ONE_RECORD]
wchar_t * constlabels [MAX_FIELDS_FOR_ONE_RECORD]
maybe_t is_field_saved [MAX_FIELDS_FOR_ONE_RECORD]
int nlabels
int label_x [MAX_FIELDS_FOR_ONE_RECORD]
int label_y [MAX_FIELDS_FOR_ONE_RECORD]
char * allowed_values_table_for_field [MAX_FIELDS_FOR_ONE_RECORD]
char * allowed_values_column_for_field [MAX_FIELDS_FOR_ONE_RECORD]
char * fieldnames_in_db [MAX_FIELDS_FOR_ONE_RECORD]
maybe_t askfirst [12+1]
char * tablename
char * tclcode_onenter_record
char * tclcode_onleave_record
char * tclcode_beforesave_record
char * tclcode_afterretrieve_record
char * tclcode_aftersave_record
char * tclcode_beforeretrieve_record
char * tclcode_at_message
wchar_t * dateformatstring_of_field [MAX_FIELDS_FOR_ONE_RECORD]
record_state_t record_state
wchar_t * func_key_labels [12+1]

Protected Attributes

kort_action_t func_key_actions [12+1]
char * func_key_recordnamepointers [12+1]
char * tclcode_for_function_key [12]
long ** subkeylist
long subkeyindex
long nsubkeys
int index_of_last_database_field
char * next_record_name
char * tclcode_onenter_field [MAX_FIELDS_FOR_ONE_RECORD]
char * tclcode_onleave_field [MAX_FIELDS_FOR_ONE_RECORD]

Detailed Description

data structure for record. record is a container for fields and labels and actions that user may do to them.


Member Function Documentation

- (kort_action_t) action_by_function_key: (unsigned)  aKey  
 

returns action by function key

- (int) add_field: (char *)  dbname
: (wchar_t *)  label
: (int)  row
: (int)  col
: (int)  len
: (maybe_t saved_or_not
: (field_type_t a_type
: (wchar_t *)  regex
: (wchar_t *)  dateformat
 
 

method for adding a field to record. note that string arguments will not be free'd and that is different from add_field_mb method.

Parameters:
dbname is name of db table column where field value will be stored
label is text for label that will be printed in front of the field
row is row in the screen
col is column in the screen
len is length of field. for date-typed fields this does not matter
saved_or_not tells whether field will be saved to db or not
a_type tells what kind of content to expect
regex specifies (optional) regular expression that is forced
dateformat if field type is date/time then format needs to be supplied
Returns:
0 on success

- (int) add_field_mb: (char *)  dbname
: (char *)  label
: (int)  row
: (int)  col
: (int)  len
: (maybe_t saved_or_not
: (field_type_t a_type
: (char *)  regex
: (char *)  dateformat
 
 

method for adding a field to record, multibyte input. note that this method fill free() dbname,label,regex and dateformat. this method takes multibyte input strings.

Parameters:
dbname what this field is called in database table, a field name
label what user will see in front of this field
row which row the field is located at
col row is beginning of associated label
len length of field.
saved_or_not when set to yes then value will be saved to db
a_type is field type like string/numeric/date
regex this is the regular expression that the field must match
dateformat if field is a datetime, then here is its format string
Returns:
0 on success.

- (int) add_label: (wchar_t *)  label
: (int)  row
: (int)  col
 
 

method for adding a label to record

Parameters:
label is text for label
row specifies location
col specifies location
Returns:
0 on success

- (int) add_label_mb: (char *)  label
: (int)  row
: (int)  col
 
 

method for adding a label to record and givin content in mb

- (void) add_record_that_joins: (record_t *)  joining_record  
 

method for adding "joins to" property between this and another record

- (time_t) dateformat_to_time_t: (dateformatspec_t *)  format
: (wchar_t *)  stringie
 
 

to time util methods

Parameters:
format tells how to interpret stringie
stringie is content from date/time field
Returns:
time_t constructed from format and stringie

- (id) free  
 

frees allocated memory

- (long) id_master_of_record  
 

and if this is a sub-record, returns master record id

- (long) id_of_record  
 

returns record id

- (id) init  
 

default initializer

+ (id) init_with_name: (char *) 
name: (char *)  table
 
 

the "allocator" usually used is here

- (char *) record_by_function_key: (int)  function_key_index  
 

method that returns record name from function key table

- (char *) script_code_by_function_key: (unsigned)  aFunctionKey  
 

returns script code based by function key number

- (char *) script_code_for_enter_by_field: (unsigned)  aField  
 

returns script code to be run when entering field specified by aField index

- (char *) script_code_for_leave_by_field: (unsigned)  aField  
 

returns script code to be run when leaving field specified by aField index

- (void) set_action_by_function_key: (unsigned)  aKey
: (kort_action_t aAction
: (char *)  aLabel
: (maybe_t aAskQuestions
: (char *)  aNextRecord
 
 

method that set action that will happen when user presses function key and this record is on display.

Parameters:
aKey is number of function key in range 1-12. 0 is not in use
aAction tells what will happen
aLabel is "help text" printed on bottom of screen
aAskQuestions specifies whether user confirmation is needed
aNextRecord in case of "move to record" action, this tells the next record
Returns:
none

- (void) set_codetext_by_function_key: (unsigned)  aKey
: (char *)  aLabel
: (char *)  aCode
 
 

method that binds script text to function key

Parameters:
aKey is number of function key in range 1-12. 0 is not in use
aLabel is "help text" printed on bottom of screen
aCode is the actual script code that will be interpreted
Returns:
none

- (void) set_codetext_for_last_field_for_enter: (char *)  aCode  
 

binds script text for last added record field and the script text willbe run when the field is about to be entered

- (void) set_codetext_for_last_field_for_leave: (char *)  aCode  
 

binds script text for last added record field and the script text willbe run when the field is about to be left (losing focus)

- (void) set_id_master_of_record: (long)  aId  
 

and if this is a sub-record, sets master record id

- (void) set_id_of_record: (long)  aId  
 

sets record id

- (record_state_t) state  
 

returns record state

- (wchar_t *) time_t_to_dateformat: (wchar_t *)  formatstr
: (dateformatspec_t *)  format
: (time_t)  timie
 
 

inverse method of dateformat_to_time_t. returns string from time_t.

Parameters:
formatstr is dateformat in string form
format is dateformat in struct form
timie is the time_t, the actual input
Returns:
string representation of timie


Member Data Documentation

- (char* allowed_values_column_for_field[MAX_FIELDS_FOR_ONE_RECORD])
 

and column

- (char* allowed_values_table_for_field[MAX_FIELDS_FOR_ONE_RECORD])
 

table name fro ALLOWED_VALUES

- (wchar_t* constlabels[MAX_FIELDS_FOR_ONE_RECORD])
 

here are thingies given as LABEL x y "text"

- (int field_len[MAX_FIELDS_FOR_ONE_RECORD])
 

len

- (int field_x[MAX_FIELDS_FOR_ONE_RECORD])
 

0-255 fields, visible x coordinate

- (int field_y[MAX_FIELDS_FOR_ONE_RECORD])
 

y coordinate

- (wchar_t* fieldlabels[MAX_FIELDS_FOR_ONE_RECORD])
 

and their labels

- (char* fieldnames_in_db[MAX_FIELDS_FOR_ONE_RECORD])
 

column names for said fields

- (kort_action_t func_key_actions[12+1]) [protected]
 

when function key is pressed, action is looked up from here:

- (wchar_t* func_key_labels[12+1])
 

function key labels are printed on bottom of screen, saved here

- (char* func_key_recordnamepointers[12+1]) [protected]
 

when function key for another record is pressed, record is looked up here

- (maybe_t is_field_saved[MAX_FIELDS_FOR_ONE_RECORD])
 

if field [n] is saved or not

- (int label_x[MAX_FIELDS_FOR_ONE_RECORD])
 

their coordinates

- (int) nlabels
 

how many LABEL x y "text" labels there are

- (long) record_id
 

surrogate key for this records row in db

- (long) record_id_master
 

value of surrogate key of this records parent in db

- (record_state_t) record_state
 

record state in respect to database table content

- (record_t*) record_that_we_join_to
 

pointer to possible parent of ours in tree-like data-model this is a record property

- (char*) recordname
 

name of this record

- (pointerlist_t*) records_that_join_me
 

pointer to our siblings in tree-like data-model

- (wchar_t* regex_of_field[MAX_FIELDS_FOR_ONE_RECORD])
 

regular expression that field must match

- (char* tclcode_for_function_key[12]) [protected]
 

when function key for script code is pressed, code is looked up from here

- (char* tclcode_onenter_field[MAX_FIELDS_FOR_ONE_RECORD]) [protected]
 

when user switches form field, there may be script executed

- (char* tclcode_onleave_field[MAX_FIELDS_FOR_ONE_RECORD]) [protected]
 

when user switches form field, there may be script executed

- (field_type_t type_of_field[MAX_FIELDS_FOR_ONE_RECORD])
 

datatype for a field


The documentation for this class was generated from the following file:
Generated on Sun May 15 23:45:25 2005 for kort4 by  doxygen 1.4.2