xref: /haiku/headers/os/locale/LocaleRoster.h (revision 675ffabd70492a962f8c0288a32208c22ce5de18)
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 BCatalog;
13 class BCollator;
14 class BCountry;
15 class BLanguage;
16 class BLocale;
17 class BMessage;
18 class BTimeZone;
19 
20 
21 enum {
22 	B_LOCALE_CHANGED = '_LCC',
23 };
24 
25 
26 class BLocaleRoster {
27 public:
28 								BLocaleRoster();
29 								~BLocaleRoster();
30 
31 			status_t			GetDefaultTimeZone(BTimeZone* timezone) const;
32 
33 			status_t			GetLanguage(const char* languageCode,
34 									BLanguage** _language) const;
35 
36 			status_t			GetPreferredLanguages(BMessage* message) const;
37 
38 			status_t			GetInstalledLanguages(BMessage* message) const;
39 									// the message contains one or more
40 									// 'language'-string-fields which
41 									// contain the language-name(s)
42 
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			GetInstalledCatalogs(BMessage* message,
52 									const char* sigPattern = NULL,
53 									const char* langPattern = NULL,
54 									int32 fingerprint = 0) const;
55 									// the message contains...
56 
57 			status_t			Refresh();
58 									// Refresh the internal data from the
59 									// settings file(s)
60 
61 			BCatalog*			GetCatalog();
62 									// Get the catalog for the calling image
63 									// (that needs to link with liblocalestub.a)
64 
65 	static	const char*			kCatLangAttr;
66 	static	const char*			kCatSigAttr;
67 	static	const char*			kCatFingerprintAttr;
68 
69 	static	const char*			kEmbeddedCatAttr;
70 	static	int32				kEmbeddedCatResId;
71 
72 private:
73 	static	BCatalog*			_GetCatalog(BCatalog* catalog,
74 									vint32* catalogInitStatus);
75 };
76 
77 
78 extern BLocaleRoster* be_locale_roster;
79 
80 
81 #endif	// _LOCALE_ROSTER_H_
82