Some old files deleted.
This commit is contained in:
parent
f1a95b3df0
commit
cf2402128b
@ -33,3 +33,5 @@ HEADERS += \
|
||||
src/mimetext.h \
|
||||
src/smtpclient.h \
|
||||
src/SmtpMime
|
||||
|
||||
OTHER_FILES +=
|
||||
|
101
mail.cpp
101
mail.cpp
@ -1,101 +0,0 @@
|
||||
#include "mail.h"
|
||||
#include <QFileInfo>
|
||||
|
||||
Mail::Mail()
|
||||
{
|
||||
}
|
||||
|
||||
void Mail::setSender(QString address, QString name)
|
||||
{
|
||||
this->sender = new EmailAddress(address, name);
|
||||
}
|
||||
|
||||
void Mail::addRecipient(QString rcpt, QString name)
|
||||
{
|
||||
this->recipients << EmailAddress (rcpt, name);
|
||||
}
|
||||
|
||||
void Mail::setSubject(QString subject)
|
||||
{
|
||||
this->subject = subject;
|
||||
}
|
||||
|
||||
void Mail::setContent(QString text)
|
||||
{
|
||||
this->text = text;
|
||||
}
|
||||
|
||||
EmailAddress & Mail::getSender()
|
||||
{
|
||||
return *sender;
|
||||
}
|
||||
|
||||
QList<EmailAddress> & Mail::getRecipients()
|
||||
{
|
||||
return recipients;
|
||||
}
|
||||
|
||||
QString & Mail::getSubject()
|
||||
{
|
||||
return subject;
|
||||
}
|
||||
|
||||
QString & Mail::getText()
|
||||
{
|
||||
return text;
|
||||
|
||||
}
|
||||
|
||||
void Mail::addAttachment(QFile *file, QString type)
|
||||
{
|
||||
attachments << Attachment (*file, type);
|
||||
}
|
||||
|
||||
QList<Attachment> & Mail::getAttachments()
|
||||
{
|
||||
return attachments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****** Email Address *******/
|
||||
EmailAddress::EmailAddress(QString address, QString name)
|
||||
{
|
||||
this->address = address;
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
QString EmailAddress::getAddress() const
|
||||
{
|
||||
return address;
|
||||
}
|
||||
|
||||
QString EmailAddress::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/****** Attachment *******/
|
||||
Attachment::Attachment(QFile& file, QString type) :
|
||||
file(file)
|
||||
{
|
||||
//this->file = file;
|
||||
this->type = type;
|
||||
this->name = QFileInfo(file).fileName();
|
||||
}
|
||||
|
||||
QFile& Attachment::getFile() const
|
||||
{
|
||||
return file;
|
||||
}
|
||||
|
||||
QString Attachment::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
QString Attachment::getType() const
|
||||
{
|
||||
return type;
|
||||
}
|
81
mail.h
81
mail.h
@ -1,81 +0,0 @@
|
||||
#ifndef MAIL_H
|
||||
#define MAIL_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
|
||||
class EmailAddress;
|
||||
class Attachment;
|
||||
|
||||
class Mail : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Mail();
|
||||
|
||||
enum ContentType
|
||||
{
|
||||
Html,
|
||||
PlainText
|
||||
};
|
||||
|
||||
|
||||
void setSender(QString sender, QString name="");
|
||||
void setSender(EmailAddress adr);
|
||||
|
||||
void addRecipient(QString rcpt, QString name="");
|
||||
void setSubject(QString title);
|
||||
void setContent(QString text);
|
||||
void setEncoding(QString text);
|
||||
void addAttachment(QFile* file, QString type="application/octet-stream");
|
||||
|
||||
EmailAddress& getSender();
|
||||
QList<EmailAddress>& getRecipients();
|
||||
QString& getSubject();
|
||||
QString& getText();
|
||||
QList<Attachment>& getAttachments();
|
||||
|
||||
|
||||
private:
|
||||
EmailAddress* sender;
|
||||
QList<EmailAddress> recipients;
|
||||
QString subject;
|
||||
QString text;
|
||||
QList<Attachment> attachments;
|
||||
|
||||
};
|
||||
/*
|
||||
class EmailAddress
|
||||
{
|
||||
public:
|
||||
EmailAddress(QString address, QString name="");
|
||||
|
||||
QString getName() const;
|
||||
QString getAddress() const;
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QString address;
|
||||
};
|
||||
*/
|
||||
|
||||
class Attachment
|
||||
{
|
||||
public:
|
||||
Attachment(QFile& file, QString type = "application/octet-stream");
|
||||
|
||||
QString getName() const;
|
||||
QFile& getFile() const;
|
||||
QString getType() const;
|
||||
|
||||
void setName(QString name);
|
||||
void setType(QString type);
|
||||
|
||||
private:
|
||||
QFile& file;
|
||||
QString name;
|
||||
QString type;
|
||||
};
|
||||
|
||||
|
||||
#endif // MAIL_H
|
Loading…
Reference in New Issue
Block a user