1/* 2 * Copyright 2011-2019 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de. 7 * Adrien Destugues, pulkomandy@gmail.com. 8 * John Scipione, jscipione@gmail.com 9 * 10 * Corresponds to: 11 * headers/os/locale/Country.h rev 53489 12 * src/kits/locale/Country.cpp rev 53489 13 */ 14 15 16/*! 17 \file Country.h 18 \ingroup locale 19 \ingroup libbe 20 \brief BCountry class definition. 21*/ 22 23 24/*! 25 \class BCountry 26 \ingroup locale 27 \ingroup libbe 28 \brief Class representing a country. 29 30 BCountry provides information about a particular country including the 31 countries flag (as an HVIF icon), the localized name of the country, 32 and the ISO country code. 33 34 Date, time, and number formatting also depends to some extent on the 35 language used so they are found in the BLocale class instead. 36 37 \since Haiku R1 38*/ 39 40 41/*! 42 \fn BCountry::BCountry(const char* countryCode) 43 \brief Initialize a BCountry from a country code. 44 45 \param countryCode The country code to initialize from. 46 47 \since Haiku R1 48*/ 49 50 51/*! 52 \fn BCountry::BCountry(const BCountry& other) 53 \brief Initialize a BCountry from another BCountry object. 54 55 \param other The BCountry object to initialize from. 56 57 \since Haiku R1 58*/ 59 60 61/*! 62 \fn BCountry& BCountry::operator=(const BCountry& other) 63 \brief Initialize a BCountry from another BCountry object by overloading 64 the = operator. 65 66 \param other The BCountry object to initialize from. 67 68 \since Haiku R1 69*/ 70 71 72/*! 73 \fn BCountry::~BCountry() 74 \brief Destructor method. 75 76 \since Haiku R1 77*/ 78 79 80/*! 81 \fn status_t BCountry::SetTo(const char* countryCode) 82 \brief Initialize a BCountry from a country code. 83 84 \param countryCode The country code to initialize from. 85 86 \returns Same value as InitCheck. 87 88 \since Haiku R1 89*/ 90 91 92/*! 93 \fn status_t BCountry::InitCheck() 94 \brief Check validity of the BCountry object. 95 96 \param countryCode The country code to initialize from. 97 98 \returns B_OK if everything went fine, B_BAD_DATA if the specified country 99 code is not valid, B_NO_MEMORY if the object could not be 100 allocated properly. 101 102 \since Haiku R1 103*/ 104 105 106/*! 107 \fn status_t BCountry::GetName(BString& name, 108 const BLanguage* displayLanguage = NULL) const 109 \brief Writes the country's name into the supplied BString. 110 111 \param name A reference to a BString to write the country name to. 112 \param displayLanguage The language to use when writing the name. Can be 113 \c NULL to use the language set by the user's locale. 114 115 \returns A status code, B_OK if everything went fine, or an error code 116 otherwise. 117 118 \since Haiku R1 119*/ 120 121 122/*! 123 \fn const char* BCountry::Code() const 124 \brief Gets the ISO country code for the country. 125 126 \returns The ISO country code for the country. 127 128 \since Haiku R1 129*/ 130 131 132/*! 133 \fn status_t BCountry::GetIcon(BBitmap* result) const; 134 \brief Render the country's flag to the given BBitmap. 135 136 This function renders the country's flag to the given BBitmap. The bitmap 137 should already be set to the pixel format and size you want to use. 138 139 The flag is stored in HVIF format so it can be rendered at any size and 140 color depth. 141 142 \param result The BBitmap object to draw the flag into. 143 144 \returns \c B_OK if the drawing was successful. 145 146 \since Haiku R1 147*/ 148