1 /* 2 * Copyright 2003-2010, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _LANGUAGE_H_ 6 #define _LANGUAGE_H_ 7 8 9 #include <LocaleStrings.h> 10 #include <String.h> 11 #include <SupportDefs.h> 12 13 14 // We must not include the icu headers in there as it could mess up binary 15 // compatibility. 16 namespace icu_44 { 17 class Locale; 18 } 19 20 21 enum script_direction { 22 B_LEFT_TO_RIGHT = 0, 23 B_RIGHT_TO_LEFT, 24 B_TOP_TO_BOTTOM, // seems not to be supported anywhere else? 25 }; 26 27 28 class BLanguage { 29 public: 30 BLanguage(); 31 BLanguage(const char* language); 32 BLanguage(const BLanguage& other); 33 ~BLanguage(); 34 35 BLanguage& operator=(const BLanguage& source); 36 37 status_t GetName(BString& name) const; 38 status_t GetTranslatedName(BString& name) const; 39 40 // ISO-639 language code, e.g. "en", "de" 41 const char* Code() const; 42 const char* Country() const; 43 const char* Variant() const; 44 const char* ID() const; 45 46 bool IsCountrySpecific() const; 47 bool IsVariant() const; 48 49 uint8 Direction() const; 50 51 status_t SetTo(const char* language); 52 53 // see definitions below 54 const char* GetString(uint32 id) const; 55 56 private: 57 // BString fStrings[B_NUM_LANGUAGE_STRINGS]; 58 uint8 fDirection; 59 icu_44::Locale* fICULocale; 60 }; 61 62 63 #endif // _LANGUAGE_H_ 64