#pragma interface #ifndef TLMPDIA_H #define TLMPDIA_H #ifndef PRIVATE_MSG_H #include #endif #define _TLMP_uithread struct _F_uithread{ class UITHREAD_PRIVATE *priv; void dontwait(); #define _F_uithread_thread1(nom) void nom thread1() virtual _F_uithread_thread1( )=0; #define _F_uithread_thread2(nom) void nom thread2() virtual _F_uithread_thread2( ); #define _F_uithread_thread3(nom) void nom thread3() virtual _F_uithread_thread3( ); #define _F_uithread_thread4(nom) void nom thread4() virtual _F_uithread_thread4( ); #define _F_uithread_thread5(nom) void nom thread5() virtual _F_uithread_thread5( ); }; #define _TLMP_editmenu struct _F_editmenu{ class EDITMENU_PRIVATE *priv; #define _F_editmenu_exec(nom) void nom exec(const char *key, int no) virtual _F_editmenu_exec( ); #define _F_editmenu_execthread(nom) void nom execthread(const char *key, int no) virtual _F_editmenu_execthread( ); }; class HELP_FILE; #ifndef DIALOG_H #include #endif class UISTATE; /* Use to control the quit sequence of a GUI program. Used by the FRAMEWORK object of libtlmpwork for one. */ class FRAMEWORK_MSGS{ public: PRIVATE_MESSAGE mayend; // Message sent to ask the document if they // are willing to end // The document must call endok. PRIVATE_MESSAGE ending; // Sent when the framework is ending /*~PROTOBEG~ FRAMEWORK_MSGS */ public: FRAMEWORK_MSGS (void); virtual void endok (void); bool is_ending (void); bool is_mayend (void); void waitfor (DIALOG&dia); virtual ~FRAMEWORK_MSGS (void); /*~PROTOEND~ FRAMEWORK_MSGS */ }; enum SORT_ORDER { SORT_NONE, SORT_ASC, SORT_DESC}; #define _TLMP_editrecords struct _F_editrecords{ class EDITRECORDS_PRIVATE *priv; void new_menuitem (const char *, const char *); void new_menuitemf (const char *, const char *, ...); void newf_head (const char *s); void addwhat(const char *s); void delwhat(const char *s); void setbutinfo(int id, const char *title, const char *icon); void setcontext(const char *s); void set_button_on_side(); void waitfor (PRIVATE_MESSAGE &msg); void settype (DIALOG_TYPE type); void endedit(); void setcursor(int); void setvsize(int); void newf_clist(); void new_button (int id, const char *title, const char *help); void new_button_icon (int id, const char *icon, const char *help); void new_button_help (); void set_button (int id, const char *title); void set_button_icon (int id, const char *icon); void set_lookup(int no); void set_lookup(const char *key); const char *get_lookup(int no); void gui_passthrough (int cmd, const char *ctl, ...); void handle (FRAMEWORK_MSGS &msgs); void newline(); void newf_chk (const char *prompt, char &var, const char *title); void newf_str (const char *prompt, SSTRING &s); void nobutton(); void sortcolumn(int column, SORT_ORDER order); void sortable(); void selectsort (int head); void setnextdcs (const char *dcs); void setnexttagged (); void setdefaultdcs (const char *dcs); void sethdispo (const char *hdisp); void sortpolicy (const char *policy); void setkeyformat (HTML_KEY_TYPE key_type); int getnext (int pos); int getprev (int pos); #define _F_editrecords_load(nom) void nom load(int column, SORT_ORDER order) virtual _F_editrecords_load( )=0; #define _F_editrecords_head(nom) void nom head() virtual _F_editrecords_head( )=0; #define _F_editrecords_editone(nom) void nom editone(int no, UISTATE &uistate) virtual _F_editrecords_editone( ); #define _F_editrecords_pickone(nom) void nom pickone(int no, UISTATE &uistate) virtual _F_editrecords_pickone( ); #define _F_editrecords_add(nom) void nom add() virtual _F_editrecords_add( ); #define _F_editrecords_otherbuttons(nom) void nom otherbuttons(MENU_STATUS code, int id) virtual _F_editrecords_otherbuttons( ); #define _F_editrecords_message(nom) void nom message() virtual _F_editrecords_message( ); #define _F_editrecords_guidialog(nom) void nom guidialog() virtual _F_editrecords_guidialog( ); #define _F_editrecords_clickhead(nom) void nom clickhead(int head, UISTATE &state) virtual _F_editrecords_clickhead( ); // Some spares for binary compatibility virtual void _slot1(); virtual void _slot2(); virtual void _slot3(); virtual void _slot4(); virtual void _slot5(); virtual void _slot6(); virtual void _slot7(); virtual void _slot8(); virtual void _slot9(); }; #define _TLMP_editmanyrecords struct _F_editmanyrecords: public _F_editrecords{ #define _F_editmanyrecords_load(nom) _F_editrecords_load(nom) #define _F_editmanyrecords_head(nom) _F_editrecords_head(nom) #define _F_editmanyrecords_editone(nom) _F_editrecords_editone(nom) #define _F_editmanyrecords_add(nom) _F_editrecords_add(nom) #define _F_editmanyrecords_otherbuttons(nom) _F_editrecords_otherbuttons(nom) }; #define _TLMP_edittree struct _F_edittree{ class _F_edittree_private *priv; // The tree edit is not limited to file and directories, but we are using // this naming to help. void new_subdir (const char *title, bool isexpanded); void new_subdir (const char *title); void end_subdir (); void new_file (const char *title); void nobutton(); void set_lookup(int no); void set_lookup(const char *key); void set_lookup(ARRAY_OBJ *o); void handle (FRAMEWORK_MSGS &msgs); void waitfor (PRIVATE_MESSAGE &msg); void settype (DIALOG_TYPE type); void setsize (int width, int height); void setnextdcs (const char *dcs); void setnexttagged (); void setdefaultdcs (const char *dcs); // Load the sub-branches (sub-directories) // a string path and and integer path allows the client to learn // which "directory" must be loaded #define _F_edittree_init(nom) void nom init() virtual _F_edittree_init( ); #define _F_edittree_load(nom) void nom load(int level, const char *spath, const int ipath[]) virtual _F_edittree_load( )=0; #define _F_edittree_editone(nom) void nom editone(int no, const char *key, ARRAY_OBJ *obj, const char *spath, const int ipath[], int level, UISTATE &uistate) virtual _F_edittree_editone( )=0; #define _F_edittree_message(nom) void nom message(bool &end) virtual _F_edittree_message( ); }; #define _TLMP_diapopup1 struct _F_diapopup1{ class _F_diapopup1_private *priv; void dismiss(); #define _F_diapopup1_ok(nom) void nom ok(const char *val, bool &reject, int &retcode) virtual _F_diapopup1_ok( )=0; }; void *forktmp_mapshare (int len); void forktmp_unmap (void *, int len); template < class T> class SHAREMEM_MMAP{ public: void *mem; SHAREMEM_MMAP(){ mem = forktmp_mapshare (sizeof(T)); } ~SHAREMEM_MMAP(){ forktmp_unmap (mem,sizeof(T)); } }; template < class T> class SHAREMEM: SHAREMEM_MMAP{ public: T &p; SHAREMEM(): p(*(T*)SHAREMEM_MMAP::mem){ // We need a way to call the constructor, surely doable in C++ } }; #define _TLMP_forktmp class _F_forktmp { public: class _F_forktmp_private *priv; void kill(); void join(int state); #define _F_forktmp_task(nom) void nom task() virtual _F_forktmp_task( )=0; #define _F_forktmp_message(nom) void nom message(bool &end) virtual _F_forktmp_message( ); #define _F_forktmp_timeout(nom) void nom timeout(bool &end, int duration) virtual _F_forktmp_timeout( ); #define _F_forktmp_joining(nom) void nom joining(bool &end, int state) virtual _F_forktmp_joining( ); #define _F_forktmp_failed(nom) void nom failed() virtual _F_forktmp_failed( ); }; class DICTIONARY; #if 0 #define _TLMP_TLMPDIA_COMNG struct _F_TLMPDIA_COMNG{ class TLMPDIA_COMNG_PRIVATE *priv; #define _F_TLMPDIA_COMNG_setupdia(nom) void nom setupdia(DIALOG &dia,DICTIONARY &dict, ARRAY_OBJ *&data) virtual _F_TLMPDIA_COMNG_setupdia( ); #define _F_TLMPDIA_COMNG_save(nom) int nom save(PRIVILEGE *privi,DICTIONARY &dict, ARRAY_OBJ *data) virtual _F_TLMPDIA_COMNG_save( ); #define _F_TLMPDIA_COMNG_validate(nom) int nom validate(DIALOG &dia, int &no,DICTIONARY &dict, ARRAY_OBJ *data) virtual _F_TLMPDIA_COMNG_validate( ); #define _F_TLMPDIA_COMNG_deluser(nom) int nom deluser(PRIVILEGE *privi,DICTIONARY &dict, ARRAY_OBJ *data) virtual _F_TLMPDIA_COMNG_deluser( ); }; class USERACCT_COMNG; class TLMPDIA_COMNG: public ARRAY_OBJ{ class TLMPDIA_COMNG_PRIVATE *priv; /*~PROTOBEG~ TLMPDIA_COMNG */ public: TLMPDIA_COMNG (_F_TLMPDIA_COMNG&c, const char *key); USERACCT_COMNG *setup (const char *key, DICTIONARY&dict); ~TLMPDIA_COMNG (void); /*~PROTOEND~ TLMPDIA_COMNG */ }; #endif #include "tlmpdia.p" #endif