xref: /haiku/headers/os/locale/LocaleRoster.h (revision d1d8fda63745350804d76b4ed160732086fa9655)
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 
12*d1d8fda6SOliver Tappe class BBitmap;
1338ac8defSOliver Tappe class BCatalog;
14c3ac87e8SOliver Tappe class BCollator;
15c3ac87e8SOliver Tappe class BCountry;
1638ac8defSOliver Tappe class BLanguage;
1738ac8defSOliver Tappe class BLocale;
18f9a80fecSAxel Dörfler class BMessage;
194ae5a452SAdrien Destugues class BTimeZone;
20c3ac87e8SOliver Tappe 
214b37c7f8SAdrien Destugues 
22c3ac87e8SOliver Tappe enum {
23c3ac87e8SOliver Tappe 	B_LOCALE_CHANGED = '_LCC',
24c3ac87e8SOliver Tappe };
25c3ac87e8SOliver Tappe 
2675f15221SOliver Tappe 
27723383c0SOliver Tappe class BLocaleRoster {
28c3ac87e8SOliver Tappe public:
29c3ac87e8SOliver Tappe 								BLocaleRoster();
30c3ac87e8SOliver Tappe 								~BLocaleRoster();
31c3ac87e8SOliver Tappe 
3238ac8defSOliver Tappe 			status_t			GetDefaultTimeZone(BTimeZone* timezone) const;
334ae5a452SAdrien Destugues 
3438ac8defSOliver Tappe 			status_t			GetLanguage(const char* languageCode,
3538ac8defSOliver Tappe 									BLanguage** _language) const;
36c3ac87e8SOliver Tappe 
3738ac8defSOliver Tappe 			status_t			GetPreferredLanguages(BMessage* message) const;
385570fd11SAdrien Destugues 
3938ac8defSOliver Tappe 			status_t			GetInstalledLanguages(BMessage* message) const;
4038ac8defSOliver Tappe 									// the message contains one or more
4138ac8defSOliver Tappe 									// 'language'-string-fields which
4238ac8defSOliver Tappe 									// contain the language-name(s)
43c3ac87e8SOliver Tappe 
44c91aa9f4SOliver Tappe 			status_t			GetAvailableCountries(
45c91aa9f4SOliver Tappe 									BMessage* timeZones) const;
46c91aa9f4SOliver Tappe 			status_t			GetAvailableTimeZones(
47c91aa9f4SOliver Tappe 									BMessage* timeZones) const;
48c91aa9f4SOliver Tappe 			status_t			GetAvailableTimeZonesForCountry(
49c91aa9f4SOliver Tappe 									BMessage* message,
50c91aa9f4SOliver Tappe 									const char* countryCode) const;
51c3ac87e8SOliver Tappe 
52*d1d8fda6SOliver Tappe 			status_t			GetFlagIconForCountry(BBitmap* flagIcon,
53*d1d8fda6SOliver Tappe 									const char* countryCode);
54*d1d8fda6SOliver Tappe 
5538ac8defSOliver Tappe 			status_t			GetInstalledCatalogs(BMessage* message,
5638ac8defSOliver Tappe 									const char* sigPattern = NULL,
5738ac8defSOliver Tappe 									const char* langPattern = NULL,
5838ac8defSOliver Tappe 									int32 fingerprint = 0) const;
59c3ac87e8SOliver Tappe 									// the message contains...
60c3ac87e8SOliver Tappe 
6138ac8defSOliver Tappe 			status_t			Refresh();
6238ac8defSOliver Tappe 									// Refresh the internal data from the
6338ac8defSOliver Tappe 									// settings file(s)
6438ac8defSOliver Tappe 
65fe8d7c02SAdrien Destugues 			BCatalog*			GetCatalog();
6638ac8defSOliver Tappe 									// Get the catalog for the calling image
6738ac8defSOliver Tappe 									// (that needs to link with liblocalestub.a)
68fe8d7c02SAdrien Destugues 
69c3ac87e8SOliver Tappe 	static	const char*			kCatLangAttr;
70c3ac87e8SOliver Tappe 	static	const char*			kCatSigAttr;
71c3ac87e8SOliver Tappe 	static	const char*			kCatFingerprintAttr;
7275f15221SOliver Tappe 
73c3ac87e8SOliver Tappe 	static	const char*			kEmbeddedCatAttr;
74c3ac87e8SOliver Tappe 	static	int32				kEmbeddedCatResId;
75c3ac87e8SOliver Tappe 
76c3ac87e8SOliver Tappe private:
7738ac8defSOliver Tappe 	static	BCatalog*			_GetCatalog(BCatalog* catalog,
7838ac8defSOliver Tappe 									vint32* catalogInitStatus);
79c3ac87e8SOliver Tappe };
80c3ac87e8SOliver Tappe 
8138ac8defSOliver Tappe 
8238ac8defSOliver Tappe extern BLocaleRoster* be_locale_roster;
8338ac8defSOliver Tappe 
8438ac8defSOliver Tappe 
8538ac8defSOliver Tappe #endif	// _LOCALE_ROSTER_H_
86