Main widget of the Composer example. More...
#include <ComposeExample.h>
Public Member Functions | |
ComposeExample (WContainerWidget *parent=0) | |
create a new Composer example. | |
Private Slots | |
void | send () |
void | discard () |
Private Attributes | |
Composer * | composer_ |
WContainerWidget * | details_ |
Main widget of the Composer example.
Definition at line 25 of file ComposeExample.h.
ComposeExample::ComposeExample | ( | WContainerWidget * | parent = 0 ) |
create a new Composer example.
void ComposeExample::discard | ( | ) | [private, slot] |
Definition at line 126 of file ComposeExample.C.
{ WContainerWidget *feedback = new WContainerWidget(this); feedback->setStyleClass("feedback"); WContainerWidget *horiz = new WContainerWidget(feedback); new WText("<p>Wise decision! Everyone's mailbox is already full anyway.</p>", horiz); delete composer_; delete details_; wApp->quit(); }
void ComposeExample::send | ( | ) | [private, slot] |
Definition at line 53 of file ComposeExample.C.
{ WContainerWidget *feedback = new WContainerWidget(this); feedback->setStyleClass(L"feedback"); WContainerWidget *horiz = new WContainerWidget(feedback); new WText(L"<p>We could have, but did not send the following email:</p>", horiz); std::vector<Contact> contacts = composer_->to(); if (!contacts.empty()) horiz = new WContainerWidget(feedback); for (unsigned i = 0; i < contacts.size(); ++i) { new WText(L"To: \"" + contacts[i].name + L"\" <" + contacts[i].email + L">", PlainText, horiz); new WBreak(horiz); } contacts = composer_->cc(); if (!contacts.empty()) horiz = new WContainerWidget(feedback); for (unsigned i = 0; i < contacts.size(); ++i) { new WText(L"Cc: \"" + contacts[i].name + L"\" <" + contacts[i].email + L">", PlainText, horiz); new WBreak(horiz); } contacts = composer_->bcc(); if (!contacts.empty()) horiz = new WContainerWidget(feedback); for (unsigned i = 0; i < contacts.size(); ++i) { new WText(L"Bcc: \"" + contacts[i].name + L"\" <" + contacts[i].email + L">", PlainText, horiz); new WBreak(horiz); } horiz = new WContainerWidget(feedback); WText *t = new WText("Subject: \"" + composer_->subject() + "\"", PlainText, horiz); std::vector<Attachment> attachments = composer_->attachments(); if (!attachments.empty()) horiz = new WContainerWidget(feedback); for (unsigned i = 0; i < attachments.size(); ++i) { new WText(L"Attachment: \"" + attachments[i].fileName + L"\" (" + attachments[i].contentDescription + L")", PlainText, horiz); unlink(attachments[i].spoolFileName.c_str()); new WText(", was in spool file: " + attachments[i].spoolFileName, horiz); new WBreak(horiz); } std::wstring message = composer_->message(); horiz = new WContainerWidget(feedback); t = new WText("Message body: ", horiz); new WBreak(horiz); if (!message.empty()) { t = new WText(message, PlainText, horiz); } else t = new WText("<i>(empty)</i>", horiz); delete composer_; delete details_; wApp->quit(); }
Composer* ComposeExample::composer_ [private] |
Definition at line 33 of file ComposeExample.h.
WContainerWidget* ComposeExample::details_ [private] |
Definition at line 34 of file ComposeExample.h.