2009-09-19 02:23:34 +04:00
|
|
|
/*
|
2009-09-25 01:03:57 +04:00
|
|
|
** Copyright 2003, Haiku, Inc.
|
2009-09-19 02:23:34 +04:00
|
|
|
** Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
#ifndef _LANGUAGE_H_
|
|
|
|
#define _LANGUAGE_H_
|
|
|
|
|
|
|
|
|
2010-01-21 01:44:34 +03:00
|
|
|
#include <String.h>
|
2009-05-01 23:23:59 +04:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
#include <LocaleStrings.h>
|
|
|
|
|
|
|
|
|
2010-01-21 01:44:34 +03:00
|
|
|
// We must not include the icu headers in there as it could mess up binary
|
|
|
|
// compatibility.
|
|
|
|
namespace icu_4_2 {
|
|
|
|
class Locale;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
enum script_direction {
|
|
|
|
B_LEFT_TO_RIGHT = 0,
|
|
|
|
B_RIGHT_TO_LEFT,
|
|
|
|
B_TOP_TO_BOTTOM, // seems not to be supported anywhere else?
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-05-02 01:56:16 +04:00
|
|
|
class BLanguage {
|
2009-05-01 23:23:59 +04:00
|
|
|
public:
|
|
|
|
~BLanguage();
|
|
|
|
|
|
|
|
// language name, e.g. "english", "deutsch"
|
2010-01-21 01:44:34 +03:00
|
|
|
status_t GetName(BString* name);
|
2009-05-01 23:23:59 +04:00
|
|
|
// ISO-639 language code, e.g. "en", "de"
|
2010-01-21 01:44:34 +03:00
|
|
|
const char* Code();
|
2010-02-01 00:22:25 +03:00
|
|
|
bool IsCountry();
|
2009-05-01 23:23:59 +04:00
|
|
|
|
|
|
|
uint8 Direction() const;
|
|
|
|
|
|
|
|
// see definitions below
|
|
|
|
const char *GetString(uint32 id) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class BLocaleRoster;
|
|
|
|
|
|
|
|
BLanguage(const char *language);
|
|
|
|
void Default();
|
|
|
|
|
2010-01-21 01:44:34 +03:00
|
|
|
char *fStrings[B_NUM_LANGUAGE_STRINGS];
|
2009-05-01 23:23:59 +04:00
|
|
|
uint8 fDirection;
|
2010-01-21 01:44:34 +03:00
|
|
|
icu_4_2::Locale* fICULocale;
|
2009-05-01 23:23:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _LANGUAGE_H_ */
|