00001 #pragma once
00002
00027 #ifndef __USER_INTERFACE_H__
00028 #define __USER_INTERFACE_H__
00029
00030
00031 #include "console.h"
00032
00033
00034 using std::string;
00035
00037 class user_interface
00038 {
00039
00040 public:
00042 enum console_type { AUTO, MONO, ANSI, WIND };
00043
00044
00045 public:
00046 ~user_interface(void);
00047 static void CreateInstance(console_type ConsoleType = AUTO);
00048 static void DeleteInstance(void);
00049 static user_interface* Instance(void);
00050 bool Ask(const string& Question, const char TrueOption, const char FalseOption, const bool DefaultAnswer);
00051 string Ask(const string& Question, const string& DefaultAnswer);
00052 int Ask(const string& Question, const int DefaultAnswer);
00053 void Message(const string& Message, console::console_color CColor=console::BRIGHT_WHITE);
00054 void DebugMessage(const string& Message);
00055 void ExceptionMessage(const string& Message);
00056 void LogMessage(const string& Message);
00057 void StartLoopMessage(void);
00058 void LoopMessage(const string& Message, console::console_color CColor=console::BRIGHT_WHITE);
00059 void StopLoopMessage(void);
00060 void Version(void);
00061 void Help(void);
00062 private:
00063 user_interface(console_type ConsoleType);
00064 user_interface(const user_interface& Obj);
00065
00066
00067 private:
00068 console* m_pConsole;
00069 static user_interface* m_pInstance;
00070 bool m_LoopMessage;
00071 string::size_type m_LastLoopMessageLength;
00072 };
00073
00074 #endif // __USER_INTERFACE_H__
00075