1/* 2 * Copyright 2003-2011, 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 14class BBitmap; 15 16// We must not include the icu headers in there as it could mess up binary 17// compatibility. 18namespace icu { 19 class Locale; 20} 21 22 23enum script_direction { 24 B_LEFT_TO_RIGHT = 0, 25 B_RIGHT_TO_LEFT, 26 B_TOP_TO_BOTTOM, // seems not to be supported anywhere else? 27}; 28 29 30class BLanguage { 31public: 32 BLanguage(); 33 BLanguage(const char* language); 34 BLanguage(const BLanguage& other); 35 ~BLanguage(); 36 37 status_t SetTo(const char* language); 38 39 status_t GetNativeName(BString& name) const; 40 status_t GetName(BString& name, 41 const BLanguage* displayLanguage = NULL 42 ) const; 43 const char* GetString(uint32 id) const; 44 status_t GetIcon(BBitmap* result) const; 45 46 const char* Code() const; 47 // ISO-639-1 48 const char* CountryCode() const; 49 // ISO-3166 50 const char* ScriptCode() const; 51 // ISO-15924 52 const char* Variant() const; 53 const char* ID() const; 54 55 bool IsCountrySpecific() const; 56 bool IsVariant() const; 57 58 uint8 Direction() const; 59 60 BLanguage& operator=(const BLanguage& source); 61 62 class Private; 63private: 64 friend class Private; 65 66 uint8 fDirection; 67 icu::Locale* fICULocale; 68}; 69 70 71#endif // _LANGUAGE_H_ 72