7 #include "composerviewinterface.h"
8 #include "composerviewbase.h"
9 #include "snippet/convertsnippetvariablesutil.h"
11 #include <MessageComposer/AttachmentModel>
14 : mComposerView(composerView)
18 ComposerViewInterface::~ComposerViewInterface() =
default;
20 QString ComposerViewInterface::subject()
const
23 return mComposerView->subject();
28 QString ComposerViewInterface::to()
const
31 return mComposerView->
to();
36 QString ComposerViewInterface::cc()
const
39 return mComposerView->cc();
44 QString ComposerViewInterface::bcc()
const
47 return mComposerView->bcc();
52 QString ComposerViewInterface::from()
const
55 return mComposerView->from();
60 QString ComposerViewInterface::replyTo()
const
63 return mComposerView->replyTo();
72 const int countElement = mComposerView->attachmentModel()->attachments().
count();
73 attachmentInterface.setCount(countElement);
78 fileNames.
reserve(countElement);
79 nameAndSize.
reserve(countElement);
81 const auto attachments = mComposerView->attachmentModel()->attachments();
83 fileNames.
append(attachment->fileName());
84 names.
append(attachment->name());
85 nameAndSize.
append(QStringLiteral(
"%1 (%2)").arg(attachment->name(), KIO::convertSize(attachment->size())));
87 attachmentInterface.setNames(names);
88 attachmentInterface.setNamesAndSize(nameAndSize);
89 attachmentInterface.setFileNames(fileNames);
91 return attachmentInterface;
94 QString ComposerViewInterface::shortDate()
const
96 return MessageComposer::ConvertSnippetVariablesUtil::shortDate();
99 QString ComposerViewInterface::longDate()
const
101 return MessageComposer::ConvertSnippetVariablesUtil::longDate();
104 QString ComposerViewInterface::shortTime()
const
106 return MessageComposer::ConvertSnippetVariablesUtil::shortTime();
109 QString ComposerViewInterface::longTime()
const
111 return MessageComposer::ConvertSnippetVariablesUtil::longTime();
114 QString ComposerViewInterface::insertDayOfWeek()
const
116 return MessageComposer::ConvertSnippetVariablesUtil::insertDayOfWeek();