2010-05-07 17:38:40 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2003-2010, Haiku. All rights reserved.
|
|
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
|
*/
|
2009-05-01 19:23:59 +00:00
|
|
|
#ifndef _LOCALE_ROSTER_H_
|
|
|
|
|
#define _LOCALE_ROSTER_H_
|
|
|
|
|
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2009-05-01 19:23:59 +00:00
|
|
|
#include <String.h>
|
|
|
|
|
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2010-10-19 21:36:44 +00:00
|
|
|
class BBitmap;
|
2010-08-01 20:28:19 +00:00
|
|
|
class BCatalog;
|
2009-05-01 19:23:59 +00:00
|
|
|
class BCollator;
|
|
|
|
|
class BCountry;
|
2010-08-01 20:28:19 +00:00
|
|
|
class BLanguage;
|
|
|
|
|
class BLocale;
|
2009-11-10 13:44:22 +00:00
|
|
|
class BMessage;
|
2010-07-26 13:56:50 +00:00
|
|
|
class BTimeZone;
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2010-07-20 15:47:16 +00:00
|
|
|
|
2009-05-01 19:23:59 +00:00
|
|
|
enum {
|
2010-08-01 20:28:19 +00:00
|
|
|
B_LOCALE_CHANGED = '_LCC',
|
2009-05-01 19:23:59 +00:00
|
|
|
};
|
|
|
|
|
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2009-05-01 21:56:16 +00:00
|
|
|
class BLocaleRoster {
|
2010-08-01 20:28:19 +00:00
|
|
|
public:
|
|
|
|
|
BLocaleRoster();
|
|
|
|
|
~BLocaleRoster();
|
2010-07-26 13:56:50 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t GetDefaultTimeZone(BTimeZone* timezone) const;
|
2009-05-01 21:56:16 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t GetLanguage(const char* languageCode,
|
|
|
|
|
BLanguage** _language) const;
|
2010-01-20 22:44:34 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t GetPreferredLanguages(BMessage* message) const;
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t GetInstalledLanguages(BMessage* message) const;
|
|
|
|
|
// the message contains one or more
|
|
|
|
|
// 'language'-string-fields which
|
|
|
|
|
// contain the language-name(s)
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2010-08-26 22:16:40 +00:00
|
|
|
status_t GetAvailableCountries(
|
|
|
|
|
BMessage* timeZones) const;
|
|
|
|
|
status_t GetAvailableTimeZones(
|
|
|
|
|
BMessage* timeZones) const;
|
|
|
|
|
status_t GetAvailableTimeZonesForCountry(
|
|
|
|
|
BMessage* message,
|
|
|
|
|
const char* countryCode) const;
|
2010-07-22 12:47:00 +00:00
|
|
|
|
2010-10-19 21:36:44 +00:00
|
|
|
status_t GetFlagIconForCountry(BBitmap* flagIcon,
|
|
|
|
|
const char* countryCode);
|
|
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t GetInstalledCatalogs(BMessage* message,
|
|
|
|
|
const char* sigPattern = NULL,
|
|
|
|
|
const char* langPattern = NULL,
|
|
|
|
|
int32 fingerprint = 0) const;
|
|
|
|
|
// the message contains...
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
status_t Refresh();
|
|
|
|
|
// Refresh the internal data from the
|
|
|
|
|
// settings file(s)
|
2010-07-20 11:38:34 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
BCatalog* GetCatalog();
|
|
|
|
|
// Get the catalog for the calling image
|
|
|
|
|
// (that needs to link with liblocalestub.a)
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
static const char* kCatLangAttr;
|
|
|
|
|
static const char* kCatSigAttr;
|
|
|
|
|
static const char* kCatFingerprintAttr;
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
static const char* kEmbeddedCatAttr;
|
|
|
|
|
static int32 kEmbeddedCatResId;
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
private:
|
|
|
|
|
static BCatalog* _GetCatalog(BCatalog* catalog,
|
|
|
|
|
vint32* catalogInitStatus);
|
|
|
|
|
};
|
2009-05-01 19:23:59 +00:00
|
|
|
|
2009-09-18 22:23:34 +00:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
extern BLocaleRoster* be_locale_roster;
|
2009-05-01 19:23:59 +00:00
|
|
|
|
|
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
#endif // _LOCALE_ROSTER_H_
|