Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef ERROR_H
00013 #define ERROR_H
00014
00015 #include "strings_type.h"
00016 #include "company_type.h"
00017 #include "core/geometry_type.hpp"
00018
00020 enum WarningLevel {
00021 WL_INFO,
00022 WL_WARNING,
00023 WL_ERROR,
00024 WL_CRITICAL,
00025 };
00026
00028 class ErrorMessageData {
00029 protected:
00030 uint duration;
00031 uint64 decode_params[20];
00032 const char *strings[20];
00033 uint textref_stack_size;
00034 uint32 textref_stack[16];
00035 StringID summary_msg;
00036 StringID detailed_msg;
00037 Point position;
00038 CompanyID face;
00039
00040 public:
00041 ErrorMessageData(const ErrorMessageData &data);
00042 ~ErrorMessageData();
00043 ErrorMessageData(StringID summary_msg, StringID detailed_msg, uint duration = 0, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
00044
00045 void SetDParam(uint n, uint64 v);
00046 void SetDParamStr(uint n, const char *str);
00047
00048 void CopyOutDParams();
00049 };
00050
00051 void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, uint textref_stack_size = 0, const uint32 *textref_stack = NULL);
00052 void ClearErrorMessages();
00053 void ShowFirstError();
00054 void UnshowCriticalError();
00055
00056 #endif