xref: /haiku/headers/os/locale/LocaleRoster.h (revision e8cd7007416a323259791ac09c013dcce2956976)
1 /*
2  * Copyright 2003-2010, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  */
5 #ifndef _LOCALE_ROSTER_H_
6 #define _LOCALE_ROSTER_H_
7 
8 
9 #include <String.h>
10 
11 
12 class BBitmap;
13 class BCatalog;
14 class BCollator;
15 class BCountry;
16 class BFormattingConventions;
17 class BLanguage;
18 class BLocale;
19 class BMessage;
20 class BTimeZone;
21 
22 
23 enum {
24 	B_LOCALE_CHANGED = '_LCC',
25 };
26 
27 
28 class BLocaleRoster {
29 public:
30 								BLocaleRoster();
31 								~BLocaleRoster();
32 
33 	static	BLocaleRoster*		Default();
34 
35 			status_t			GetDefaultTimeZone(BTimeZone* timezone) const;
36 
37 			status_t			GetLanguage(const char* languageCode,
38 									BLanguage** _language) const;
39 
40 			status_t			GetPreferredLanguages(BMessage* message) const;
41 
42 			status_t			GetAvailableLanguages(BMessage* message) const;
43 			status_t			GetAvailableCountries(
44 									BMessage* timeZones) const;
45 			status_t			GetAvailableTimeZones(
46 									BMessage* timeZones) const;
47 			status_t			GetAvailableTimeZonesForCountry(
48 									BMessage* message,
49 									const char* countryCode) const;
50 
51 			status_t			GetFlagIconForCountry(BBitmap* flagIcon,
52 									const char* countryCode);
53 
54 			status_t			GetAvailableCatalogs(BMessage* message,
55 									const char* sigPattern = NULL,
56 									const char* langPattern = NULL,
57 									int32 fingerprint = 0) const;
58 									// the message contains...
59 
60 			status_t			Refresh();
61 									// Refresh the internal data from the
62 									// settings file(s)
63 
64 			BCatalog*			GetCatalog();
65 									// Get the catalog for the calling image
66 									// (that needs to link with liblocalestub.a)
67 
68 	static	const char*			kCatLangAttr;
69 	static	const char*			kCatSigAttr;
70 	static	const char*			kCatFingerprintAttr;
71 
72 	static	const char*			kEmbeddedCatAttr;
73 	static	int32				kEmbeddedCatResId;
74 
75 private:
76 	static	BCatalog*			_GetCatalog(BCatalog* catalog,
77 									vint32* catalogInitStatus);
78 };
79 
80 
81 #endif	// _LOCALE_ROSTER_H_
82