本文整理汇总了C++中QMailMessage::id方法的典型用法代码示例。如果您正苦于以下问题:C++ QMailMessage::id方法的具体用法?C++ QMailMessage::id怎么用?C++ QMailMessage::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMailMessage
的用法示例。
在下文中一共展示了QMailMessage::id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: modify
void WriteMail::modify(const QMailMessage& previousMessage)
{
QString recipients = "";
prepareComposer(previousMessage.messageType(), previousMessage.parentAccountId());
if (composer().isEmpty())
return;
// Record any message properties we should retain
mail.setId(previousMessage.id());
mail.setParentFolderId(previousMessage.parentFolderId());
mail.setContentScheme(previousMessage.contentScheme());
mail.setContentIdentifier(previousMessage.contentIdentifier());
mail.setTo(previousMessage.to());
mail.setFrom(previousMessage.from());
mail.setCustomFields(previousMessage.customFields());
mail.setServerUid(previousMessage.serverUid());
m_composerInterface->compose(QMailMessage::NoResponse, previousMessage);
// ugh. we need to do this everywhere
m_hasMessageChanged = false;
m_precursorId = mail.inResponseTo();
m_replyAction = mail.responseType();
}
示例2: insertMessage
bool MessageFolder::insertMessage(QMailMessage &message)
{
message.setParentFolderId(mFolder.id());
if (message.id().isValid()) {
return QMailStore::instance()->updateMessage(&message);
} else {
return QMailStore::instance()->addMessage(&message);
}
}
示例3: respond
void WriteMail::respond(const QMailMessage& source, QMailMessage::ResponseType type)
{
prepareComposer(source.messageType(), source.parentAccountId());
if (composer().isEmpty())
return;
m_composerInterface->compose(type, source);
m_hasMessageChanged = true;
m_precursorId = source.id();
m_replyAction = type;
}
示例4: addMail
bool SmsClient::addMail(const QMailMessage& mail)
{
QList<QMailAddress> smsRecipients = separateSmsAddresses(mail.recipients());
Q_ASSERT(smsRecipients.count() > 0);
QString smsBody = formatOutgoing(mail.subject(),mail.body().data());
foreach (const QMailAddress& recipient, smsRecipients)
{
if(smsAddress(recipient))
{
if(!validSmsAddress(recipient))
{
QString temp = "<qt>" + tr("Invalid SMS recipient specified for\n "
"mail with subject:\n%1\n"
"NO mail has been sent.")
.arg( mail.subject() ) + "</qt>";
emit errorOccurred(0,temp);
return false;
}
else
{
//address is valid, queue for sending
// Extract the phone number from the e-mail address.
RawSms msg;
msg.msgId = mail.id();
msg.number = QPhoneNumber::resolveLetters( recipient.address() );
msg.body = smsBody;
if (mail.contentType().content().toLower() == "text/x-vcard")
msg.mimetype = QLatin1String("text/x-vCard");
else
msg.mimetype = QLatin1String("text/plain");
smsList.append( msg );
}
}
}
return true;
}
示例5: bodyHtmlText
QString EmailMessageListModel::bodyHtmlText(QMailMessagePartContainer *container) const
{
QMailMessageContentType contentType = container->contentType();
if (container->multipartType() == QMailMessagePartContainerFwd::MultipartNone)
{
if (contentType.subType().toLower() == "html")
{
if (container->hasBody() && container->body().data().size() > 1)
return container->body().data();
else
{
connect (m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(downloadActivityChanged(QMailServiceAction::Activity)));
QMailMessage *msg = (QMailMessage *)container;
QMailMessageIdList ids;
ids << msg->id();
m_retrievalAction->retrieveMessages(ids, QMailRetrievalAction::Content);
return " "; // Put a space here as a place holder to notify UI that we do have html body.
// Should find a better way.
}
}
return "";
}
if (!container->contentAvailable())
{
// if content is not available, attempts to downlaod from the server.
connect (m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(downloadActivityChanged(QMailServiceAction::Activity)));
QMailMessage *msg = (QMailMessage *)container;
QMailMessageIdList ids;
ids << msg->id();
m_retrievalAction->retrieveMessages(ids, QMailRetrievalAction::Content);
return " "; // Put a space here as a place holder to notify UI that we do have html body.
}
QString text("");
for ( uint i = 0; i < container->partCount(); i++ )
{
QMailMessagePart messagePart = container->partAt(i);
contentType = messagePart.contentType();
if (contentType.type().toLower() == "text" && contentType.subType().toLower() == "html")
{
if (messagePart.hasBody())
{
text += messagePart.body().data();
}
else
{
connect (m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(downloadActivityChanged(QMailServiceAction::Activity)));
QMailMessagePart::Location location = messagePart.location();
m_retrievalAction->retrieveMessagePart(location);
text = " ";
break;
}
}
QMailMessagePart subPart;
for (uint j = 0; j < messagePart.partCount(); j++)
{
subPart = messagePart.partAt(j);
contentType = subPart.contentType();
if (contentType.type().toLower() == "text" && contentType.subType().toLower() == "html")
{
if (subPart.hasBody())
{
text += subPart.body().data();
}
else
{
connect (m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(downloadActivityChanged(QMailServiceAction::Activity)));
QMailMessagePart::Location location = subPart.location();
m_retrievalAction->retrieveMessagePart(location);
text = " ";
break;
}
}
}
}
return text;
}