An E-mail composer widget.
More...
#include <Composer.h>
|
Wt::Signal< void > | send |
| The message is ready to be sent... More...
|
|
Wt::Signal< void > | discard |
| The message must be discarded. More...
|
|
An E-mail composer widget.
This widget is part of the Wt composer example.
Definition at line 40 of file Composer.h.
◆ Composer()
Composer::Composer |
( |
WContainerWidget * |
parent = 0 | ) |
|
Construct a new Composer.
Definition at line 25 of file Composer.C.
26 : WCompositeWidget(parent),
30 setImplementation(
layout_ =
new WContainerWidget());
◆ attachmentDone()
void Composer::attachmentDone |
( |
| ) |
|
|
private |
Slotcalled when an attachment has been uploaded.
This used during while saving the email and waiting for remaining attachments to be uploaded. It is connected to the AttachmentEdit control signals that are emitted when an attachment has been processed.
Definition at line 331 of file Composer.C.
◆ attachments()
std::vector< Attachment > Composer::attachments |
( |
| ) |
const |
Get the list of attachments.
The ownership of the attachment spool files is transferred to the caller as well, be sure to delete them !
Definition at line 75 of file Composer.C.
80 std::vector<Attachment> toadd =
attachments_[i]->attachments();
◆ attachMore()
void Composer::attachMore |
( |
| ) |
|
|
private |
Add an attachment edit.
Definition at line 249 of file Composer.C.
◆ bcc()
std::vector< Contact > Composer::bcc |
( |
| ) |
const |
Get the Bc: contacts.
Definition at line 60 of file Composer.C.
◆ cc()
std::vector< Contact > Composer::cc |
( |
| ) |
const |
Get the Cc: contacts.
Definition at line 55 of file Composer.C.
◆ createUi()
void Composer::createUi |
( |
| ) |
|
|
private |
Definition at line 93 of file Composer.C.
95 setStyleClass(
"darker");
98 WContainerWidget *horiz;
103 horiz =
new WContainerWidget(
layout_);
104 horiz->setPadding(5);
121 edits_->setStyleClass(
"lighter");
122 edits_->resize(WLength(100, WLength::Percentage), WLength::Auto);
123 edits_->elementAt(0, 0)->resize(WLength(1, WLength::Percentage),
132 edits_->elementAt(0, 1)->setMargin(5, Top);
163 new Label(tr(
"msg.subject"),
edits_->elementAt(4, 0));
165 subject_->resize(WLength(99, WLength::Percentage), WLength::Auto);
170 new WImage(
"icons/paperclip.png",
edits_->elementAt(5, 0));
171 edits_->elementAt(5, 0)->setContentAlignment(AlignRight | AlignTop);
172 edits_->elementAt(5, 0)->setPadding(3);
200 horiz =
new WContainerWidget(
layout_);
201 horiz->setPadding(5);
◆ discardIt()
void Composer::discardIt |
( |
| ) |
|
|
private |
Slot attached to the Discard button.
Discards the current message: emits the discard event.
Definition at line 386 of file Composer.C.
◆ message()
const WString & Composer::message |
( |
| ) |
const |
◆ removeAttachment()
Remove the given attachment edit.
Definition at line 264 of file Composer.C.
269 std::vector<AttachmentEdit *>::iterator i
◆ saved()
All attachments have been processed, determine the result of saving the message.
Definition at line 348 of file Composer.C.
354 bool attachmentsFailed =
false;
357 attachmentsFailed =
true;
361 if (attachmentsFailed) {
362 setStatus(tr(
"msg.attachment.failed"),
"error");
369 strftime(buffer, 100,
"%H:%M", &td);
371 char buffer[] =
"server";
374 statusMsg_->setText(std::string(
"Draft saved at ") + buffer);
◆ saveNow()
void Composer::saveNow |
( |
| ) |
|
|
private |
Slot attached to the Save now button.
Tries to save the mail message, and gives feedback on failure and on success.
Definition at line 302 of file Composer.C.
314 for (
unsigned i = 0; i <
attachments_.size() - 1; ++i) {
325 setStatus(tr(
"msg.uploading"),
"status");
◆ sendIt()
void Composer::sendIt |
( |
| ) |
|
|
private |
Slot attached to the Send button.
Tries to save the mail message, and if succesfull, sends it.
Definition at line 289 of file Composer.C.
◆ setAddressBook()
void Composer::setAddressBook |
( |
const std::vector< Contact > & |
addressBook | ) |
|
Set the address book, for autocomplete suggestions.
Definition at line 65 of file Composer.C.
◆ setMessage()
void Composer::setMessage |
( |
const WString & |
message | ) |
|
◆ setStatus()
void Composer::setStatus |
( |
const WString & |
text, |
|
|
const WString & |
style |
|
) |
| |
|
private |
Set the status, and apply the given style.
Definition at line 342 of file Composer.C.
◆ setSubject()
void Composer::setSubject |
( |
const WString & |
subject | ) |
|
◆ setTo()
void Composer::setTo |
( |
const std::vector< Contact > & |
to | ) |
|
Set message To: contacts.
Definition at line 35 of file Composer.C.
◆ subject()
const WString & Composer::subject |
( |
| ) |
const |
◆ to()
std::vector< Contact > Composer::to |
( |
| ) |
const |
Get the To: contacts.
Definition at line 50 of file Composer.C.
◆ AttachmentEdit
◆ addbcc_
◆ addcc_
◆ attachFile_
◆ attachments_
Array which holds all the attachments, including one extra invisible one.
Definition at line 134 of file Composer.h.
◆ attachmentsPending_
int Composer::attachmentsPending_ |
|
private |
number of attachments waiting to be uploaded during saving
Definition at line 143 of file Composer.h.
◆ attachOtherFile_
Option* Composer::attachOtherFile_ |
|
private |
◆ bccEdit_
◆ botDiscardButton_
WPushButton * Composer::botDiscardButton_ |
|
private |
◆ botSaveNowButton_
WPushButton * Composer::botSaveNowButton_ |
|
private |
◆ botSendButton_
WPushButton* Composer::botSendButton_ |
|
private |
◆ ccEdit_
◆ contactSuggestions_
The suggestions popup for the addressee edits.
Definition at line 116 of file Composer.h.
◆ discard
Wt::Signal<void> Composer::discard |
The message must be discarded.
Definition at line 97 of file Composer.h.
◆ edits_
◆ layout_
WContainerWidget* Composer::layout_ |
|
private |
◆ message_
WTextArea* Composer::message_ |
|
private |
WTextArea for the main message.
Definition at line 137 of file Composer.h.
◆ options_
OptionsList for editing Cc or Bcc.
Definition at line 122 of file Composer.h.
◆ saving_
state when waiting asyncrhonously for attachments to be uploaded
Definition at line 140 of file Composer.h.
◆ send
Wt::Signal<void> Composer::send |
The message is ready to be sent...
Definition at line 93 of file Composer.h.
◆ sending_
◆ statusMsg_
WText* Composer::statusMsg_ |
|
private |
◆ subject_
WLineEdit* Composer::subject_ |
|
private |
The subject line edit.
Definition at line 119 of file Composer.h.
◆ toEdit_
◆ topDiscardButton_
WPushButton * Composer::topDiscardButton_ |
|
private |
◆ topSaveNowButton_
WPushButton * Composer::topSaveNowButton_ |
|
private |
◆ topSendButton_
WPushButton* Composer::topSendButton_ |
|
private |
The documentation for this class was generated from the following files:
- /build/witty-XWY8sd/witty-3.3.12+dfsg/examples/composer/Composer.h
- /build/witty-XWY8sd/witty-3.3.12+dfsg/examples/composer/Composer.C
WPushButton * botSendButton_
Option * attachFile_
Option for attaching a file.
void sendIt()
Slot attached to the Send button.
Option * addcc_
Option for editing Cc:
WPushButton * botSaveNowButton_
Wt::Signal< void > send
The message is ready to be sent...
std::vector< Contact > addressees() const
Get a list of addressees.
WPushButton * topDiscardButton_
ContactSuggestions * contactSuggestions_
The suggestions popup for the addressee edits.
void setStatus(const WString &text, const WString &style)
Set the status, and apply the given style.
bool saving_
state when waiting asyncrhonously for attachments to be uploaded
void setAddressees(const std::vector< Contact > &contacts)
Set a list of addressees.
WTextArea * message_
WTextArea for the main message.
WPushButton * botDiscardButton_
Option * addbcc_
Option for editing Bcc:
const WString & subject() const
Get the subject.
const WString & message() const
Get the message.
AddresseeEdit * ccEdit_
Cc: Addressees edit.
void attachMore()
Add an attachment edit.
Option * attachOtherFile_
Option for attaching another file.
friend class AttachmentEdit
OptionList * options_
OptionsList for editing Cc or Bcc.
std::vector< Contact > to() const
Get the To: contacts.
void saved()
All attachments have been processed, determine the result of saving the message.
void saveNow()
Slot attached to the Save now button.
void discardIt()
Slot attached to the Discard button.
WLineEdit * subject_
The subject line edit.
int attachmentsPending_
number of attachments waiting to be uploaded during saving
std::vector< AttachmentEdit * > attachments_
Array which holds all the attachments, including one extra invisible one.
An edit field for an email addressee.
Wt::Signal< void > discard
The message must be discarded.
WPushButton * topSaveNowButton_
AddresseeEdit * toEdit_
To: Addressees edit.
void add(Option *option)
Add an Option to the list.
A list of options, separated by '|'.
An edit field for an email attachment.
void update()
Updates the stateless implementations after an Option has been hidden or shown.
std::vector< Attachment > attachments() const
Get the list of attachments.
AddresseeEdit * bccEdit_
Bcc: Addressees edit.
WContainerWidget * layout_
WPushButton * topSendButton_
WInteractWidget * item()
Returns the clickable part.
Generated on Fri Apr 24 2020 for the
C++ Web Toolkit (Wt) by
1.8.17