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

#include <cstdint>
#include <list>
#include "message_waiting_indication.hh"
#include "object.hh"




struct _LinphoneMessageWaitingIndication;


namespace linphone {

	class Address;
	class MessageWaitingIndicationSummary;
	class MessageWaitingIndication;
	class Content;

	/**
	 * @brief Object representing a Message Waiting Indication. 
	 *
	 */
	class MessageWaitingIndication: public Object {
	
		public:
			/**
			* Enum describing the different contexts for the @ref
			* MessageWaitingIndicationSummary. 
			*
			*/
			enum class ContextClass {
				/**
				*/
				Voice = 0,
				/**
				*/
				Fax = 1,
				/**
				*/
				Pager = 2,
				/**
				*/
				Multimedia = 3,
				/**
				*/
				Text = 4,
				/**
				*/
				None = 5
			};


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

	
		public:
			
		
			/**
			 * @brief Get the address of the message account concerned by this message waiting
			 * indication. 
			 *
			 * @return The address of the message account concerned by this message waiting
			 * indication.    
			 */
			LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> getAccountAddress() const;
			
			/**
			 * @brief Set the address of the message account concerned by this message waiting
			 * indication. 
			 *
			 * @param address The address of the message account concerned by this message
			 * waiting indication.    
			 */
			LINPHONECXX_PUBLIC void setAccountAddress(const std::shared_ptr<linphone::Address> & address);
			
			/**
			 * @brief Get the total number of new messages (for all the summaries). 
			 *
			 * @return The total number of new messages. 
			 */
			LINPHONECXX_PUBLIC uint32_t getNbNew() const;
			
			/**
			 * @brief Get the total number of new urgent messages (for all the summaries). 
			 *
			 * @return The total number of new urgent messages. 
			 */
			LINPHONECXX_PUBLIC uint32_t getNbNewUrgent() const;
			
			/**
			 * @brief Get the total number of old messages (for all the summaries). 
			 *
			 * @return The total number of old messages. 
			 */
			LINPHONECXX_PUBLIC uint32_t getNbOld() const;
			
			/**
			 * @brief Get the total number of old urgent messages (for all the summaries). 
			 *
			 * @return The total number of old urgent messages. 
			 */
			LINPHONECXX_PUBLIC uint32_t getNbOldUrgent() const;
			
			/**
			 * @brief Get the message waiting indication summaries. 
			 *
			 * @return The message waiting indication summaries.      
			 */
			LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::MessageWaitingIndicationSummary>> getSummaries() const;
			
			/**
			 * @brief Instantiate a new message waiting indication with values from source. 
			 *
			 * @return The newly created @ref MessageWaitingIndication object.    
			 */
			LINPHONECXX_PUBLIC std::shared_ptr<linphone::MessageWaitingIndication> clone() const;
			
			/**
			 * @brief Get the message waiting indication summary for a given context class. 
			 *
			 * @param contextClass the @ref ContextClass for which we want to get the summary. 
			 * @return The @ref MessageWaitingIndicationSummary for the given context class.  
			 *  
			 */
			LINPHONECXX_PUBLIC std::shared_ptr<const linphone::MessageWaitingIndicationSummary> getSummary(ContextClass contextClass) const;
			
			/**
			 * @brief Tells whether there are messages waiting or not. 
			 *
			 * @return true if there are waiting messages, false otherwise. 
			 */
			LINPHONECXX_PUBLIC bool hasMessageWaiting() const;
			
			/**
			 * @brief Get a @ref Content object to put in a NOTIFY message from a @ref
			 * MessageWaitingIndication object. 
			 *
			 * @return The @ref Content to put in a NOTIFY message.       
			 */
			LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> toContent() const;
			
			
	};

};

#endif // _MESSAGE_WAITING_INDICATION_HH

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