forked from katropine/gmailsniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail.cpp
93 lines (80 loc) · 2.21 KB
/
email.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* This file is Copyright 2012
* Kristian Beres <[email protected]>
*
* Other copyrights also apply to some parts of this work. Please
* see the individual file headers for details.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version. See the file
* COPYING included with this distribution for more information.
*/
#include "email.h"
#include <QString>
#include <QDateTime>
/***
<entry>
<title>email title</title>
<summary>email summary</summary>
<link rel="alternate" href="link_to_the_email" type="text/html"/>
<modified>2012-09-25T14:16:49Z</modified>
<issued>2012-09-25T14:16:49Z</issued>
<id>tag:gmail.google.com,2004:1414091358027121800</id>
<author>
<name>ivanka</name>
<email>[email protected]</email>
</author>
</entry>
*/
Email::Email(){
//entity class
}
void Email::setTitle(QString title){
this->title = title;
}
void Email::setSummary(QString summary){
this->summary = summary;
}
void Email::setAuthorName(QString autorMame){
this->autorMame = autorMame;
}
void Email::setLink(QString link){
this->link = link;
}
void Email::setIssued(QString issued){
this->issued = issued;
}
QString Email::getTitle(){
return this->title;
}
QString Email::getSummary(){
return this->summary;
}
QString Email::getAuthorName(){
return this->autorMame;
}
QString Email::getLink(){
return this->link;
}
QString Email::getIssued(){
return this->issued;
}
QString Email::__toString(){
QString buttonText;
QString title;
if(this->getTitle().length() > 43){
title = this->getTitle().left(40).append("...");
}else{
title = this->getTitle();
}
buttonText.append(title);
buttonText.append("\n");
buttonText.append(QDateTime::fromString(this->getIssued(), "yyyy-MM-ddThh:mm:ssZ").toString("HH:mm:ss ddd MMM dd yyyy"));
buttonText.append("\n");
//buttonText.append(this->getSummary());
//buttonText.append("\n");
buttonText.append(this->getAuthorName());
return buttonText;
}