xref: /haiku/headers/os/locale/LocaleRoster.h (revision a7dde370f552f5376edbf25046ec9cf2ba8bbd1a)
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 			status_t			GetDefaultTimeZone(BTimeZone* timezone) const;
34 
35 			status_t			GetLanguage(const char* languageCode,
36 									BLanguage** _language) const;
37 
38 			status_t			GetPreferredLanguages(BMessage* message) const;
39 
40 			status_t			GetAvailableLanguages(BMessage* message) const;
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			GetAvailableCatalogs(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