Commit b85c9891 authored by Karel Slaný's avatar Karel Slaný

Replaced MsgEnvelope with QmlIsdsEnvelope.

parent 4b0c0217
......@@ -140,7 +140,6 @@ SOURCES += \
src/qml_interaction/image_provider.cpp \
src/qml_interaction/interaction_filesystem.cpp \
src/qml_interaction/interaction_zfo_file.cpp \
src/qml_interaction/message_envelope.cpp \
src/qml_interaction/message_info.cpp \
src/qml_interaction/string_manipulation.cpp \
src/qml_isds/message_interface.cpp \
......@@ -244,7 +243,6 @@ HEADERS += \
src/qml_interaction/image_provider.h \
src/qml_interaction/interaction_filesystem.h \
src/qml_interaction/interaction_zfo_file.h \
src/qml_interaction/message_envelope.h \
src/qml_interaction/message_info.h \
src/qml_interaction/string_manipulation.h \
src/qml_isds/message_interface.h \
......
......@@ -60,54 +60,54 @@ Item {
}
/* Set mandate fields in QML */
function setMandate(msgEnvelope) {
dmLegalTitleLaw.text = msgEnvelope.dmLegalTitleLaw
dmLegalTitleYear.text = msgEnvelope.dmLegalTitleYear
dmLegalTitleSect.text = msgEnvelope.dmLegalTitleSect
dmLegalTitlePar.text = msgEnvelope.dmLegalTitlePar
dmLegalTitlePoint.text = msgEnvelope.dmLegalTitlePoint
function setMandate(isdsEnvelope) {
dmLegalTitleLaw.text = isdsEnvelope.dmLegalTitleLawStr
dmLegalTitleYear.text = isdsEnvelope.dmLegalTitleYearStr
dmLegalTitleSect.text = isdsEnvelope.dmLegalTitleSect
dmLegalTitlePar.text = isdsEnvelope.dmLegalTitlePar
dmLegalTitlePoint.text = isdsEnvelope.dmLegalTitlePoint
}
/* Set reply message data and add recipient to model */
function setReplyData(userName, msgId) {
headerBar.title = qsTr("Reply %1").arg(msgId)
// get some message envelope data and add recipient to recipient model
var msgEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, recipBoxModel)
dmAnnotation.text = "Re: " + msgEnvelope.dmAnnotation
var isdsEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, recipBoxModel)
dmAnnotation.text = "Re: " + isdsEnvelope.dmAnnotation
// swap sender ref and ident data to recipient (reply)
dmSenderRefNumber.text = msgEnvelope.dmRecipientRefNumber
dmSenderIdent.text = msgEnvelope.dmRecipientIdent
dmRecipientRefNumber.text = msgEnvelope.dmSenderRefNumber
dmRecipientIdent.text = msgEnvelope.dmSenderIdent
if (msgEnvelope.dmType === "I") {
dmSenderRefNumber.text = isdsEnvelope.dmRecipientRefNumber
dmSenderIdent.text = isdsEnvelope.dmRecipientIdent
dmRecipientRefNumber.text = isdsEnvelope.dmSenderRefNumber
dmRecipientIdent.text = isdsEnvelope.dmSenderIdent
if (isdsEnvelope.dmType === "I") {
replyPDZ.visible = true
dmType = "O"
} else {
replyPDZ.visible = false
dmType = ""
}
setMandate(msgEnvelope)
setMandate(isdsEnvelope)
}
/* Set message envelope data and files to attachment model*/
function setTemplateData(userName, msgId) {
headerBar.title = qsTr("Forward %1").arg(msgId)
// get some message envelope data, recipient model must be null (no recipient)
var msgEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, null)
dmAnnotation.text = msgEnvelope.dmAnnotation
dmSenderRefNumber.text = msgEnvelope.dmSenderRefNumber
dmSenderIdent.text = msgEnvelope.dmSenderIdent
dmRecipientRefNumber.text = msgEnvelope.dmRecipientRefNumber
dmRecipientIdent.text = msgEnvelope.dmRecipientIdent
setMandate(msgEnvelope)
var isdsEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, null)
dmAnnotation.text = isdsEnvelope.dmAnnotation
dmSenderRefNumber.text = isdsEnvelope.dmSenderRefNumber
dmSenderIdent.text = isdsEnvelope.dmSenderIdent
dmRecipientRefNumber.text = isdsEnvelope.dmRecipientRefNumber
dmRecipientIdent.text = isdsEnvelope.dmRecipientIdent
setMandate(isdsEnvelope)
sendMsgAttachmentModel.setFromDb(userName, msgId)
}
/* Set message forward data and add ZFO file to model */
function setForwardZfoData(userName, msgId) {
headerBar.title = qsTr("Forward ZFO %1").arg(msgId)
var msgEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, null)
dmAnnotation.text = "Fwd: " + msgEnvelope.dmAnnotation
var isdsEnvelope = messages.getMsgEnvelopeDataAndSetRecipient(userName, msgId, null)
dmAnnotation.text = "Fwd: " + isdsEnvelope.dmAnnotation
var fileName = (msgType == MessageType.TYPE_SENT) ? "ODZ_" + msgId + ".zfo" : "DDZ_" + msgId + ".zfo"
var zfoSize = zfo.getZfoSizeFromDb(userName, msgId)
// Zfo file must exist in the local database so zfoSize must be > 0
......
......@@ -36,7 +36,6 @@
#include "src/global.h"
#include "src/io/filesystem.h"
#include "src/models/accountmodel.h"
#include "src/qml_interaction/message_envelope.h"
#include "src/settings.h"
#include "src/sqlite/dbs.h"
#include "src/sqlite/file_db_container.h"
......
......@@ -56,7 +56,6 @@
#include "src/qml_interaction/image_provider.h"
#include "src/qml_interaction/interaction_filesystem.h"
#include "src/qml_interaction/interaction_zfo_file.h"
#include "src/qml_interaction/message_envelope.h"
#include "src/qml_interaction/string_manipulation.h"
#include "src/qml_isds/message_interface.h"
#include "src/records_management/models/upload_hierarchy_list_model.h"
......@@ -374,7 +373,6 @@ int main(int argc, char *argv[])
ListSortFilterProxyModel::declareQML();
MessageListModel::declareQML();
Messages::declareQML();
MsgEnvelope::declareQML();
MsgInfo::declareQML();
UploadHierarchyListModel::declareQML();
UploadHierarchyQmlProxyModel::declareQML();
......
......@@ -167,7 +167,7 @@ QString Messages::getMessageDetail(const QString &userName,
return msgDb->getMessageDetailHtmlFromDb(msgId);
}
MsgEnvelope *Messages::getMsgEnvelopeDataAndSetRecipient(
QmlIsdsEnvelope *Messages::getMsgEnvelopeDataAndSetRecipient(
const QString &userName, qint64 msgId, const QVariant &dbModelVariant)
{
qDebug("%s()", __func__);
......@@ -201,26 +201,7 @@ MsgEnvelope *Messages::getMsgEnvelopeDataAndSetRecipient(
}
// Return message envelope data into QML
return new (std::nothrow) MsgEnvelope(envelope.dmId(),
envelope.dmAnnotation(), envelope.dbIDSender(), envelope.dmSender(),
envelope.dmSenderAddress(), envelope.dmSenderType(),
envelope.dmSenderOrgUnit(), envelope.dmSenderOrgUnitNumStr(),
envelope.dmSenderRefNumber(), envelope.dmSenderIdent(),
envelope.dbIDRecipient(), envelope.dmRecipient(),
envelope.dmRecipientAddress(), envelope.dmRecipientOrgUnit(),
envelope.dmRecipientOrgUnitNumStr(),
envelope.dmAmbiguousRecipient() == Isds::Type::BOOL_TRUE,
envelope.dmRecipientRefNumber(), envelope.dmRecipientIdent(),
envelope.dmLegalTitleLawStr(), envelope.dmLegalTitleYearStr(),
envelope.dmLegalTitleSect(), envelope.dmLegalTitlePar(),
envelope.dmLegalTitlePoint(), envelope.dmToHands(),
envelope.dmPersonalDelivery() == Isds::Type::BOOL_TRUE,
envelope.dmAllowSubstDelivery() == Isds::Type::BOOL_TRUE,
envelope.dmQTimestamp(),
utcDateTimeToDbFormatStr(envelope.dmDeliveryTime()),
utcDateTimeToDbFormatStr(envelope.dmAcceptanceTime()),
Isds::dmState2Variant(envelope.dmMessageStatus()).toInt(),
envelope.dmAttachmentSize(), envelope.dmType());
return new (std::nothrow) QmlIsdsEnvelope(envelope);
}
void Messages::markMessageAsLocallyRead(const QVariant &msgModelVariant,
......
......@@ -21,12 +21,11 @@
* the two.
*/
#ifndef MESSAGES_H
#define MESSAGES_H
#pragma once
#include <QObject>
#include "src/qml_interaction/message_envelope.h"
#include "src/qml_isds/message_interface.h"
/*
* Class Messages provides interface between QML and message database.
......@@ -103,7 +102,7 @@ public:
* @return Pointer to message envelope data object.
*/
Q_INVOKABLE
MsgEnvelope *getMsgEnvelopeDataAndSetRecipient(const QString &userName,
QmlIsdsEnvelope *getMsgEnvelopeDataAndSetRecipient(const QString &userName,
qint64 msgId, const QVariant &dbModelVariant);
/*!
......@@ -245,5 +244,3 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Messages::MessageTypes)
/* QML passes its arguments via QVariant. */
Q_DECLARE_METATYPE(Messages::MessageType)
#endif // MESSAGES_H
......@@ -40,7 +40,6 @@
#include "src/net/db_wrapper.h"
#include "src/net/isds_const.h"
#include "src/net/isds_wrapper.h"
#include "src/qml_interaction/message_envelope.h"
#include "src/settings.h"
#include "src/sqlite/zfo_db.h"
#include "src/worker/emitter.h"
......
/*
* Copyright (C) 2014-2018 CZ.NIC
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#include <QQmlEngine> /* qmlRegisterType */
#include "src/qml_interaction/message_envelope.h"
void MsgEnvelope::declareQML(void)
{
qmlRegisterType<MsgEnvelope>("cz.nic.mobileDatovka.msgEnvelope", 1, 0, "MsgEnvelope");
qRegisterMetaType<MsgEnvelope>();
}
MsgEnvelope::MsgEnvelope(QObject *parent)
: QObject(parent),
m_dmID(0),
m_dmAnnotation(),
m_dbIDSender(),
m_dmSender(),
m_dmSenderAddress(),
m_dmSenderType(0),
m_dmSenderOrgUnit(),
m_dmSenderOrgUnitNum(),
m_dmSenderRefNumber(),
m_dmSenderIdent(),
m_dbIDRecipient(),
m_dmRecipient(),
m_dmRecipientAddress(),
m_dmRecipientOrgUnit(),
m_dmRecipientOrgUnitNum(),
m_dmAmbiguousRecipient(false),
m_dmRecipientRefNumber(),
m_dmRecipientIdent(),
m_dmLegalTitleLaw(),
m_dmLegalTitleYear(),
m_dmLegalTitleSect(),
m_dmLegalTitlePar(),
m_dmLegalTitlePoint(),
m_dmToHands(),
m_dmPersonalDelivery(false),
m_dmAllowSubstDelivery(false),
m_dmQTimestamp(),
m_dmDeliveryTime(),
m_dmAcceptanceTime(),
m_dmMessageStatus(0),
m_dmAttachmentSize(0),
m_dmType()
{
}
MsgEnvelope::MsgEnvelope(const MsgEnvelope &data)
: QObject(),
m_dmID(data.m_dmID),
m_dmAnnotation(data.m_dmAnnotation),
m_dbIDSender(data.m_dbIDSender),
m_dmSender(data.m_dmSender),
m_dmSenderAddress(data.m_dmSenderAddress),
m_dmSenderType(data.m_dmSenderType),
m_dmSenderOrgUnit(data.m_dmSenderOrgUnit),
m_dmSenderOrgUnitNum(data.m_dmSenderOrgUnitNum),
m_dmSenderRefNumber(data.m_dmSenderRefNumber),
m_dmSenderIdent(data.m_dmSenderIdent),
m_dbIDRecipient(data.m_dbIDRecipient),
m_dmRecipient(data.m_dmRecipient),
m_dmRecipientAddress(data.m_dmRecipientAddress),
m_dmRecipientOrgUnit(data.m_dmRecipientOrgUnit),
m_dmRecipientOrgUnitNum(data.m_dmRecipientOrgUnitNum),
m_dmAmbiguousRecipient(data.m_dmAmbiguousRecipient),
m_dmRecipientRefNumber(data.m_dmRecipientRefNumber),
m_dmRecipientIdent(data.m_dmRecipientIdent),
m_dmLegalTitleLaw(data.m_dmLegalTitleLaw),
m_dmLegalTitleYear(data.m_dmLegalTitleYear),
m_dmLegalTitleSect(data.m_dmLegalTitleSect),
m_dmLegalTitlePar(data.m_dmLegalTitlePar),
m_dmLegalTitlePoint(data.m_dmLegalTitlePoint),
m_dmToHands(data.m_dmToHands),
m_dmPersonalDelivery(data.m_dmPersonalDelivery),
m_dmAllowSubstDelivery(data.m_dmAllowSubstDelivery),
m_dmQTimestamp(data.m_dmQTimestamp),
m_dmDeliveryTime(data.m_dmDeliveryTime),
m_dmAcceptanceTime(data.m_dmAcceptanceTime),
m_dmMessageStatus(data.m_dmMessageStatus),
m_dmAttachmentSize(data.m_dmAttachmentSize),
m_dmType(data.m_dmType)
{
}
MsgEnvelope::MsgEnvelope(qint64 dmID, const QString &dmAnnotation,
const QString &dbIDSender, const QString &dmSender,
const QString &dmSenderAddress, int dmSenderType,
const QString &dmSenderOrgUnit, const QString &dmSenderOrgUnitNum,
const QString &dmSenderRefNumber, const QString &dmSenderIdent,
const QString &dbIDRecipient, const QString &dmRecipient,
const QString &dmRecipientAddress, const QString &dmRecipientOrgUnit,
const QString &dmRecipientOrgUnitNum, bool dmAmbiguousRecipient,
const QString &dmRecipientRefNumber, const QString &dmRecipientIdent,
const QString &dmLegalTitleLaw, const QString &dmLegalTitleYear,
const QString &dmLegalTitleSect, const QString &dmLegalTitlePar,
const QString &dmLegalTitlePoint, const QString &dmToHands,
bool dmPersonalDelivery, bool dmAllowSubstDelivery,
const QString &dmQTimestamp, const QString &dmDeliveryTime,
const QString &dmAcceptanceTime, int dmMessageStatus, int dmAttachmentSize,
const QString &dmType,
QObject *parent)
: QObject(parent),
m_dmID(dmID),
m_dmAnnotation(dmAnnotation),
m_dbIDSender(dbIDSender),
m_dmSender(dmSender),
m_dmSenderAddress(dmSenderAddress),
m_dmSenderType(dmSenderType),
m_dmSenderOrgUnit(dmSenderOrgUnit),
m_dmSenderOrgUnitNum(dmSenderOrgUnitNum),
m_dmSenderRefNumber(dmSenderRefNumber),
m_dmSenderIdent(dmSenderIdent),
m_dbIDRecipient(dbIDRecipient),
m_dmRecipient(dmRecipient),
m_dmRecipientAddress(dmRecipientAddress),
m_dmRecipientOrgUnit(dmRecipientOrgUnit),
m_dmRecipientOrgUnitNum(dmRecipientOrgUnitNum),
m_dmAmbiguousRecipient(dmAmbiguousRecipient),
m_dmRecipientRefNumber(dmRecipientRefNumber),
m_dmRecipientIdent(dmRecipientIdent),
m_dmLegalTitleLaw(dmLegalTitleLaw),
m_dmLegalTitleYear(dmLegalTitleYear),
m_dmLegalTitleSect(dmLegalTitleSect),
m_dmLegalTitlePar(dmLegalTitlePar),
m_dmLegalTitlePoint(dmLegalTitlePoint),
m_dmToHands(dmToHands),
m_dmPersonalDelivery(dmPersonalDelivery),
m_dmAllowSubstDelivery(dmAllowSubstDelivery),
m_dmQTimestamp(dmQTimestamp),
m_dmDeliveryTime(dmDeliveryTime),
m_dmAcceptanceTime(dmAcceptanceTime),
m_dmMessageStatus(dmMessageStatus),
m_dmAttachmentSize(dmAttachmentSize),
m_dmType(dmType)
{
}
qint64 MsgEnvelope::dmID(void) const
{
return m_dmID;
}
void MsgEnvelope::setDmID(qint64 dmID)
{
m_dmID = dmID;
}
QString MsgEnvelope::dmAnnotation(void) const
{
return m_dmAnnotation;
}
void MsgEnvelope::setDmAnnotation(const QString &dmAnnotation)
{
m_dmAnnotation = dmAnnotation;
}
QString MsgEnvelope::dbIDSender(void) const
{
return m_dbIDSender;
}
void MsgEnvelope::setDbIDSender(const QString &dbIDSender)
{
m_dbIDSender = dbIDSender;
}
QString MsgEnvelope::dmSender(void) const
{
return m_dmSender;
}
void MsgEnvelope::setDmSender(const QString &dmSender)
{
m_dmSender = dmSender;
}
QString MsgEnvelope::dmSenderAddress(void) const
{
return m_dmSenderAddress;
}
void MsgEnvelope::setDmSenderAddress(const QString &dmSenderAddress)
{
m_dmSenderAddress = dmSenderAddress;
}
int MsgEnvelope::dmSenderType(void) const
{
return m_dmSenderType;
}
void MsgEnvelope::setDmSenderType(int dmSenderType)
{
m_dmSenderType = dmSenderType;
}
QString MsgEnvelope::dmSenderOrgUnit(void) const
{
return m_dmSenderOrgUnit;
}
void MsgEnvelope::setDmSenderOrgUnit(const QString &dmSenderOrgUnit)
{
m_dmSenderOrgUnit = dmSenderOrgUnit;
}
QString MsgEnvelope::dmSenderOrgUnitNum(void) const
{
return m_dmSenderOrgUnitNum;
}
void MsgEnvelope::setDmSenderOrgUnitNum(const QString &dmSenderOrgUnitNum)
{
m_dmSenderOrgUnitNum = dmSenderOrgUnitNum;
}
QString MsgEnvelope::dmSenderRefNumber(void) const
{
return m_dmSenderRefNumber;
}
void MsgEnvelope::setDmSenderRefNumber(const QString &dmSenderRefNumber)
{
m_dmSenderRefNumber = dmSenderRefNumber;
}
QString MsgEnvelope::dmSenderIdent(void) const
{
return m_dmSenderIdent;
}
void MsgEnvelope::setDmSenderIdent(const QString &dmSenderIdent)
{
m_dmSenderIdent = dmSenderIdent;
}
QString MsgEnvelope::dbIDRecipient(void) const
{
return m_dbIDRecipient;
}
void MsgEnvelope::setDbIDRecipient(const QString &dbIDRecipient)
{
m_dbIDRecipient = dbIDRecipient;
}
QString MsgEnvelope::dmRecipient(void) const
{
return m_dmRecipient;
}
void MsgEnvelope::setDmRecipient(const QString &dmRecipient)
{
m_dmRecipient = dmRecipient;
}
QString MsgEnvelope::dmRecipientAddress(void) const
{
return m_dmRecipientAddress;
}
void MsgEnvelope::setDmRecipientAddress(const QString &dmRecipientAddress)
{
m_dmRecipientAddress = dmRecipientAddress;
}
QString MsgEnvelope::dmRecipientOrgUnit(void) const
{
return m_dmRecipientOrgUnit;
}
void MsgEnvelope::setDmRecipientOrgUnit(const QString &dmRecipientOrgUnit)
{
m_dmRecipientOrgUnit = dmRecipientOrgUnit;
}
QString MsgEnvelope::dmRecipientOrgUnitNum(void) const
{
return m_dmRecipientOrgUnitNum;
}
void MsgEnvelope::setDmRecipientOrgUnitNum(const QString &dmRecipientOrgUnitNum)
{
m_dmRecipientOrgUnitNum = dmRecipientOrgUnitNum;
}
bool MsgEnvelope::dmAmbiguousRecipient(void) const
{
return m_dmAmbiguousRecipient;
}
void MsgEnvelope::setDmAmbiguousRecipient(bool dmAmbiguousRecipient)
{
m_dmAmbiguousRecipient = dmAmbiguousRecipient;
}
QString MsgEnvelope::dmRecipientRefNumber(void) const
{
return m_dmRecipientRefNumber;
}
void MsgEnvelope::setDmRecipientRefNumber(const QString &dmRecipientRefNumber)
{
m_dmRecipientRefNumber = dmRecipientRefNumber;
}
QString MsgEnvelope::dmRecipientIdent(void) const
{
return m_dmRecipientIdent;
}
void MsgEnvelope::setDmRecipientIdent(const QString &dmRecipientIdent)
{
m_dmRecipientIdent = dmRecipientIdent;
}
QString MsgEnvelope::dmLegalTitleLaw(void) const
{
return m_dmLegalTitleLaw;
}
void MsgEnvelope::setDmLegalTitleLaw(const QString &dmLegalTitleLaw)
{
m_dmLegalTitleLaw = dmLegalTitleLaw;
}
QString MsgEnvelope::dmLegalTitleYear(void) const
{
return m_dmLegalTitleYear;
}
void MsgEnvelope::setDmLegalTitleYear(const QString &dmLegalTitleYear)
{
m_dmLegalTitleYear = dmLegalTitleYear;
}
QString MsgEnvelope::dmLegalTitleSect(void) const
{
return m_dmLegalTitleSect;
}
void MsgEnvelope::setDmLegalTitleSect(const QString &dmLegalTitleSect)
{
m_dmLegalTitleSect = dmLegalTitleSect;
}
QString MsgEnvelope::dmLegalTitlePar(void) const
{
return m_dmLegalTitlePar;
}
void MsgEnvelope::setDmLegalTitlePar(const QString &dmLegalTitlePar)
{
m_dmLegalTitlePar = dmLegalTitlePar;
}
QString MsgEnvelope::dmLegalTitlePoint(void) const
{
return m_dmLegalTitlePoint;
}
void MsgEnvelope::setDmLegalTitlePoint(const QString &dmLegalTitlePoint)
{
m_dmLegalTitlePoint = dmLegalTitlePoint;
}
QString MsgEnvelope::dmToHands(void) const
{
return m_dmToHands;
}
void MsgEnvelope::setDmToHands(const QString &dmToHands)
{
m_dmToHands = dmToHands;
}
bool MsgEnvelope::dmPersonalDelivery(void) const
{
return m_dmPersonalDelivery;
}
void MsgEnvelope::setDmPersonalDelivery(bool dmPersonalDelivery)
{
m_dmPersonalDelivery = dmPersonalDelivery;
}
bool MsgEnvelope::dmAllowSubstDelivery(void) const
{
return m_dmAllowSubstDelivery;
}
void MsgEnvelope::setDmAllowSubstDelivery(bool dmAllowSubstDelivery)
{
m_dmAllowSubstDelivery = dmAllowSubstDelivery;
}
QString MsgEnvelope::dmQTimestamp(void) const
{
return m_dmQTimestamp;
}
void MsgEnvelope::setDmQTimestamp(const QString &dmQTimestamp)
{
m_dmQTimestamp = dmQTimestamp;
}
QString MsgEnvelope::dmDeliveryTime(void) const
{
return m_dmDeliveryTime;
}
void MsgEnvelope::setDmDeliveryTime(const QString &dmDeliveryTime)
{
m_dmDeliveryTime = dmDeliveryTime;
}
QString MsgEnvelope::dmAcceptanceTime(void) const
{
return m_dmAcceptanceTime;
}
void MsgEnvelope::setDmAcceptanceTime(const QString &dmAcceptanceTime)
{
m_dmAcceptanceTime = dmAcceptanceTime;
}
int MsgEnvelope::dmMessageStatus(void) const
{
return m_dmMessageStatus;
}
void MsgEnvelope::setDmMessageStatus(int dmMessageStatus)
{
m_dmMessageStatus = dmMessageStatus;
}
int MsgEnvelope::dmAttachmentSize(void) const
{
return m_dmAttachmentSize;
}
void MsgEnvelope::setDmAttachmentSize(int dmAttachmentSize)
{
m_dmAttachmentSize = dmAttachmentSize;
}
QString MsgEnvelope::dmType(void) const
{
return m_dmType;
}
void MsgEnvelope::setDmType(const QString &dmType)
{
m_dmType = dmType;
}
MsgEnvelope *MsgEnvelope::fromVariant(const QVariant &msgEnvelDataVariant)
{
if (!msgEnvelDataVariant.canConvert<QObject *>()) {
return Q_NULLPTR;
}
QObject *obj = qvariant_cast<QObject *>(msgEnvelDataVariant);
return qobject_cast<MsgEnvelope *>(obj);
}
/*
* Copyright (C) 2014-2018 CZ.NIC
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#pragma once
#include <QObject>
#include <QString>
/*!
* @brief Class holds message envelope data.
*/