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