Home · Modules · All Classes · All Namespaces
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:
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:
63  {
64  append(MessageContentPart(mp));
65  }
67  {
68  Q_FOREACH (const MessagePart &mp, mps) {
69  append(MessageContentPart(mp));
70  }
71  }
73  {
74  append(mcp);
75  }
76  MessageContentPartList(const QList<MessageContentPart> &other)
77  : QList<MessageContentPart>(other)
78  {
79  }
80 
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
bool operator==(const SUSocketAddress &v1, const SUSocketAddress &v2)
Definition: types.cpp:50
MessageContentPartList()
Definition: message-content-part.h:61
QList< MessagePart > MessagePartList
Definition: build/TelepathyQt/_gen/types.h:2068
MessageContentPartList(const MessagePart &mp)
Definition: message-content-part.h:62
bool isValid() const
Definition: message-content-part.h:44
MessageContentPartList(const MessagePartList &mps)
Definition: message-content-part.h:66
The MessageContentPartList class represents a list of MessageContentPart.
Definition: message-content-part.h:57
MessageContentPartList(const QList< MessageContentPart > &other)
Definition: message-content-part.h:76
MessagePartList bareParts() const
Definition: message-content-part.h:81
The MessageContentPart class represents a Telepathy message part.
Definition: message-content-part.h:36
MessagePart barePart() const
Definition: message-content-part.cpp:82
Definition: build/TelepathyQt/_gen/types.h:2049
MessageContentPartList(const MessageContentPart &mcp)
Definition: message-content-part.h:72
Definition: abstract-adaptor.cpp:31