196eaa02eSAxel Dörfler /* 296eaa02eSAxel Dörfler * Copyright 2003-2010, Haiku. All rights reserved. 396eaa02eSAxel Dörfler * Distributed under the terms of the MIT license. 496eaa02eSAxel Dörfler */ 5c3ac87e8SOliver Tappe #ifndef _LOCALE_ROSTER_H_ 6c3ac87e8SOliver Tappe #define _LOCALE_ROSTER_H_ 7c3ac87e8SOliver Tappe 875f15221SOliver Tappe 9c3ac87e8SOliver Tappe #include <String.h> 10c3ac87e8SOliver Tappe 1175f15221SOliver Tappe 12d1d8fda6SOliver Tappe class BBitmap; 1338ac8defSOliver Tappe class BCatalog; 14c3ac87e8SOliver Tappe class BCollator; 15c3ac87e8SOliver Tappe class BCountry; 16*6fd2f4a0SOliver Tappe class BFormattingConventions; 1738ac8defSOliver Tappe class BLanguage; 1838ac8defSOliver Tappe class BLocale; 19f9a80fecSAxel Dörfler class BMessage; 204ae5a452SAdrien Destugues class BTimeZone; 21c3ac87e8SOliver Tappe 224b37c7f8SAdrien Destugues 23c3ac87e8SOliver Tappe enum { 24c3ac87e8SOliver Tappe B_LOCALE_CHANGED = '_LCC', 25c3ac87e8SOliver Tappe }; 26c3ac87e8SOliver Tappe 2775f15221SOliver Tappe 28723383c0SOliver Tappe class BLocaleRoster { 29c3ac87e8SOliver Tappe public: 30c3ac87e8SOliver Tappe BLocaleRoster(); 31c3ac87e8SOliver Tappe ~BLocaleRoster(); 32c3ac87e8SOliver Tappe 3338ac8defSOliver Tappe status_t GetDefaultTimeZone(BTimeZone* timezone) const; 344ae5a452SAdrien Destugues 3538ac8defSOliver Tappe status_t GetLanguage(const char* languageCode, 3638ac8defSOliver Tappe BLanguage** _language) const; 37c3ac87e8SOliver Tappe 3838ac8defSOliver Tappe status_t GetPreferredLanguages(BMessage* message) const; 395570fd11SAdrien Destugues 406f43fabaSOliver Tappe status_t GetAvailableLanguages(BMessage* message) const; 41c91aa9f4SOliver Tappe status_t GetAvailableCountries( 42c91aa9f4SOliver Tappe BMessage* timeZones) const; 43c91aa9f4SOliver Tappe status_t GetAvailableTimeZones( 44c91aa9f4SOliver Tappe BMessage* timeZones) const; 45c91aa9f4SOliver Tappe status_t GetAvailableTimeZonesForCountry( 46c91aa9f4SOliver Tappe BMessage* message, 47c91aa9f4SOliver Tappe const char* countryCode) const; 48c3ac87e8SOliver Tappe 49d1d8fda6SOliver Tappe status_t GetFlagIconForCountry(BBitmap* flagIcon, 50d1d8fda6SOliver Tappe const char* countryCode); 51d1d8fda6SOliver Tappe 52*6fd2f4a0SOliver Tappe status_t GetAvailableCatalogs(BMessage* message, 5338ac8defSOliver Tappe const char* sigPattern = NULL, 5438ac8defSOliver Tappe const char* langPattern = NULL, 5538ac8defSOliver Tappe int32 fingerprint = 0) const; 56c3ac87e8SOliver Tappe // the message contains... 57c3ac87e8SOliver Tappe 5838ac8defSOliver Tappe status_t Refresh(); 5938ac8defSOliver Tappe // Refresh the internal data from the 6038ac8defSOliver Tappe // settings file(s) 6138ac8defSOliver Tappe 62fe8d7c02SAdrien Destugues BCatalog* GetCatalog(); 6338ac8defSOliver Tappe // Get the catalog for the calling image 6438ac8defSOliver Tappe // (that needs to link with liblocalestub.a) 65fe8d7c02SAdrien Destugues 66c3ac87e8SOliver Tappe static const char* kCatLangAttr; 67c3ac87e8SOliver Tappe static const char* kCatSigAttr; 68c3ac87e8SOliver Tappe static const char* kCatFingerprintAttr; 6975f15221SOliver Tappe 70c3ac87e8SOliver Tappe static const char* kEmbeddedCatAttr; 71c3ac87e8SOliver Tappe static int32 kEmbeddedCatResId; 72c3ac87e8SOliver Tappe 73c3ac87e8SOliver Tappe private: 7438ac8defSOliver Tappe static BCatalog* _GetCatalog(BCatalog* catalog, 7538ac8defSOliver Tappe vint32* catalogInitStatus); 76c3ac87e8SOliver Tappe }; 77c3ac87e8SOliver Tappe 7838ac8defSOliver Tappe 7938ac8defSOliver Tappe extern BLocaleRoster* be_locale_roster; 8038ac8defSOliver Tappe 8138ac8defSOliver Tappe 8238ac8defSOliver Tappe #endif // _LOCALE_ROSTER_H_ 83