00001 00032 // NOTE: this is a MINIMAL implementation. The interface will remain, but the implementation will 00033 // (when the time is right) become dynamic and probably use external files. 00034 00035 #ifndef LL_LLRESMGR_H 00036 #define LL_LLRESMGR_H 00037 00038 #include "locale.h" 00039 #include "stdtypes.h" 00040 #include "llstring.h" 00041 00042 enum LLLOCALE_ID 00043 { 00044 LLLOCALE_USA, 00045 LLLOCALE_UK, 00046 LLLOCALE_COUNT // Number of values in this enum. Keep at end. 00047 }; 00048 00049 /* 00050 enum LLSTR_ID 00051 { 00052 LLSTR_HELLO, 00053 LLSTR_GOODBYE, 00054 LLSTR_CHAT_LABEL, 00055 LLSTR_STATUS_LABEL, 00056 LLSTR_X, 00057 LLSTR_Y, 00058 LLSTR_Z, 00059 LLSTR_POSITION, 00060 LLSTR_SCALE, 00061 LLSTR_ROTATION, 00062 LLSTR_HAS_PHYSICS, 00063 LLSTR_SCRIPT, 00064 LLSTR_HELP, 00065 LLSTR_REMOVE, 00066 LLSTR_CLEAR, 00067 LLSTR_APPLY, 00068 LLSTR_CANCEL, 00069 LLSTR_MATERIAL, 00070 LLSTR_FACE, 00071 LLSTR_TEXTURE, 00072 LLSTR_TEXTURE_SIZE, 00073 LLSTR_TEXTURE_OFFSET, 00074 LLSTR_TEXTURE_ROTATION, 00075 LLSTR_U, 00076 LLSTR_V, 00077 LLSTR_OWNERSHIP, 00078 LLSTR_PUBLIC, 00079 LLSTR_PRIVATE, 00080 LLSTR_REVERT, 00081 LLSTR_INSERT_SAMPLE, 00082 LLSTR_SET_TEXTURE, 00083 LLSTR_EDIT_SCRIPT, 00084 LLSTR_MOUSELOOK_INSTRUCTIONS, 00085 LLSTR_EDIT_FACE_INSTRUCTIONS, 00086 LLSTR_CLOSE, 00087 LLSTR_MOVE, 00088 LLSTR_ROTATE, 00089 LLSTR_RESIZE, 00090 LLSTR_PLACE_BOX, 00091 LLSTR_PLACE_PRISM, 00092 LLSTR_PLACE_PYRAMID, 00093 LLSTR_PLACE_TETRAHEDRON, 00094 LLSTR_PLACE_CYLINDER, 00095 LLSTR_PLACE_HALF_CYLINDER, 00096 LLSTR_PLACE_CONE, 00097 LLSTR_PLACE_HALF_CONE, 00098 LLSTR_PLACE_SPHERE, 00099 LLSTR_PLACE_HALF_SPHERE, 00100 LLSTR_PLACE_BIRD, 00101 LLSTR_PLACE_SNAKE, 00102 LLSTR_PLACE_ROCK, 00103 LLSTR_PLACE_TREE, 00104 LLSTR_PLACE_GRASS, 00105 LLSTR_MODIFY_LAND, 00106 LLSTR_COUNT // Number of values in this enum. Keep at end. 00107 }; 00108 */ 00109 00110 enum LLFONT_ID 00111 { 00112 LLFONT_OCRA, 00113 LLFONT_SANSSERIF, 00114 LLFONT_SANSSERIF_SMALL, 00115 LLFONT_SANSSERIF_BIG, 00116 LLFONT_SMALL, 00117 LLFONT_COUNT // Number of values in this enum. Keep at end. 00118 }; 00119 00120 class LLFontGL; 00121 00122 class LLResMgr 00123 { 00124 public: 00125 LLResMgr(); 00126 00127 void setLocale( LLLOCALE_ID locale_id ); 00128 LLLOCALE_ID getLocale() const { return mLocale; } 00129 00130 char getDecimalPoint() const; 00131 char getThousandsSeparator() const; 00132 00133 char getMonetaryDecimalPoint() const; 00134 char getMonetaryThousandsSeparator() const; 00135 std::string getMonetaryString( S32 input ) const; 00136 void getIntegerString( LLString& output, S32 input ) const; 00137 00138 // const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } 00139 const LLFontGL* getRes( LLFONT_ID font_id ) const { return mFonts[ font_id ]; } 00140 const LLFontGL* getRes( LLString font_id ) const; 00141 00142 private: 00143 LLLOCALE_ID mLocale; 00144 // const char** mStrings; 00145 const LLFontGL** mFonts; 00146 00147 // const char* mUSAStrings[LLSTR_COUNT]; 00148 const LLFontGL* mUSAFonts[LLFONT_COUNT]; 00149 00150 // const char* mUKStrings[LLSTR_COUNT]; 00151 const LLFontGL* mUKFonts[LLFONT_COUNT]; 00152 }; 00153 00154 class LLLocale 00155 { 00156 public: 00157 LLLocale(const LLString& locale_string); 00158 virtual ~LLLocale(); 00159 00160 public: 00161 static const LLString USER_LOCALE; 00162 static const LLString SYSTEM_LOCALE; 00163 00164 protected: 00165 LLString mPrevLocaleString; 00166 }; 00167 00168 extern LLResMgr* gResMgr; 00169 00170 #endif // LL_RESMGR_