message-content-part.h Source File

| Home · All Classes · All Namespaces · Modules · Functions · Files

message-content-part.h
1
23 #ifndef _TelepathyQt_message_content_part_h_HEADER_GUARD_
24 #define _TelepathyQt_message_content_part_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/Constants>
31 #include <TelepathyQt/Types>
32
33 namespace Tp
34 {
35
36 class TP_QT_EXPORT MessageContentPart
37 {
38 public:
39 MessageContentPart();
40 MessageContentPart(const MessagePart &mp);
41 MessageContentPart(const MessageContentPart &other);
42 ~MessageContentPart();
43
44 bool isValid() const { return mPriv.constData() != 0; }
45
46 MessageContentPart &operator=(const MessageContentPart &other);
47 bool operator==(const MessageContentPart &other) const;
48
49 MessagePart barePart() const;
50
51 private:
52 struct Private;
53 friend struct Private;
54 QSharedDataPointer<Private> mPriv;
55 };
56
57 class TP_QT_EXPORT MessageContentPartList :
58 public QList<MessageContentPart>
59 {
60 public:
61 MessageContentPartList() { }
62 MessageContentPartList(const MessagePart &mp)
63 {
64 append(MessageContentPart(mp));
65 }
66 MessageContentPartList(const MessagePartList &mps)
67 {
68 Q_FOREACH (const MessagePart &mp, mps) {
69 append(MessageContentPart(mp));
70 }
71 }
72 MessageContentPartList(const MessageContentPart &mcp)
73 {
74 append(mcp);
75 }
76 MessageContentPartList(const QList<MessageContentPart> &other)
77 : QList<MessageContentPart>(other)
78 {
79 }
80
81 MessagePartList bareParts() const
82 {
83 MessagePartList list;
84 Q_FOREACH (const MessageContentPart &mcp, *this) {
85 list.append(mcp.barePart());
86 }
87 return list;
88 }
89 };
90
91 } // Tp
92
93 Q_DECLARE_METATYPE(Tp::MessageContentPart);
94 Q_DECLARE_METATYPE(Tp::MessageContentPartList);
95
96 #endif
Tp::MessageContentPartList::bareParts
MessagePartList bareParts() const
Definition: message-content-part.h:81
Tp::operator==
bool operator==(const SUSocketAddress &v1, const SUSocketAddress &v2)
Definition: types.cpp:50
Tp::MessageContentPartList::MessageContentPartList
MessageContentPartList(const MessageContentPart &mcp)
Definition: message-content-part.h:72
Tp::MessageContentPartList::MessageContentPartList
MessageContentPartList(const MessagePartList &mps)
Definition: message-content-part.h:66
Tp::MessageContentPart::barePart
MessagePart barePart() const
Definition: message-content-part.cpp:82
Tp::MessageContentPartList::MessageContentPartList
MessageContentPartList(const MessagePart &mp)
Definition: message-content-part.h:62
Tp::MessageContentPartList
The MessageContentPartList class represents a list of MessageContentPart.
Definition: message-content-part.h:57
Tp::MessageContentPartList::MessageContentPartList
MessageContentPartList(const QList< MessageContentPart > &other)
Definition: message-content-part.h:76
Tp::MessageContentPartList::MessageContentPartList
MessageContentPartList()
Definition: message-content-part.h:61
Tp::MessagePartList
QList< MessagePart > MessagePartList
Definition: build/TelepathyQt/_gen/types.h:2031
Tp::MessageContentPart
The MessageContentPart class represents a Telepathy message part.
Definition: message-content-part.h:36
Tp::MessageContentPart::isValid
bool isValid() const
Definition: message-content-part.h:44
Tp::MessagePart
Definition: build/TelepathyQt/_gen/types.h:2013