Add a call in BCountry to get an icon for that country.

Untested and not working yet since we don't provide any icon.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36303 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-04-15 15:57:30 +00:00
parent 024bc08b2f
commit 87158047dd
3 changed files with 22 additions and 7 deletions
+8 -5
View File
@@ -6,6 +6,9 @@
#include <LocaleStrings.h>
#include <String.h>
class BBitmap;
namespace icu_4_2 {
class DateFormat;
class Locale;
@@ -21,13 +24,13 @@ class BCountry {
public:
BCountry(const char* languageCode, const char* countryCode);
BCountry(const char* languageAndCountryCode = "en_US");
virtual ~BCountry();
virtual ~BCountry();
virtual bool Name(BString&) const;
const char* Code() const;
virtual bool Name(BString&) const;
const char* Code() const;
status_t GetIcon(BBitmap* result);
// see definitions below
const char *GetString(uint32 id) const;
const char* GetString(uint32 id) const;
// date & time
+12
View File
@@ -9,6 +9,7 @@
#include <assert.h>
#include <IconUtils.h>
#include <String.h>
#include <unicode/datefmt.h>
@@ -86,6 +87,17 @@ BCountry::Code() const
}
status_t
BCountry::GetIcon(BBitmap* result)
{
// TODO: a proper way to locate the library being used ?
BNode storage("/boot/system/lib/liblocale.so");
if (storage.InitCheck() != B_OK)
return B_ERROR;
return BIconUtils::GetVectorIcon(&storage, Code(), result);
}
// TODO use ICU backend keywords instead
const char*
BCountry::GetString(uint32 id) const
+2 -2
View File
@@ -1,8 +1,8 @@
SubDir HAIKU_TOP src kits locale ;
UsePrivateHeaders libbe locale shared ;
UsePublicHeaders locale storage ;
UseLibraryHeaders icu ;
UsePublicHeaders locale storage icon ;
UseLibraryHeaders icu icon ;
SharedLibrary liblocale.so
: cat.cpp