Main widget of the Composer example.
More...
#include <ComposeExample.h>
Main widget of the Composer example.
Definition at line 25 of file ComposeExample.h.
◆ ComposeExample()
ComposeExample::ComposeExample |
( |
WContainerWidget * |
parent = 0 | ) |
|
create a new Composer example.
Definition at line 21 of file ComposeExample.C.
22 : WContainerWidget(parent)
26 std::vector<Contact> addressBook;
27 addressBook.push_back(
Contact(L
"Koen Deforche",
28 L
"koen.deforche@gmail.com"));
29 addressBook.push_back(
Contact(L
"Koen alias1",
30 L
"koen.alias1@yahoo.com"));
31 addressBook.push_back(
Contact(L
"Koen alias2",
32 L
"koen.alias2@yahoo.com"));
33 addressBook.push_back(
Contact(L
"Koen alias3",
34 L
"koen.alias3@yahoo.com"));
35 addressBook.push_back(
Contact(L
"Bartje",
36 L
"jafar@hotmail.com"));
39 std::vector<Contact> contacts;
40 contacts.push_back(
Contact(L
"Koen Deforche", L
"koen.deforche@gmail.com"));
48 details_ =
new WContainerWidget(
this);
50 new WText(tr(
"example.info"),
details_);
◆ discard()
void ComposeExample::discard |
( |
| ) |
|
|
private |
Definition at line 125 of file ComposeExample.C.
127 WContainerWidget *feedback =
new WContainerWidget(
this);
128 feedback->setStyleClass(
"feedback");
130 WContainerWidget *horiz =
new WContainerWidget(feedback);
131 new WText(
"<p>Wise decision! Everyone's mailbox is already full anyway.</p>",
◆ send()
void ComposeExample::send |
( |
| ) |
|
|
private |
Definition at line 53 of file ComposeExample.C.
55 WContainerWidget *feedback =
new WContainerWidget(
this);
56 feedback->setStyleClass(L
"feedback");
58 WContainerWidget *horiz =
new WContainerWidget(feedback);
59 new WText(L
"<p>We could have, but did not send the following email:</p>",
63 if (!contacts.empty())
64 horiz =
new WContainerWidget(feedback);
65 for (
unsigned i = 0; i < contacts.size(); ++i) {
66 new WText(L
"To: \"" + contacts[i].name + L
"\" <"
67 + contacts[i].email + L
">", PlainText, horiz);
72 if (!contacts.empty())
73 horiz =
new WContainerWidget(feedback);
74 for (
unsigned i = 0; i < contacts.size(); ++i) {
75 new WText(L
"Cc: \"" + contacts[i].name + L
"\" <"
76 + contacts[i].email + L
">", PlainText, horiz);
81 if (!contacts.empty())
82 horiz =
new WContainerWidget(feedback);
83 for (
unsigned i = 0; i < contacts.size(); ++i) {
84 new WText(L
"Bcc: \"" + contacts[i].name + L
"\" <"
85 + contacts[i].email + L
">", PlainText, horiz);
89 horiz =
new WContainerWidget(feedback);
93 if (!attachments.empty())
94 horiz =
new WContainerWidget(feedback);
95 for (
unsigned i = 0; i < attachments.size(); ++i) {
96 new WText(L
"Attachment: \""
97 + attachments[i].fileName
98 + L
"\" (" + attachments[i].contentDescription
99 + L
")", PlainText, horiz);
101 unlink(attachments[i].spoolFileName.c_str());
103 new WText(
", was in spool file: "
104 + attachments[i].spoolFileName, horiz);
110 horiz =
new WContainerWidget(feedback);
111 new WText(
"Message body: ", horiz);
114 if (!message.empty()) {
115 new WText(message, PlainText, horiz);
117 new WText(
"<i>(empty)</i>", horiz);
◆ composer_
◆ details_
WContainerWidget* ComposeExample::details_ |
|
private |
The documentation for this class was generated from the following files: