xref: /haiku/headers/os/locale/LocaleRoster.h (revision 56187df6ebd9d1fb16bf954fce8df0999e9e3048)
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 BLanguage;
17 class BLocale;
18 class BMessage;
19 class BTimeZone;
20 
21 
22 enum {
23 	B_LOCALE_CHANGED = '_LCC',
24 };
25 
26 
27 class BLocaleRoster {
28 public:
29 								BLocaleRoster();
30 								~BLocaleRoster();
31 
32 			status_t			GetDefaultTimeZone(BTimeZone* timezone) const;
33 
34 			status_t			GetLanguage(const char* languageCode,
35 									BLanguage** _language) const;
36 
37 			status_t			GetPreferredLanguages(BMessage* message) const;
38 
39 			status_t			GetAvailableLanguages(BMessage* message) const;
40 
41 			status_t			GetAvailableCountries(
42 									BMessage* timeZones) const;
43 			status_t			GetAvailableTimeZones(
44 									BMessage* timeZones) const;
45 			status_t			GetAvailableTimeZonesForCountry(
46 									BMessage* message,
47 									const char* countryCode) const;
48 
49 			status_t			GetFlagIconForCountry(BBitmap* flagIcon,
50 									const char* countryCode);
51 
52 			status_t			GetInstalledCatalogs(BMessage* message,
53 									const char* sigPattern = NULL,
54 									const char* langPattern = NULL,
55 									int32 fingerprint = 0) const;
56 									// the message contains...
57 
58 			status_t			Refresh();
59 									// Refresh the internal data from the
60 									// settings file(s)
61 
62 			BCatalog*			GetCatalog();
63 									// Get the catalog for the calling image
64 									// (that needs to link with liblocalestub.a)
65 
66 	static	const char*			kCatLangAttr;
67 	static	const char*			kCatSigAttr;
68 	static	const char*			kCatFingerprintAttr;
69 
70 	static	const char*			kEmbeddedCatAttr;
71 	static	int32				kEmbeddedCatResId;
72 
73 private:
74 	static	BCatalog*			_GetCatalog(BCatalog* catalog,
75 									vint32* catalogInitStatus);
76 };
77 
78 
79 extern BLocaleRoster* be_locale_roster;
80 
81 
82 #endif	// _LOCALE_ROSTER_H_
83