00001 #ifndef QATTACHMENT_H 00002 #define QATTACHMENT_H 00003 00004 #include <QObject> 00005 #include <QDomDocument> 00006 00007 #define NODE_ATTACH_ROOT "attach" 00008 00009 #define NODE_ATTACH_ID "id" 00010 00011 #define NODE_ATTACH_OWNERID "ownerId" 00012 00013 #define NODE_ATTACH_TYPE "type" 00014 00015 #define NODE_ATTACH_NAME "name" 00016 00017 #define NODE_ATTACH_ALBUMID "albumId" 00018 00019 #define NODE_ATTACH_ICONURL "iconUrl" 00020 00021 #define NODE_ATTACH_ICON "icon" 00022 00023 #define NODE_ATTACH_OBJECT "object" 00024 00025 #define NODE_ATTACH_IMAGE "image" 00026 00027 #define NODE_ATTACH_DURATION "duration" 00028 00032 class QAttachment : public QObject 00033 { 00034 Q_OBJECT 00035 public: 00036 explicit QAttachment(QObject *parent = 0); 00037 00043 QAttachment(const QAttachment& src); 00044 00045 enum AttachmentType { 00046 ImageAttach, 00047 VideoAttach, 00048 AudioAttach, 00049 LinkAttach, 00050 NoteAttach 00051 }; 00052 00056 QString id; 00057 00061 QString ownerId; 00062 00066 AttachmentType type; 00067 00073 QString name; 00074 00080 QString albumId; 00081 00087 QString iconUrl; 00088 00094 QString icon; 00095 00101 QString objectUrl; 00102 00108 QString image; 00109 00115 QString duration; 00116 00117 static void copyData(QAttachment *dst, const QAttachment *src); 00118 00119 QAttachment& operator=(const QAttachment& src); 00120 00128 QDomElement toQDomElement(QDomDocument& doc) const; 00129 00130 static QAttachment fromQDomElement(const QDomElement& fr, const QString& accountId); 00131 00132 }; 00133 00134 #endif // QATTACHMENT_H