/*******************************************************************************
***  This file is part of Dux Rei Nummariae.                                 ***
***                                                                          ***
***  Copyright (C) 2017, 2018, 2019, 2020, 2021                              ***
***  John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me>                ***
***                                                                          ***
***  This program is free software: you can redistribute it and/or modify it ***
***  under the terms of the GNU Affero General Public License as published   ***
***  by the Free Software Foundation, either version 3 of the License, or    ***
***  (at your option) any later version.                                     ***
***                                                                          ***
***  This program is distributed in the hope that it will be useful, but     ***
***  WITHOUT ANY WARRANTY; without even the implied warranty of              ***
***  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                    ***
***  See the GNU Affero General Public License for more details.             ***
***                                                                          ***
***  You should have received a copy of the GNU Affero General Public License***
***  along with this program. If not, see <http://www.gnu.org/licenses/>.    ***
*******************************************************************************/
#ifndef DRN_BANKING_BANKNAME_H_
#define DRN_BANKING_BANKNAME_H_

#include <iosfwd>

#include <QString>

#include "banking_export.h"


namespace drn
{
namespace banking
{

/**
 * @brief A representation of the name of a financial institution.
 */
class DRN_BANKING_EXPORT BankName
{
	::QString value_;

public:
	BankName() = default;
	/**
	 * @brief The unique name of the financial institution.
	 *
	 * @exception BankError When the supplied name is effectively empty.
	 *
	 * @param name The name of the financial institution.
	 */
	explicit BankName(::QString name);
	BankName(const BankName&) = default;
	BankName(BankName&&) noexcept = default;
	~BankName() = default;
	BankName& operator=(const BankName&) = default;
	BankName& operator=(BankName&&) noexcept = default;
	bool operator==(const BankName& other) const;
	bool operator!=(const BankName& other) const;
	/**
	 * @brief An accessor to the value for the name of the financial institution.
	 */
	const ::QString& institution() const noexcept;
	/**
	 * @brief Determines if the financial institution's name value is set.
	 *
	 * @return True when the name value is not set, false otherwise.
	 */
	bool isEmpty() const;
};

DRN_BANKING_EXPORT bool operator<(const BankName& lhs, const BankName& rhs);
DRN_BANKING_EXPORT ::QString operator+(const ::QString& value, const BankName& bn);
DRN_BANKING_EXPORT std::ostream& operator<<(std::ostream& o, const BankName& bn);
DRN_BANKING_EXPORT ::QString presentationText(const BankName& bn);

}}

// Q_DECLARE_METATYPE(drn::banking::BankName)

#endif
