Corrected compiler error
[rofl0r-motor.git] / src / ui / motorui.h
bloba49ae38c9d97f13579458e700b3d2360ab661e49
1 #ifndef __MOTORUI_H__
2 #define __MOTORUI_H__
4 #include "motorcommon.h"
6 #define LF_CREATE_IF_NOTFOUND 2
8 #define EE_PAUSE 2
10 __MOTOR_BEGIN_NAMESPACE
12 class motorui {
13 public:
14 enum askresult {
15 yes, no, cancel, all
18 enum inputkind {
19 file, directory, text,
20 filechroot, directorychroot
23 class editfile {
24 public:
25 editfile();
26 editfile(const string &afname, INT ax, INT ay);
28 string fname;
29 INT x, y;
31 bool operator == (const string &afname);
32 bool operator != (const string &afname);
35 protected:
36 bool outputblocked;
38 public:
39 motorui();
40 ~motorui();
42 virtual void execute(INT argc, char **argv);
43 virtual void redraw();
45 virtual askresult ask(const string &answersallowed, const string &text);
46 virtual askresult askf(const string &answersallowed, const char *fmt, ...);
48 virtual void log(const string &text = "");
49 virtual void logf(const char *fmt, ...);
51 virtual void loadeditfile(const editfile ef, INT options = 0);
52 virtual void reloadeditfiles();
53 virtual void setdebugcurrentline(const editfile ef);
54 virtual vector<editfile> geteditfiles();
55 // the last item gotta be the current file name
56 virtual vector<string> geteditfile(const string &fname);
58 virtual bool editcloseall();
59 virtual bool autosave();
61 virtual askresult input(inputkind kind, string &result, const string &prompt);
63 virtual void setoutputblockmode(bool fblock);
64 virtual void writeoutput(const string &text);
65 virtual void doneoutput();
66 virtual void executordone(const string &target, INT nerr,
67 INT nwarn, INT ninfo);
69 virtual void externalexec(INT options, const string &cmd);
70 virtual void externalexecf(INT options, const char *fmt, ...);
72 virtual void setdesktop(const vector< pair<string, string> > &asettings);
73 virtual vector< pair<string, string > > getdesktop() const;
74 // This pair of functions deal with project
75 // specific UI settings
77 virtual void updatewatches();
78 virtual bool editmodified() const;
80 virtual askresult notemplate(string &templname) const;
83 __MOTOR_END_NAMESPACE
85 #ifdef __MOTOR_USE_NAMESPACES
87 using motor::motorui;
89 #endif
91 extern motorui &ui;
93 #endif