1 #include "asemanmimedata.h" 2 3 class AsemanMimeDataPrivate 4 { 5 public: 6 QString text; 7 QString html; 8 QList<QUrl> urls; 9 QVariantMap dataMap; 10 }; 11 AsemanMimeData(QObject * parent)12AsemanMimeData::AsemanMimeData(QObject *parent) : 13 QObject(parent) 14 { 15 p = new AsemanMimeDataPrivate; 16 } 17 setText(const QString & txt)18void AsemanMimeData::setText(const QString &txt) 19 { 20 if(p->text == txt) 21 return; 22 23 p->text = txt; 24 emit textChanged(); 25 } 26 text() const27QString AsemanMimeData::text() const 28 { 29 return p->text; 30 } 31 setHtml(const QString & html)32void AsemanMimeData::setHtml(const QString &html) 33 { 34 if(p->html == html) 35 return; 36 37 p->html = html; 38 emit htmlChanged(); 39 } 40 html() const41QString AsemanMimeData::html() const 42 { 43 return p->html; 44 } 45 setUrls(const QList<QUrl> & urls)46void AsemanMimeData::setUrls(const QList<QUrl> &urls) 47 { 48 if(p->urls == urls) 49 return; 50 51 p->urls = urls; 52 emit urlsChanged(); 53 } 54 urls() const55QList<QUrl> AsemanMimeData::urls() const 56 { 57 return p->urls; 58 } 59 setDataMap(const QVariantMap & map)60void AsemanMimeData::setDataMap(const QVariantMap &map) 61 { 62 if(p->dataMap == map) 63 return; 64 65 p->dataMap = map; 66 emit dataMapChanged(); 67 } 68 dataMap() const69QVariantMap AsemanMimeData::dataMap() const 70 { 71 return p->dataMap; 72 } 73 ~AsemanMimeData()74AsemanMimeData::~AsemanMimeData() 75 { 76 delete p; 77 } 78 79