haiku/headers/os/locale/Language.h
Oliver Tappe 38ac8def5a Largish cleanup sweep concerning the Locale Kit (sorry it got so big):
* refactored private/mutable stuff out of LocaleRoster into MutableLocaleRoster
* moved management of Locale/Time settings file and broadcasting of any changes 
  out of preflets and into MutableLocaleRoster
* added proper sorting to the listviews of the Locale preflet
* the Time preflet no longer overlaps long timezone names into the actual time
* several fixes with respect to leaking ICU objects, esp. in BCountry
* the locale roster no longer passes out references to its own BCountry object,
  but uses copies, instead - this makes locking superfluous, as the clients'
  BCountry objects can no longer be changed by the setting a new default 
  country in the locale roster
* removed pretty useless POSIX-style symbol fetching from BCountry - if we
  need that at all, it should live in the dedicated formatter classes
* adjusted readonlybootprompt, dstcheck and Deskbar to the changed Locale API
* refactored existing Time-formatter into TimeUnitFormat and DurationFormat
  (the latter of which is now used by AboutSystem)
* added stubs for Date, DateTime and Time formatters
* lots of coding style fixes throughout the Locale Kit and the Locale and Time 
  preflets
This will probably break most external apps making use of the Locale Kit - it
does break WebPositive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-01 20:28:19 +00:00

64 lines
1.3 KiB
C++

/*
* Copyright 2003-2010, 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>
// We must not include the icu headers in there as it could mess up binary
// compatibility.
namespace icu_44 {
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();
BLanguage& operator=(const BLanguage& source);
status_t GetName(BString& name) const;
status_t GetTranslatedName(BString& name) const;
// ISO-639 language code, e.g. "en", "de"
const char* Code() const;
const char* Country() const;
const char* Variant() const;
const char* ID() const;
bool IsCountrySpecific() const;
bool IsVariant() const;
uint8 Direction() const;
status_t SetTo(const char* language);
// see definitions below
const char* GetString(uint32 id) const;
private:
// BString fStrings[B_NUM_LANGUAGE_STRINGS];
uint8 fDirection;
icu_44::Locale* fICULocale;
};
#endif // _LANGUAGE_H_