xref: /haiku/headers/os/locale/Language.h (revision 97901ec593ec4dd50ac115c1c35a6d72f6e489a5)
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_4_2 {
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 
32 			status_t			GetName(BString& name) const;
33 			status_t			GetTranslatedName(BString& name) const;
34 
35 			// ISO-639 language code, e.g. "en", "de"
36 			const char*			Code() const;
37 			const char*			Country() const;
38 			const char*			Variant() const;
39 			const char*			ID() const;
40 
41 			bool				IsCountrySpecific() const;
42 			bool				IsVariant() const;
43 
44 			uint8				Direction() const;
45 
46 			// see definitions below
47 			const char*			GetString(uint32 id) const;
48 
49 private:
50 			friend class BLocaleRoster;
51 
52 								BLanguage(const char *language);
53 			void				Default();
54 
55 private:
56 			char*				fStrings[B_NUM_LANGUAGE_STRINGS];
57 			uint8				fDirection;
58 			icu_4_2::Locale*	fICULocale;
59 };
60 
61 
62 #endif	// _LANGUAGE_H_
63