#include <Composer.h>
Public Member Functions | |
Composer (WContainerWidget *parent=0) | |
Construct a new Composer. | |
void | setTo (const std::vector< Contact > &to) |
Set message To: contacts. | |
void | setSubject (const WString &subject) |
Set subject. | |
void | setMessage (const WString &message) |
Set the message. | |
void | setAddressBook (const std::vector< Contact > &addressBook) |
Set the address book, for autocomplete suggestions. | |
std::vector< Contact > | to () const |
Get the To: contacts. | |
std::vector< Contact > | cc () const |
Get the Cc: contacts. | |
std::vector< Contact > | bcc () const |
Get the Bc: contacts. | |
const WString & | subject () const |
Get the subject. | |
std::vector< Attachment > | attachments () const |
Get the list of attachments. | |
const WString & | message () const |
Get the message. | |
Public Attributes | |
Wt::Signal< void > | send |
The message is ready to be sent... | |
Wt::Signal< void > | discard |
The message must be discarded. | |
Private Slots | |
void | attachMore () |
Add an attachment edit. | |
void | removeAttachment (AttachmentEdit *attachment) |
Remove the given attachment edit. | |
void | sendIt () |
Slot attached to the Send button. | |
void | saveNow () |
Slot attached to the Save now button. | |
void | discardIt () |
Slot attached to the Discard button. | |
void | attachmentDone () |
Slotcalled when an attachment has been uploaded. | |
Private Member Functions | |
void | createUi () |
void | saved () |
All attachments have been processed, determine the result of saving the message. | |
void | setStatus (const WString &text, const WString &style) |
Set the status, and apply the given style. | |
Private Attributes | |
WContainerWidget * | layout_ |
WPushButton * | topSendButton_ |
WPushButton * | topSaveNowButton_ |
WPushButton * | topDiscardButton_ |
WPushButton * | botSendButton_ |
WPushButton * | botSaveNowButton_ |
WPushButton * | botDiscardButton_ |
WText * | statusMsg_ |
WTable * | edits_ |
AddresseeEdit * | toEdit_ |
To: Addressees edit. | |
AddresseeEdit * | ccEdit_ |
Cc: Addressees edit. | |
AddresseeEdit * | bccEdit_ |
Bcc: Addressees edit. | |
ContactSuggestions * | contactSuggestions_ |
The suggestions popup for the addressee edits. | |
WLineEdit * | subject_ |
The subject line edit. | |
OptionList * | options_ |
OptionsList for editing Cc or Bcc. | |
Option * | addcc_ |
Option for editing Cc:. | |
Option * | addbcc_ |
Option for editing Bcc:. | |
Option * | attachFile_ |
Option for attaching a file. | |
Option * | attachOtherFile_ |
Option for attaching another file. | |
std::vector< AttachmentEdit * > | attachments_ |
Array which holds all the attachments, including one extra invisible one. | |
WTextArea * | message_ |
WTextArea for the main message. | |
bool | saving_ |
state when waiting asyncrhonously for attachments to be uploaded | |
bool | sending_ |
int | attachmentsPending_ |
number of attachments waiting to be uploaded during saving | |
Friends | |
class | AttachmentEdit |
This widget is part of the Wt composer example.
Definition at line 40 of file Composer.h.
Composer::Composer | ( | WContainerWidget * | parent = 0 |
) |
void Composer::setTo | ( | const std::vector< Contact > & | to | ) |
void Composer::setSubject | ( | const WString & | subject | ) |
void Composer::setMessage | ( | const WString & | message | ) |
void Composer::setAddressBook | ( | const std::vector< Contact > & | addressBook | ) |
std::vector< Contact > Composer::to | ( | ) | const |
std::vector< Contact > Composer::cc | ( | ) | const |
std::vector< Contact > Composer::bcc | ( | ) | const |
const WString & Composer::subject | ( | ) | const |
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.
const WString & Composer::message | ( | ) | const |
void Composer::attachMore | ( | ) | [private, slot] |
void Composer::removeAttachment | ( | AttachmentEdit * | attachment | ) | [private, slot] |
void Composer::sendIt | ( | ) | [private, slot] |
Slot attached to the Send button.
Tries to save the mail message, and if succesfull, sends it.
Definition at line 286 of file Composer.C.
void Composer::saveNow | ( | ) | [private, slot] |
Slot attached to the Save now button.
Tries to save the mail message, and gives feedback on failure and on success.
Definition at line 299 of file Composer.C.
void Composer::discardIt | ( | ) | [private, slot] |
Slot attached to the Discard button.
Discards the current message: emits the discard event.
Definition at line 383 of file Composer.C.
void Composer::attachmentDone | ( | ) | [private, slot] |
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 328 of file Composer.C.
void Composer::createUi | ( | ) | [private] |
Definition at line 92 of file Composer.C.
void Composer::saved | ( | ) | [private] |
All attachments have been processed, determine the result of saving the message.
Definition at line 345 of file Composer.C.
friend class AttachmentEdit [friend] |
Definition at line 195 of file Composer.h.
Wt::Signal<void> Composer::send |
Wt::Signal<void> Composer::discard |
WContainerWidget* Composer::layout_ [private] |
Definition at line 100 of file Composer.h.
WPushButton* Composer::topSendButton_ [private] |
Definition at line 102 of file Composer.h.
WPushButton * Composer::topSaveNowButton_ [private] |
Definition at line 102 of file Composer.h.
WPushButton * Composer::topDiscardButton_ [private] |
Definition at line 102 of file Composer.h.
WPushButton* Composer::botSendButton_ [private] |
Definition at line 103 of file Composer.h.
WPushButton * Composer::botSaveNowButton_ [private] |
Definition at line 103 of file Composer.h.
WPushButton * Composer::botDiscardButton_ [private] |
Definition at line 103 of file Composer.h.
WText* Composer::statusMsg_ [private] |
Definition at line 104 of file Composer.h.
WTable* Composer::edits_ [private] |
Definition at line 106 of file Composer.h.
AddresseeEdit* Composer::toEdit_ [private] |
AddresseeEdit* Composer::ccEdit_ [private] |
AddresseeEdit* Composer::bccEdit_ [private] |
ContactSuggestions* Composer::contactSuggestions_ [private] |
WLineEdit* Composer::subject_ [private] |
OptionList* Composer::options_ [private] |
Option* Composer::addcc_ [private] |
Option* Composer::addbcc_ [private] |
Option* Composer::attachFile_ [private] |
Option* Composer::attachOtherFile_ [private] |
std::vector<AttachmentEdit *> Composer::attachments_ [private] |
Array which holds all the attachments, including one extra invisible one.
Definition at line 134 of file Composer.h.
WTextArea* Composer::message_ [private] |
bool Composer::saving_ [private] |
state when waiting asyncrhonously for attachments to be uploaded
Definition at line 140 of file Composer.h.
bool Composer::sending_ [private] |
Definition at line 140 of file Composer.h.
int Composer::attachmentsPending_ [private] |
number of attachments waiting to be uploaded during saving
Definition at line 143 of file Composer.h.