2011-08-10 01:46:13 +04:00
|
|
|
/*
|
2019-09-20 13:34:29 +03:00
|
|
|
* Copyright 2011-2019 Haiku, Inc. All rights reserved.
|
2011-08-10 01:46:13 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de.
|
|
|
|
* Adrien Destugues, pulkomandy@gmail.com.
|
|
|
|
* John Scipione, jscipione@gmail.com
|
|
|
|
*
|
|
|
|
* Corresponds to:
|
2019-09-20 13:34:29 +03:00
|
|
|
* headers/os/locale/Country.h rev 53489
|
|
|
|
* src/kits/locale/Country.cpp rev 53489
|
2011-08-10 01:46:13 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
/*!
|
|
|
|
\file Country.h
|
|
|
|
\ingroup locale
|
|
|
|
\ingroup libbe
|
2011-08-10 01:46:13 +04:00
|
|
|
\brief BCountry class definition.
|
|
|
|
*/
|
2010-08-10 16:39:48 +04:00
|
|
|
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
/*!
|
|
|
|
\class BCountry
|
2011-08-10 01:46:13 +04:00
|
|
|
\ingroup locale
|
2013-02-07 06:05:00 +04:00
|
|
|
\ingroup libbe
|
|
|
|
\brief Class representing a country.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
BCountry provides information about a particular country including the
|
|
|
|
countries flag (as an HVIF icon), the localized name of the country,
|
|
|
|
and the ISO country code.
|
2011-08-10 01:46:13 +04:00
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
Date, time, and number formatting also depends to some extent on the
|
|
|
|
language used so they are found in the BLocale class instead.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
/*!
|
|
|
|
\fn BCountry::BCountry(const char* countryCode)
|
|
|
|
\brief Initialize a BCountry from a country code.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
\param countryCode The country code to initialize from.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
|
2010-08-10 16:39:48 +04:00
|
|
|
/*!
|
2011-08-10 01:46:13 +04:00
|
|
|
\fn BCountry::BCountry(const BCountry& other)
|
|
|
|
\brief Initialize a BCountry from another BCountry object.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
\param other The BCountry object to initialize from.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
|
2010-08-10 16:39:48 +04:00
|
|
|
/*!
|
2011-08-10 01:46:13 +04:00
|
|
|
\fn BCountry& BCountry::operator=(const BCountry& other)
|
2014-06-12 00:48:17 +04:00
|
|
|
\brief Initialize a BCountry from another BCountry object by overloading
|
|
|
|
the = operator.
|
|
|
|
|
|
|
|
\param other The BCountry object to initialize from.
|
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
|
2010-08-10 16:39:48 +04:00
|
|
|
/*!
|
2011-08-10 01:46:13 +04:00
|
|
|
\fn BCountry::~BCountry()
|
|
|
|
\brief Destructor method.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2011-08-10 01:46:13 +04:00
|
|
|
*/
|
2010-08-10 16:39:48 +04:00
|
|
|
|
|
|
|
|
2019-09-20 13:34:29 +03:00
|
|
|
/*!
|
|
|
|
\fn status_t BCountry::SetTo(const char* countryCode)
|
|
|
|
\brief Initialize a BCountry from a country code.
|
|
|
|
|
|
|
|
\param countryCode The country code to initialize from.
|
|
|
|
|
|
|
|
\returns Same value as InitCheck.
|
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn status_t BCountry::InitCheck()
|
|
|
|
\brief Check validity of the BCountry object.
|
|
|
|
|
|
|
|
\returns B_OK if everything went fine, B_BAD_DATA if the specified country
|
|
|
|
code is not valid, B_NO_MEMORY if the object could not be
|
|
|
|
allocated properly.
|
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
/*!
|
2013-02-22 05:16:34 +04:00
|
|
|
\fn status_t BCountry::GetName(BString& name,
|
|
|
|
const BLanguage* displayLanguage = NULL) const
|
|
|
|
\brief Writes the country's name into the supplied BString.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2013-02-22 05:16:34 +04:00
|
|
|
\param name A reference to a BString to write the country name to.
|
|
|
|
\param displayLanguage The language to use when writing the name. Can be
|
|
|
|
\c NULL to use the language set by the user's locale.
|
|
|
|
|
|
|
|
\returns A status code, B_OK if everything went fine, or an error code
|
|
|
|
otherwise.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
/*!
|
|
|
|
\fn const char* BCountry::Code() const
|
|
|
|
\brief Gets the ISO country code for the country.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
\returns The ISO country code for the country.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
|
2010-08-10 16:39:48 +04:00
|
|
|
/*!
|
2011-08-10 01:46:13 +04:00
|
|
|
\fn status_t BCountry::GetIcon(BBitmap* result) const;
|
|
|
|
\brief Render the country's flag to the given BBitmap.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
This function renders the country's flag to the given BBitmap. The bitmap
|
|
|
|
should already be set to the pixel format and size you want to use.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
The flag is stored in HVIF format so it can be rendered at any size and
|
|
|
|
color depth.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
\param result The BBitmap object to draw the flag into.
|
2010-08-10 16:39:48 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
\returns \c B_OK if the drawing was successful.
|
2014-06-12 00:48:17 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2010-08-10 16:39:48 +04:00
|
|
|
*/
|