6fd2f4a0d1
* extracted new class BFormattingConventions from BCountry, which manages the formatting conventions from a given locale and allows to get/set the four different date/time formats supported by ICU-locales as well as number and monetary formats * overhauled the Locale preflet: + drop editing features for all formats, since I don't think they do not make much sense to have in a prefs GUI - being able to select from the existing locales should be good enough. Please note that you can still change the formats programmatically in an application. + renamed the 'Countries' tab to 'Formatting' + the locale formatting conventions list in the 'Formatting' tab is now hierarchical for easier access (less scrolling) + fixed functionality of 'Revert' and 'Defaults' buttons + added support for using the month/day-names of your preferred language during date formatting * adjusted BLocale to ask BFormattingConventions for the current formats when formatting dates and times and to offer 4 different format styles (full, long, medium and short). * adjust all classes formatting dates/times to pick the appropriate format style * BLocaleRoster no longer directly archives/unarchives the individual formatting conventions but delegates that to BFormattingConventions git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39123 a95241bf-73f2-0310-859d-f6bbb57e9c96
83 lines
1.9 KiB
C++
83 lines
1.9 KiB
C++
/*
|
|
* Copyright 2003-2010, Haiku. All rights reserved.
|
|
* Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef _LOCALE_ROSTER_H_
|
|
#define _LOCALE_ROSTER_H_
|
|
|
|
|
|
#include <String.h>
|
|
|
|
|
|
class BBitmap;
|
|
class BCatalog;
|
|
class BCollator;
|
|
class BCountry;
|
|
class BFormattingConventions;
|
|
class BLanguage;
|
|
class BLocale;
|
|
class BMessage;
|
|
class BTimeZone;
|
|
|
|
|
|
enum {
|
|
B_LOCALE_CHANGED = '_LCC',
|
|
};
|
|
|
|
|
|
class BLocaleRoster {
|
|
public:
|
|
BLocaleRoster();
|
|
~BLocaleRoster();
|
|
|
|
status_t GetDefaultTimeZone(BTimeZone* timezone) const;
|
|
|
|
status_t GetLanguage(const char* languageCode,
|
|
BLanguage** _language) const;
|
|
|
|
status_t GetPreferredLanguages(BMessage* message) const;
|
|
|
|
status_t GetAvailableLanguages(BMessage* message) const;
|
|
status_t GetAvailableCountries(
|
|
BMessage* timeZones) const;
|
|
status_t GetAvailableTimeZones(
|
|
BMessage* timeZones) const;
|
|
status_t GetAvailableTimeZonesForCountry(
|
|
BMessage* message,
|
|
const char* countryCode) const;
|
|
|
|
status_t GetFlagIconForCountry(BBitmap* flagIcon,
|
|
const char* countryCode);
|
|
|
|
status_t GetAvailableCatalogs(BMessage* message,
|
|
const char* sigPattern = NULL,
|
|
const char* langPattern = NULL,
|
|
int32 fingerprint = 0) const;
|
|
// the message contains...
|
|
|
|
status_t Refresh();
|
|
// Refresh the internal data from the
|
|
// settings file(s)
|
|
|
|
BCatalog* GetCatalog();
|
|
// Get the catalog for the calling image
|
|
// (that needs to link with liblocalestub.a)
|
|
|
|
static const char* kCatLangAttr;
|
|
static const char* kCatSigAttr;
|
|
static const char* kCatFingerprintAttr;
|
|
|
|
static const char* kEmbeddedCatAttr;
|
|
static int32 kEmbeddedCatResId;
|
|
|
|
private:
|
|
static BCatalog* _GetCatalog(BCatalog* catalog,
|
|
vint32* catalogInitStatus);
|
|
};
|
|
|
|
|
|
extern BLocaleRoster* be_locale_roster;
|
|
|
|
|
|
#endif // _LOCALE_ROSTER_H_
|