From 01999cbad14488eb7f34a46d1f34570558c31a90 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2017 14:55:47 +0200 Subject: [PATCH] feat(Message): add interface --- src/message/message.h | 52 ++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/message/message.h b/src/message/message.h index 2d35abcd9..2ed93b803 100644 --- a/src/message/message.h +++ b/src/message/message.h @@ -32,6 +32,7 @@ LINPHONE_BEGIN_NAMESPACE class Address; class ChatRoom; +class Content; class ErrorInfo; class MessagePrivate; @@ -39,52 +40,43 @@ class LINPHONE_PUBLIC Message : public Object { friend class ChatRoom; public: + MessageDirection getDirection () const; + + std::shared_ptr getFromAddress () const; + std::shared_ptr getToAddress () const; + std::shared_ptr getLocalAddress () const; + std::shared_ptr getRemoteAddress () const; + + std::shared_ptr getChatRoom () const; + + std::shared_ptr getErrorInfo () const; + + std::string getContentType () const; + std::string getText () const; + void setText (const std::string &text); - /** - * @brief Set a chat message text to be sent by linphone_chat_room_send_message. - */ - int setText (const std::string &text); + void send () const; - /** - * @brief Get the state of the message. - */ - // ChatMessageState getState () const; + bool containsReadableText () const; - /** - * @brief Get if the message was encrypted when transfered. - */ - bool isSecured (); + bool isSecured () const; - /** - * @brief Get the time the message was sent. - */ time_t getTime () const; - std::shared_ptr getChatRoom (); - - std::string getMessageId () const; + std::string getId () const; std::string getAppdata () const; void setAppdata (const std::string &data); - std::shared_ptr getPeerAddress () const; - - std::shared_ptr getFromAddress () const; - void setFromAddress (const std::shared_ptr &address); - - std::shared_ptr getToAddress () const; - void setToAddress (const std::shared_ptr &addr); - - std::shared_ptr getLocalAddress () const; + std::list > getContents () const; + void addContent (std::shared_ptr &content); + void removeContent (std::shared_ptr &content); std::string getCustomHeaderValue (const std::string &headerName); - void addCustomHeader (const std::string &headerName, const std::string &headerValue); void removeCustomHeader (const std::string &headerName); - std::shared_ptr getErrorInfo () const; - protected: Message ();