#ifndef ACTION_H
#define ACTION_H

#define OK TCL_OK
#define ERROR TCL_ERROR

class handler;


///static int dummycommand( client*, int, char** ) { cout << " dummy command " << endl; return OK; }

class genaction {
public:

genaction(kit* tk, char* cmd);

genaction(kit* tk, char* s, handler* h);
genaction(kit* tk, char* s, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "");
genaction(kit* tk, char* s, tclcommand proc, clientdata c = 0);

genaction(kit* tk, handler* h);
genaction(kit* tk, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "");
genaction(kit* tk, tclcommand proc, clientdata c = 0);

char* name() { return name_; }
private:
static int n;
char name_[512];
};

class action : public genaction {  /// for the user
public:
action(char* cmd) : genaction(thekit(),cmd) { }
action(char* s, handler* h) : genaction(thekit(),s,h) { }
action(char* s, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "") :
	genaction(thekit(),s,proc,c,w,n,it) { }
action(char* s, tclcommand proc, clientdata c = 0) :
	genaction(thekit(),s,proc,c) {}

action(handler* h) : genaction(thekit(),h) { }
action(command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "") :
	genaction(thekit(),proc,c,w,n,it) { }
action(tclcommand proc, clientdata c = 0) :
	genaction(thekit(),proc,c) {}

action(kit* tk, char* cmd) : genaction(tk,cmd) { }
action(kit* tk, char* s, handler* h) : genaction(tk,s,h) { }
action(kit* tk, char* s, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "") :
	genaction(tk,s,proc,c,w,n,it) { }
action(kit* tk, char* s, tclcommand proc, clientdata c = 0) :
	genaction(tk,s,proc,c) {}

action(kit* tk, handler* h) : genaction(tk,h) { }
action(kit* tk, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "") :
	genaction(tk,proc,c,w,n,it) { }
action(kit* tk, tclcommand proc, clientdata c = 0) :
	genaction(tk,proc,c) {}
};

class tclaction : public action {  /// just to fool the compiler
public:
tclaction(kit* tk, char* cmd) : action(tk,cmd) { }
tclaction(kit* tk, char* s, handler* h) : action(tk,s,h) { }
tclaction(kit* tk, char* s, command proc, client* c = 0, widget* w = 0, int n = 0, char* it = "") :
	action(tk,s,proc,c,w,n,it) { }
tclaction(kit* tk, char* s, tclcommand proc, clientdata c = 0) :
	action(tk,s,proc,c) {}
};
#endif
