1 /* 2 ** Copyright 2003, Haiku, Inc. 3 ** Distributed under the terms of the MIT License. 4 */ 5 6 7 #ifndef _LANGUAGE_H_ 8 #define _LANGUAGE_H_ 9 10 11 #include <SupportDefs.h> 12 #include <LocaleStrings.h> 13 14 15 enum script_direction { 16 B_LEFT_TO_RIGHT = 0, 17 B_RIGHT_TO_LEFT, 18 B_TOP_TO_BOTTOM, // seems not to be supported anywhere else? 19 }; 20 21 22 class BLanguage { 23 public: 24 ~BLanguage(); 25 26 // language name, e.g. "english", "deutsch" 27 const char *Name() const { return fName; } 28 // ISO-639 language code, e.g. "en", "de" 29 const char *Code() const { return fCode; } 30 // ISO-639 language family, e.g. "germanic" 31 const char *Family() const { return fFamily; } 32 33 uint8 Direction() const; 34 35 // see definitions below 36 const char *GetString(uint32 id) const; 37 38 private: 39 friend class BLocaleRoster; 40 41 BLanguage(const char *language); 42 void Default(); 43 44 char *fName, *fCode, *fFamily, *fStrings[B_NUM_LANGUAGE_STRINGS]; 45 uint8 fDirection; 46 }; 47 48 #endif /* _LANGUAGE_H_ */ 49