/*******************************************************************************
***  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_NETWORK_ACCESSMANAGER_HPP_
#define DRN_NETWORK_ACCESSMANAGER_HPP_

#include "network_export.h"


class QNetworkReply;
class QNetworkRequest;

namespace drn
{
namespace foundation
{

template<typename>
struct QtUniquePtr;

}
namespace network
{

/**
 * @brief Provides an interface point for network access.
 */
struct DRN_NETWORK_EXPORT AccessManager
{
	/**
	 * @brief When implemented posts a request to obtain the contents of the target request. The
	 * contents as well as associated headers will be downloaded.
	 *
	 * @param request The request whose data to get.
	 *
	 * @return a new object opened for reading which emits the readyRead() signal whenever new data
	 * arrives.
	 */
	virtual foundation::QtUniquePtr<QNetworkReply> send(const QNetworkRequest& request) =0;
};

}}

#endif
