haiku/headers/os/locale/LocaleRoster.h
Jonas Sundström ee6a2e5589 * Extend the Model class with a method bool HasLocalizedName().
* Disallow renaming of entries with localized names for now - this is meant to be temporary - and so far only in Tracker's Info window. Renames do not result in a change, visually, as the localized name hides the real name, and results in a bad user experience. One could possibly allow renames of the localized name, writing it back to the catalog. I've experimented with using BCatalogAddOn::SetString() but haven't been able to make it stick yet.
* Disallow renaming Trash in Tracker's Info window via Command-E.
* Adjust the argument order of BLocaleRoster::GetLocalizedFileName().
* Add a BLocaleRoster::GetLocalizedFileName() variant to look up another app's name given its signature and unlocalized, canonical name.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-27 18:38:05 +00:00

97 lines
2.3 KiB
C++

/*
* Copyright 2003-2010, Haiku. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#ifndef _LOCALE_ROSTER_H_
#define _LOCALE_ROSTER_H_
#include <Entry.h>
#include <String.h>
class BBitmap;
class BCatalog;
class BCollator;
class BCountry;
class BFormattingConventions;
class BLanguage;
class BLocale;
class BMessage;
class BTimeZone;
enum {
B_LOCALE_CHANGED = '_LCC',
};
class BLocaleRoster {
public:
BLocaleRoster();
~BLocaleRoster();
static BLocaleRoster* Default();
status_t GetDefaultTimeZone(BTimeZone* timezone) const;
status_t GetLanguage(const char* languageCode,
BLanguage** _language) const;
status_t GetPreferredLanguages(BMessage* message) const;
status_t GetAvailableLanguages(BMessage* message) const;
status_t GetAvailableCountries(
BMessage* timeZones) const;
status_t GetAvailableTimeZones(
BMessage* timeZones) const;
status_t GetAvailableTimeZonesForCountry(
BMessage* message,
const char* countryCode) const;
status_t GetFlagIconForCountry(BBitmap* flagIcon,
const char* countryCode);
status_t GetAvailableCatalogs(BMessage* message,
const char* sigPattern = NULL,
const char* langPattern = NULL,
int32 fingerprint = 0) const;
// the message contains...
status_t Refresh();
// Refresh the internal data from the
// settings file(s)
BCatalog* GetCatalog();
// Get the catalog for the calling image
// (that needs to link with liblocalestub.a)
bool IsFilesystemTranslationPreferred() const;
status_t GetLocalizedFileName(BString& localizedFileName,
const entry_ref& ref,
bool traverse = false);
status_t GetLocalizedFileName(BString& localizedFileName,
const char* signature, const char* context,
const char* string);
static const char* kCatLangAttr;
static const char* kCatSigAttr;
static const char* kCatFingerprintAttr;
static const char* kEmbeddedCatAttr;
static int32 kEmbeddedCatResId;
private:
static BCatalog* _GetCatalog(BCatalog* catalog,
vint32* catalogInitStatus);
status_t _PrepareCatalogEntry(const entry_ref& ref,
BString& signature, BString& context,
BString& string, bool traverse);
};
#endif // _LOCALE_ROSTER_H_