File indexing completed on 2023-12-10 04:56:59

0001 /*
0002     Copyright (C) 2013  David Edmundson <kde@davidedmundson.co.uk>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) any later version.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Lesser General Public License for more details.
0013 
0014     You should have received a copy of the GNU Lesser General Public
0015     License along with this library; if not, write to the Free Software
0016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0017 */
0018 
0019 
0020 #ifndef KTP_OUTGOING_MESSAGE_H
0021 #define KTP_OUTGOING_MESSAGE_H
0022 
0023 #include <KTp/ktpcommoninternals_export.h>
0024 #include <KTp/message-context.h>
0025 
0026 #include <TelepathyQt/Types>
0027 
0028 #include <QSharedData>
0029 #include <QSharedDataPointer>
0030 
0031 namespace KTp
0032 {
0033 
0034 /*!
0035  * \par
0036  * An encapsualtion of a message that is to be sent out
0037  *
0038  * \author David Edmundson <kde@davidedmundson.co.uk>
0039  */
0040 class KTPCOMMONINTERNALS_EXPORT OutgoingMessage
0041 {
0042   public:
0043     OutgoingMessage(const KTp::OutgoingMessage &other);
0044     KTp::OutgoingMessage& operator=(const KTp::OutgoingMessage &other);
0045     virtual ~OutgoingMessage();
0046 
0047     /*! \brief The body of the message
0048      * \return the contents of the message as a plain string
0049      */
0050     QString text() const;
0051 
0052     void setText(const QString &text);
0053 
0054     void setType(Tp::ChannelTextMessageType type);
0055 
0056     Tp::ChannelTextMessageType type() const;
0057 
0058 
0059 protected:
0060     explicit OutgoingMessage(const QString &messageText);
0061 
0062 private:
0063     class Private;
0064     QSharedDataPointer<Private> d;
0065     friend class MessageProcessor;
0066 };
0067 
0068 }
0069 
0070 
0071 #endif // KTP_PENDING_SEND_MESSAGE_H