xref: /haiku/headers/os/locale/LocaleRoster.h (revision b671e9bbdbd10268a042b4f4cc4317ccd03d105e)
1 #ifndef _LOCALE_ROSTER_H_
2 #define _LOCALE_ROSTER_H_
3 
4 
5 #include <String.h>
6 
7 
8 class BLanguage;
9 class BLocale;
10 class BCollator;
11 class BCountry;
12 class BCatalog;
13 class BCatalogAddOn;
14 
15 struct entry_ref;
16 
17 namespace BPrivate {
18 	class EditableCatalog;
19 };
20 
21 enum {
22 	B_LOCALE_CHANGED	= '_LCC',
23 };
24 
25 
26 class BLocaleRoster {
27 
28 	public:
29 		BLocaleRoster();
30 		~BLocaleRoster();
31 
32 //		status_t GetCatalog(BLocale *,const char *mimeType, BCatalog *catalog);
33 //		status_t GetCatalog(const char *mimeType, BCatalog *catalog);
34 //		status_t SetCatalog(BLocale *,const char *mimeType, BCatalog *catalog);
35 
36 //		status_t GetLocaleFor(const char *langCode, const char *countryCode);
37 
38 		status_t GetDefaultCollator(BCollator **) const;
39 		status_t GetDefaultLanguage(BLanguage **) const;
40 		status_t GetDefaultCountry(BCountry **) const;
41 		void SetDefaultCountry(BCountry *) const;
42 
43 		status_t GetPreferredLanguages(BMessage *) const;
44 		status_t SetPreferredLanguages(BMessage *);
45 			// the message contains one or more 'language'-string-fields
46 			// which contain the language-name(s)
47 
48 		status_t GetInstalledLanguages(BMessage *) const;
49 			// the message contains one or more 'language'-string-fields
50 			// which contain the language-name(s)
51 
52 		status_t GetInstalledCatalogs(BMessage *, const char* sigPattern = NULL,
53 			const char* langPattern = NULL,	int32 fingerprint = 0) const;
54 			// the message contains...
55 
56 		static const char *kCatLangAttr;
57 		static const char *kCatSigAttr;
58 		static const char *kCatFingerprintAttr;
59 
60 		static const char *kCatManagerMimeType;
61 		static const char *kCatEditorMimeType;
62 
63 		static const char *kEmbeddedCatAttr;
64 		static int32 kEmbeddedCatResId;
65 
66 	private:
67 
68 		BCatalogAddOn* LoadCatalog(const char *signature,
69 			const char *language = NULL, int32 fingerprint = 0);
70 		BCatalogAddOn* LoadEmbeddedCatalog(entry_ref *appOrAddOnRef);
71 		status_t UnloadCatalog(BCatalogAddOn *addOn);
72 
73 		BCatalogAddOn* CreateCatalog(const char *type,
74 			const char *signature, const char *language);
75 
76 		friend class BCatalog;
77 		friend class BPrivate::EditableCatalog;
78 		friend status_t get_add_on_catalog(BCatalog*, const char *);
79 };
80 
81 #endif	/* _LOCALE_ROSTER_H_ */
82