/*
 * Copyright (c) 2010-2022 Belledonne Communications SARL.
 *
 * This file is part of Liblinphone 
 * (see https://gitlab.linphone.org/BC/public/liblinphone).
 *
 * 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 _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif // _MSC_VER

#ifndef _ACCOUNT_MANAGER_SERVICES_REQUEST_HH
#define _ACCOUNT_MANAGER_SERVICES_REQUEST_HH

#include "account_manager_services_request.hh"
#include "object.hh"




struct _LinphoneAccountManagerServicesRequest;


namespace linphone {

	class AccountManagerServicesRequestListener;

	/**
	 * @brief Request object created by @ref AccountManagerServices. 
	 *
	 */
	class AccountManagerServicesRequest: public MultiListenableObject {
	
		public:
			/**
			* List of all supported @ref AccountManagerServicesRequest requests, allowing to
			* know which one triggered either a callback from the @ref
			* AccountManagerServicesRequestListener. 
			*
			*/
			enum class Type {
				/**
				* Asks the account manager to send us an account creation token by push
				* notification. 
				*/
				SendAccountCreationTokenByPush = 0,
				/**
				* Asks the account manager to create a request token to be validated in a web
				* browser (captcha) and that can later be used to create an account creation
				* token. 
				*/
				AccountCreationRequestToken = 1,
				/**
				* Asks the account manager to consume the account creation request token to
				* create an account creation token. 
				*/
				AccountCreationTokenFromAccountCreationRequestToken = 2,
				/**
				* Uses an account creation token to create the account. 
				*/
				CreateAccountUsingToken = 3,
				/**
				* Asks for a code to be sent by SMS to a given phone number to link that phone
				* number with an account. 
				*/
				SendPhoneNumberLinkingCodeBySms = 4,
				/**
				* Uses the code received by SMS to confirm the link between an account and a
				* phone number. 
				*/
				LinkPhoneNumberUsingCode = 5,
				/**
				* Asks for a code to be sent by email to a given email address to link that
				* address with an account. 
				*/
				SendEmailLinkingCodeByEmail = 6,
				/**
				* Uses the code received by email to confirm the link between an account and an
				* email address. 
				*/
				LinkEmailUsingCode = 7,
				/**
				* Gets the list of devices for account. 
				*/
				GetDevicesList = 8,
				/**
				* Removes an account device. 
				*/
				DeleteDevice = 9,
				/**
				*/
				GetCreationTokenAsAdmin = 100,
				/**
				*/
				GetAccountInfoAsAdmin = 101,
				/**
				*/
				DeleteAccountAsAdmin = 102
			};


			LINPHONECXX_PUBLIC AccountManagerServicesRequest(void *ptr, bool takeRef=true);
			LINPHONECXX_PUBLIC _LinphoneAccountManagerServicesRequest *cPtr() {return (_LinphoneAccountManagerServicesRequest *)mPrivPtr;}

			/**
			 * @brief Add an application listener to the AccountManagerServicesRequest instance.
			 *
			 * @param listener the application listener
			 */
			LINPHONECXX_PUBLIC void addListener(const std::shared_ptr<AccountManagerServicesRequestListener> &listener);
			/**
			 * @brief Remove a previously added listener from the AccountManagerServicesRequest instance.
			 *
			 * @param listener the application listener
			 */
			LINPHONECXX_PUBLIC void removeListener(const std::shared_ptr<AccountManagerServicesRequestListener> &listener);
	
		public:
			
		
			/**
			 * @brief Gets the @ref Type representing this request. 
			 *
			 * @return the @ref Type. 
			 */
			LINPHONECXX_PUBLIC Type getType() const;
			
			/**
			 * @brief Executes the request represented by @ref AccountManagerServicesRequest. 
			 *
			 */
			LINPHONECXX_PUBLIC void submit();
			
			
		private:
			void *createCallbacks() override;
	};

};

#endif // _ACCOUNT_MANAGER_SERVICES_REQUEST_HH

#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif // _MSC_VER
