73de58376a
"Renaming" means the icu namespace is suffixed with the version number, atm icu_55. Using "renaming" allows to use two different versions of ICU, thus easing upgrades. For instance haikuwebkit uses a current version of ICU, while the system uses a newer one after an upgrade. * Replace all uses of the icu namespace in our public headers, with a macro defaulting to icu. As the namespace is only used for private fields pointers, there should be no impact. * Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before* including any locale headers. Ditto for a Time preferences cpp file. This way, the correct current icu namespace is referenced. * Fixes bug #12057.
75 lines
1.5 KiB
C++
75 lines
1.5 KiB
C++
/*
|
|
* Copyright 2003-2011, Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _LANGUAGE_H_
|
|
#define _LANGUAGE_H_
|
|
|
|
|
|
#include <LocaleStrings.h>
|
|
#include <String.h>
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
class BBitmap;
|
|
|
|
// We must not include the icu headers in there as it could mess up binary
|
|
// compatibility.
|
|
#ifndef U_ICU_NAMESPACE
|
|
#define U_ICU_NAMESPACE icu
|
|
#endif
|
|
namespace U_ICU_NAMESPACE {
|
|
class Locale;
|
|
}
|
|
|
|
|
|
enum script_direction {
|
|
B_LEFT_TO_RIGHT = 0,
|
|
B_RIGHT_TO_LEFT,
|
|
B_TOP_TO_BOTTOM, // seems not to be supported anywhere else?
|
|
};
|
|
|
|
|
|
class BLanguage {
|
|
public:
|
|
BLanguage();
|
|
BLanguage(const char* language);
|
|
BLanguage(const BLanguage& other);
|
|
~BLanguage();
|
|
|
|
status_t SetTo(const char* language);
|
|
|
|
status_t GetNativeName(BString& name) const;
|
|
status_t GetName(BString& name,
|
|
const BLanguage* displayLanguage = NULL
|
|
) const;
|
|
const char* GetString(uint32 id) const;
|
|
status_t GetIcon(BBitmap* result) const;
|
|
|
|
const char* Code() const;
|
|
// ISO-639-1
|
|
const char* CountryCode() const;
|
|
// ISO-3166
|
|
const char* ScriptCode() const;
|
|
// ISO-15924
|
|
const char* Variant() const;
|
|
const char* ID() const;
|
|
|
|
bool IsCountrySpecific() const;
|
|
bool IsVariant() const;
|
|
|
|
uint8 Direction() const;
|
|
|
|
BLanguage& operator=(const BLanguage& source);
|
|
|
|
class Private;
|
|
private:
|
|
friend class Private;
|
|
|
|
uint8 fDirection;
|
|
U_ICU_NAMESPACE::Locale* fICULocale;
|
|
};
|
|
|
|
|
|
#endif // _LANGUAGE_H_
|