From bd098e7ed6f8e52e3b97f60def974c5d8c47369a Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 4 Feb 2016 16:47:08 +0100 Subject: inintial composer controller + hook up to composer ui --- framework/mail/composer.cpp | 109 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 framework/mail/composer.cpp (limited to 'framework/mail/composer.cpp') diff --git a/framework/mail/composer.cpp b/framework/mail/composer.cpp new file mode 100644 index 00000000..aa1ec7fc --- /dev/null +++ b/framework/mail/composer.cpp @@ -0,0 +1,109 @@ +/* + Copyright (c) 2016 Michael Bohlender + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + + +#include "composer.h" + +Composer::Composer(QObject *parent) : QObject(parent) +{ + +} + +QString Composer::to() const +{ + return m_to; +} + +void Composer::setTo(const QString &to) +{ + if(m_to != to) { + m_to = to; + emit toChanged(); + } +} + +QString Composer::cc() const +{ + return m_cc; +} + +void Composer::setCc(const QString &cc) +{ + if(m_cc != cc) { + m_cc = cc; + emit ccChanged(); + } +} + +QString Composer::bcc() const +{ + return m_bcc; +} + +void Composer::setBcc(const QString &bcc) +{ + if(m_bcc != bcc) { + m_bcc = bcc; + emit bccChanged(); + } +} + +QString Composer::subject() const +{ + return m_subject; +} + +void Composer::setSubject(const QString &subject) +{ + if(m_subject != subject) { + m_subject = subject; + emit subjectChanged(); + } +} + +QString Composer::body() const +{ + return m_body; +} + +void Composer::setBody(const QString &body) +{ + if(m_body != body) { + m_body = body; + emit bodyChanged(); + } +} + +void Composer::send() +{ + //TODO + clear(); +} + +void Composer::saveAsDraft() +{ + //TODO + clear(); +} + +void Composer::clear() +{ + setSubject(""); + setBody(""); +} \ No newline at end of file -- cgit v1.2.3