[Telepathy-commits] [telepathy-qt4/master] Move Message, ReceivedMessage declarations to their own header file

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Feb 20 10:09:46 PST 2009


---
 TelepathyQt4/Client/Message         |   13 +++++
 TelepathyQt4/Client/ReceivedMessage |   13 +++++
 TelepathyQt4/Client/message.h       |  100 +++++++++++++++++++++++++++++++++++
 TelepathyQt4/Client/text-channel.h  |   64 +---------------------
 TelepathyQt4/Makefile.am            |    3 +
 5 files changed, 131 insertions(+), 62 deletions(-)
 create mode 100644 TelepathyQt4/Client/Message
 create mode 100644 TelepathyQt4/Client/ReceivedMessage
 create mode 100644 TelepathyQt4/Client/message.h

diff --git a/TelepathyQt4/Client/Message b/TelepathyQt4/Client/Message
new file mode 100644
index 0000000..fd4d70f
--- /dev/null
+++ b/TelepathyQt4/Client/Message
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_Message_HEADER_GUARD_
+#define _TelepathyQt4_Client_Message_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/message.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/ReceivedMessage b/TelepathyQt4/Client/ReceivedMessage
new file mode 100644
index 0000000..c3b2a76
--- /dev/null
+++ b/TelepathyQt4/Client/ReceivedMessage
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_ReceivedMessage_HEADER_GUARD_
+#define _TelepathyQt4_Client_ReceivedMessage_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/message.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/message.h b/TelepathyQt4/Client/message.h
new file mode 100644
index 0000000..6d3b98e
--- /dev/null
+++ b/TelepathyQt4/Client/message.h
@@ -0,0 +1,100 @@
+/* Message object used by text channel client-side proxy
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _TelepathyQt4_Client_message_h_HEADER_GUARD_
+#define _TelepathyQt4_Client_message_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <QSharedDataPointer>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+class Message
+{
+public:
+
+    Message(const Message &other);
+    Message &operator=(const Message &other);
+    bool operator==(const Message &other) const;
+    ~Message();
+
+    // Convenient access to headers
+
+    QDateTime sent() const;
+
+    ChannelTextMessageType messageType() const;
+
+    bool isTruncated() const;
+
+    bool hasNonTextContent() const;
+
+    QString messageToken() const;
+
+    bool isSpecificToDBusInterface() const;
+    QString dbusInterface() const;
+
+    QString text() const;
+
+    // Direct access to the whole message (header and body)
+
+    MessagePart header() const;
+
+    int size() const;
+    MessagePart part(uint index) const;
+
+protected:
+    friend class TextChannel;
+
+    Message();
+    Message(const MessagePartList &parts);
+    Message(uint, uint, const QString &);
+
+    class Private;
+    QSharedDataPointer<Private> mPriv;
+};
+
+class ReceivedMessage : public Message
+{
+public:
+    ReceivedMessage(const ReceivedMessage &other);
+    ReceivedMessage &operator=(const ReceivedMessage &other);
+    ~ReceivedMessage();
+
+    QDateTime received() const;
+    QSharedPointer<Contact> sender() const;
+    bool isScrollback() const;
+    bool isRescued() const;
+
+private:
+    friend class TextChannel;
+    ReceivedMessage(const MessagePartList &parts, const TextChannel *channel);
+    ReceivedMessage();
+};
+
+} // Telepathy::Client
+} // Telepathy
+
+#endif
diff --git a/TelepathyQt4/Client/text-channel.h b/TelepathyQt4/Client/text-channel.h
index 8dad371..f4d5159 100644
--- a/TelepathyQt4/Client/text-channel.h
+++ b/TelepathyQt4/Client/text-channel.h
@@ -36,68 +36,8 @@ namespace Client
 
 class TextChannel;
 class PendingReadyChannel;
-
-class Message
-{
-public:
-
-    Message(const Message &other);
-    Message &operator=(const Message &other);
-    bool operator==(const Message &other) const;
-    ~Message();
-
-    // Convenient access to headers
-
-    QDateTime sent() const;
-
-    ChannelTextMessageType messageType() const;
-
-    bool isTruncated() const;
-
-    bool hasNonTextContent() const;
-
-    QString messageToken() const;
-
-    bool isSpecificToDBusInterface() const;
-    QString dbusInterface() const;
-
-    QString text() const;
-
-    // Direct access to the whole message (header and body)
-
-    MessagePart header() const;
-
-    int size() const;
-    MessagePart part(uint index) const;
-
-protected:
-    friend class TextChannel;
-
-    Message();
-    Message(const MessagePartList &parts);
-    Message(uint, uint, const QString &);
-
-    class Private;
-    QSharedDataPointer<Private> mPriv;
-};
-
-class ReceivedMessage : public Message
-{
-public:
-    ReceivedMessage(const ReceivedMessage &other);
-    ReceivedMessage &operator=(const ReceivedMessage &other);
-    ~ReceivedMessage();
-
-    QDateTime received() const;
-    QSharedPointer<Contact> sender() const;
-    bool isScrollback() const;
-    bool isRescued() const;
-
-private:
-    friend class TextChannel;
-    ReceivedMessage(const MessagePartList &parts, const TextChannel *channel);
-    ReceivedMessage();
-};
+class Message;
+class ReceivedMessage;
 
 class TextChannel : public Channel
 {
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index 74e1923..0daa5c0 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -152,6 +152,7 @@ tpqt4clientinclude_HEADERS = \
     Client/FileTransfer \
     Client/MediaSessionHandler \
     Client/MediaStreamHandler \
+    Client/Message \
     Client/OptionalInterfaceFactory \
     Client/PendingAccount \
     Client/PendingChannel \
@@ -169,6 +170,7 @@ tpqt4clientinclude_HEADERS = \
     Client/PendingStringList \
     Client/PendingVoidMethodCall \
     Client/Properties \
+    Client/ReceivedMessage \
     Client/ReferencedHandles \
     Client/ReferencedHandlesIterator \
     Client/RoomList \
@@ -220,6 +222,7 @@ tpqt4clientinclude_HEADERS = \
     Client/file-transfer.h \
     Client/media-session-handler.h \
     Client/media-stream-handler.h \
+    Client/message.h \
     Client/optional-interface-factory.h \
     Client/pending-account.h \
     Client/pending-channel.h \
-- 
1.5.6.5




More information about the telepathy-commits mailing list