2009-05-01 23:23:59 +04:00
|
|
|
#ifndef _LOCALE_ROSTER_H_
|
|
|
|
#define _LOCALE_ROSTER_H_
|
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
#include <String.h>
|
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
class BLanguage;
|
|
|
|
class BLocale;
|
|
|
|
class BCollator;
|
|
|
|
class BCountry;
|
|
|
|
class BCatalog;
|
|
|
|
class BCatalogAddOn;
|
2009-11-10 16:44:22 +03:00
|
|
|
class BMessage;
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
struct entry_ref;
|
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
class EditableCatalog;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
B_LOCALE_CHANGED = '_LCC',
|
|
|
|
};
|
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-02 01:56:16 +04:00
|
|
|
class BLocaleRoster {
|
2009-05-01 23:23:59 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
BLocaleRoster();
|
|
|
|
~BLocaleRoster();
|
|
|
|
|
|
|
|
// status_t GetCatalog(BLocale *,const char *mimeType, BCatalog *catalog);
|
|
|
|
// status_t GetCatalog(const char *mimeType, BCatalog *catalog);
|
|
|
|
// status_t SetCatalog(BLocale *,const char *mimeType, BCatalog *catalog);
|
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
// status_t GetLocaleFor(const char *langCode, const char *countryCode);
|
2009-05-01 23:23:59 +04:00
|
|
|
|
|
|
|
status_t GetDefaultCollator(BCollator **) const;
|
|
|
|
status_t GetDefaultLanguage(BLanguage **) const;
|
|
|
|
status_t GetDefaultCountry(BCountry **) const;
|
2009-09-19 02:23:34 +04:00
|
|
|
void SetDefaultCountry(BCountry *) const;
|
2009-05-02 01:56:16 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
status_t GetPreferredLanguages(BMessage *) const;
|
|
|
|
status_t SetPreferredLanguages(BMessage *);
|
2009-05-02 01:56:16 +04:00
|
|
|
// the message contains one or more 'language'-string-fields
|
2009-05-01 23:23:59 +04:00
|
|
|
// which contain the language-name(s)
|
|
|
|
|
|
|
|
status_t GetInstalledLanguages(BMessage *) const;
|
2009-05-02 01:56:16 +04:00
|
|
|
// the message contains one or more 'language'-string-fields
|
2009-05-01 23:23:59 +04:00
|
|
|
// which contain the language-name(s)
|
|
|
|
|
2009-09-19 02:23:34 +04:00
|
|
|
status_t GetInstalledCatalogs(BMessage *, const char* sigPattern = NULL,
|
|
|
|
const char* langPattern = NULL, int32 fingerprint = 0) const;
|
2009-05-01 23:23:59 +04:00
|
|
|
// the message contains...
|
|
|
|
|
|
|
|
static const char *kCatLangAttr;
|
|
|
|
static const char *kCatSigAttr;
|
|
|
|
static const char *kCatFingerprintAttr;
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
static const char *kCatManagerMimeType;
|
|
|
|
static const char *kCatEditorMimeType;
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
static const char *kEmbeddedCatAttr;
|
|
|
|
static int32 kEmbeddedCatResId;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2009-05-02 01:56:16 +04:00
|
|
|
BCatalogAddOn* LoadCatalog(const char *signature,
|
2009-09-19 02:23:34 +04:00
|
|
|
const char *language = NULL, int32 fingerprint = 0);
|
2009-05-01 23:23:59 +04:00
|
|
|
BCatalogAddOn* LoadEmbeddedCatalog(entry_ref *appOrAddOnRef);
|
|
|
|
status_t UnloadCatalog(BCatalogAddOn *addOn);
|
2009-09-19 02:23:34 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
BCatalogAddOn* CreateCatalog(const char *type,
|
2009-09-19 02:23:34 +04:00
|
|
|
const char *signature, const char *language);
|
2009-05-01 23:23:59 +04:00
|
|
|
|
|
|
|
friend class BCatalog;
|
|
|
|
friend class BPrivate::EditableCatalog;
|
|
|
|
friend status_t get_add_on_catalog(BCatalog*, const char *);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _LOCALE_ROSTER_H_ */
|