xref: /haiku/headers/os/locale/Language.h (revision d374a27286b8a52974a97dba0d5966ea026a665d)
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			GetNativeName(BString& name) const;
38 			status_t			GetName(BString& name,
39 									const BLanguage* displayLanguage = NULL
40 									) const;
41 
42 			const char*			Code() const;
43 									// ISO-639-1
44 			const char*			CountryCode() const;
45 									// ISO-3166
46 			const char*			ScriptCode() const;
47 									// ISO-15924
48 			const char*			Variant() const;
49 			const char*			ID() const;
50 
51 			bool				IsCountrySpecific() const;
52 			bool				IsVariant() const;
53 
54 			uint8				Direction() const;
55 
56 			status_t			SetTo(const char* language);
57 
58 			const char*			GetString(uint32 id) const;
59 
60 			class Private;
61 private:
62 	friend	class Private;
63 
64 //			BString				fStrings[B_NUM_LANGUAGE_STRINGS];
65 			uint8				fDirection;
66 			icu_44::Locale*		fICULocale;
67 };
68 
69 
70 #endif	// _LANGUAGE_H_
71