00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef UITRANSLATOR_H
00023 #define UITRANSLATOR_H
00024
00025 #include <list>
00026 #include "SDL/SDL.h"
00027
00028 using namespace std;
00029
00049 class DECLSPEC UiTranslator
00050 {
00051 public:
00057 DECLSPEC UiTranslator( const char *language = 0 );
00058 virtual DECLSPEC ~UiTranslator();
00059
00063 const char *getLanguage() const { return chLanguage; }
00069 virtual const char *translate( const char *expression ) = 0;
00070
00071 protected:
00077 DECLSPEC void setLanguage( const char * lang );
00078
00079 private:
00080 char * chLanguage;
00081 };
00082
00097 class DECLSPEC UiFileTranslator : public UiTranslator
00098 {
00099 public:
00104 DECLSPEC UiFileTranslator( const char *fn = 0 );
00105 virtual DECLSPEC ~UiFileTranslator();
00106
00112 DECLSPEC bool load( const char *fn );
00113 virtual DECLSPEC const char *translate( const char *expression );
00114
00115 private:
00116 struct EXPRESSION
00117 {
00118 EXPRESSION() {
00119 chCoded = 0;
00120 chTranslated = 0;
00121 }
00122 char *chCoded;
00123 char *chTranslated;
00124 };
00125 list<EXPRESSION> lExpressions[27];
00126 };
00127
00128
00129
00130 #endif