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

#include "chat_room.hh"
#include "object.hh"




struct _LinphoneChatParams;


namespace linphone {

	class ChatParams;

	/**
	 * @brief Object defining settings strictly associated with @ref ChatRoom objects
	 * such as ephemeral settings and backends. 
	 *
	 * It is automatically created when you enable chat capabilities in the @ref
	 * ConferenceParams.
	 * If the @ref ChatRoom backend is @ref ChatRoom::Backend::Basic, then no other
	 * parameter is required, but @ref ChatMessage sent and received won't benefit
	 * from all features a @ref ChatRoom::Backend::FlexisipChat can offer like
	 * conversation with multiple participants and a subject, end-to-end encryption,
	 * ephemeral messages, etc... but this type is the only one that can interoperate
	 * with other SIP clients or with non-flexisip SIP proxies. 
	 */
	class ChatParams: public Object {
	
		public:

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

	
		public:
			
		
			/**
			 * @brief Get the backend implementation of the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @return the @ref ChatRoom::Backend 
			 */
			LINPHONECXX_PUBLIC linphone::ChatRoom::Backend getBackend() const;
			
			/**
			 * @brief Set the backend implementation of these text capabilities of the chat
			 * parameters. 
			 *
			 * @param backend The @ref ChatRoom::Backend enum value 
			 */
			LINPHONECXX_PUBLIC void setBackend(linphone::ChatRoom::Backend backend);
			
			/**
			 * @brief Get the encryption implementation of the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @return the @ref ChatRoom::EncryptionBackend 
			 */
			LINPHONECXX_PUBLIC linphone::ChatRoom::EncryptionBackend getEncryptionBackend() const;
			
			/**
			 * @brief Set the encryption backend implementation of these text capabilities of
			 * the chat parameters. 
			 *
			 * @param backend The @ref ChatRoom::EncryptionBackend enum value 
			 */
			LINPHONECXX_PUBLIC void setEncryptionBackend(linphone::ChatRoom::EncryptionBackend backend);
			
			/**
			 * @brief Get the encryption status of the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @return true if encryption is enabled, false otherwise 
			 */
			LINPHONECXX_PUBLIC bool encryptionEnabled() const;
			
			/**
			 * @brief Get lifetime (in seconds) for all new ephemeral messages in the text
			 * capabilities of the chat. 
			 *
			 * After the message is read, it will be deleted after "time" seconds. @see
			 * ChatRoom::activateEphemeral() 
			 * @return the ephemeral lifetime (in seconds) 
			 */
			LINPHONECXX_PUBLIC long getEphemeralLifetime() const;
			
			/**
			 * @brief Set lifetime (in seconds) for all new ephemeral messages in the text
			 * capabilities of the chat. 
			 *
			 * After the message is read, it will be deleted after "time" seconds. @see
			 * ChatRoom::activateEphemeral() 
			 * @deprecated 20/02/2026 Use activateEphemeral() or deactivateEphemeral()
			 * instead. 
			 */
			LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void setEphemeralLifetime(long time);
			
			/**
			 * @brief Get the ephemeral message mode of the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @return the ephemeral message mode @ref ChatRoom::EphemeralMode 
			 */
			LINPHONECXX_PUBLIC linphone::ChatRoom::EphemeralMode getEphemeralMode() const;
			
			/**
			 * @brief Enables or disables forcing of ephemeral messages for the text
			 * capabilities of the chat associated with the given parameters. 
			 *
			 * @param mode Ephemeral message mode @ref ChatRoom::EphemeralMode. 
			 */
			LINPHONECXX_PUBLIC void setEphemeralMode(linphone::ChatRoom::EphemeralMode mode);
			
			/**
			 * @brief Get the real time text status of the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @return true if real time text is enabled, false otherwise 
			 */
			LINPHONECXX_PUBLIC bool rttEnabled() const;
			
			/**
			 * @brief Enables or disables real time text for the text capabilities of the chat
			 * associated with the given parameters. 
			 *
			 * @param rtt true to enable real time text, false to disable. 
			 */
			LINPHONECXX_PUBLIC void enableRtt(bool rtt);
			
			/**
			 * @brief Set lifetime (in seconds) for all new ephemeral messages in the text
			 * capabilities of the chat. 
			 *
			 * After the message is read, it will be deleted after "time" seconds. @see
			 * ChatRoom::activateEphemeral() 
			 * @param lifetime The ephemeral lifetime, strictly positive 
			 */
			LINPHONECXX_PUBLIC linphone::Status activateEphemeral(unsigned int lifetime);
			
			/**
			 * @brief Clone a @ref ChatParams. 
			 *
			 * @return An allocated @ref ChatParams with the same parameters than params    
			 */
			LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatParams> clone() const;
			
			/**
			 * @brief Deactivate new ephemeral messages in the text capabilities of the chat. 
			 *
			 * @see ChatRoom::deactivateEphemeral() 
			 */
			LINPHONECXX_PUBLIC void deactivateEphemeral();
			
			
	};

};

#endif // _CHAT_PARAMS_HH

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