Wt examples 3.3.12
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Composer Class Reference

An E-mail composer widget. More...

#include <Composer.h>

Inheritance diagram for Composer:
Inheritance graph
[legend]

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< Contactto () const
 Get the To: contacts.
 
std::vector< Contactcc () const
 Get the Cc: contacts.
 
std::vector< Contactbcc () const
 Get the Bc: contacts.
 
const WStringsubject () const
 Get the subject.
 
std::vector< Attachmentattachments () const
 Get the list of attachments.
 
const WStringmessage () const
 Get the message.
 
- Public Member Functions inherited from Wt::WCompositeWidget
 WCompositeWidget (WContainerWidget *parent=0)
 
 WCompositeWidget (WWidget *implementation, WContainerWidget *parent)
 
virtual void setObjectName (const std::string &name)
 
virtual std::string objectName () const
 
virtual const std::string id () const
 
virtual void setPositionScheme (PositionScheme scheme)
 
virtual PositionScheme positionScheme () const
 
virtual void setOffsets (const WLength &offset, WFlags< Side > sides=All)
 
virtual WLength offset (Side s) const
 
virtual void resize (const WLength &width, const WLength &height)
 
virtual WLength width () const
 
virtual WLength height () const
 
virtual void setMinimumSize (const WLength &width, const WLength &height)
 
virtual WLength minimumWidth () const
 
virtual WLength minimumHeight () const
 
virtual void setMaximumSize (const WLength &width, const WLength &height)
 
virtual WLength maximumWidth () const
 
virtual WLength maximumHeight () const
 
virtual void setLineHeight (const WLength &height)
 
virtual WLength lineHeight () const
 
virtual void setFloatSide (Side s)
 
virtual Side floatSide () const
 
virtual void setClearSides (WFlags< Side > sides)
 
virtual WFlags< SideclearSides () const
 
virtual void setMargin (const WLength &margin, WFlags< Side > sides=All)
 
virtual WLength margin (Side side) const
 
virtual void setHiddenKeepsGeometry (bool enabled)
 
virtual bool hiddenKeepsGeometry () const
 
virtual void setHidden (bool hidden, const WAnimation &animation=WAnimation())
 
virtual bool isHidden () const
 
virtual bool isVisible () const
 
virtual void setDisabled (bool disabled)
 
virtual bool isDisabled () const
 
virtual bool isEnabled () const
 
virtual void setPopup (bool popup)
 
virtual bool isPopup () const
 
virtual void setInline (bool isInline)
 
virtual bool isInline () const
 
virtual void setDecorationStyle (const WCssDecorationStyle &style)
 
virtual WCssDecorationStyledecorationStyle ()
 
virtual void setStyleClass (const WString &styleClass)
 
virtual WString styleClass () const
 
virtual void addStyleClass (const WString &styleClass, bool force=false)
 
virtual void removeStyleClass (const WString &styleClass, bool force=false)
 
virtual bool hasStyleClass (const WString &styleClass) const
 
virtual void setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto)
 
virtual AlignmentFlag verticalAlignment () const
 
virtual WLength verticalAlignmentLength () const
 
virtual void setToolTip (const WString &text, TextFormat textFormat=PlainText)
 
virtual WString toolTip () const
 
virtual void setDeferredToolTip (bool enable, TextFormat textFormat=PlainText)
 
virtual void refresh ()
 
virtual void setAttributeValue (const std::string &name, const WString &value)
 
virtual WString attributeValue (const std::string &name) const
 
virtual void setJavaScriptMember (const std::string &name, const std::string &value)
 
virtual std::string javaScriptMember (const std::string &name) const
 
virtual void callJavaScriptMember (const std::string &name, const std::string &args)
 
virtual void load ()
 
virtual bool loaded () const
 
virtual void setCanReceiveFocus (bool enabled)
 
virtual bool canReceiveFocus () const
 
virtual void setFocus (bool focus)
 
virtual bool setFirstFocus ()
 
virtual bool hasFocus () const
 
virtual void setTabIndex (int index)
 
virtual int tabIndex () const
 
virtual void setId (const std::string &id)
 
virtual WWidgetfind (const std::string &name)
 
virtual WWidgetfindById (const std::string &name)
 
virtual void setSelectable (bool selectable)
 
virtual void doJavaScript (const std::string &js)
 
virtual void propagateSetEnabled (bool enabled)
 
virtual bool scrollVisibilityEnabled () const WT_CXX11ONLY(final override)
 
virtual void setScrollVisibilityEnabled (bool enabled) WT_CXX11ONLY(final override)
 
virtual int scrollVisibilityMargin () const WT_CXX11ONLY(final override)
 
virtual void setScrollVisibilityMargin (int margin) WT_CXX11ONLY(final override)
 
virtual Signal< bool > & scrollVisibilityChanged () WT_CXX11ONLY(final override)
 
virtual bool isScrollVisible () const WT_CXX11ONLY(final override)
 
virtual void setThemeStyleEnabled (bool enabled)
 
virtual bool isThemeStyleEnabled () const
 
virtual void removeChild (WObject *child)
 
void setFocus ()
 
virtual void setFocus (bool focus)=0
 
- Public Member Functions inherited from Wt::WWidget
virtual ~WWidget ()
 
WWidgetparent () const
 
void setWidth (const WLength &width)
 
void setHeight (const WLength &height)
 
virtual void positionAt (const WWidget *widget, Orientation orientation=Vertical)
 
virtual void toggleStyleClass (const WString &styleClass, bool add, bool force=false)
 
std::string jsRef () const
 
void setFocus ()
 
virtual void acceptDrops (const std::string &mimeType, const WString &hoverStyleClass=WString())
 
virtual void stopAcceptDrops (const std::string &mimeType)
 
virtual void htmlText (std::ostream &out)
 
bool isRendered () const
 
void hide ()
 
void animateHide (const WAnimation &animation)
 
void show ()
 
void animateShow (const WAnimation &animation)
 
void enable ()
 
void disable ()
 
bool layoutSizeAware () const
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 
virtual ~WObject ()
 
void resetLearnedSlots ()
 
void resetLearnedSlot (void(T::*method)())
 
WStatelessSlot * implementStateless (void(T::*method)())
 
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 
void isNotStateless ()
 
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 
void addChild (WObject *child)
 
const std::vector< WObject * > & children () const
 
WObjectparent () const
 

Public Attributes

Wt::Signal< void > send
 The message is ready to be sent...
 
Wt::Signal< void > discard
 The message must be discarded.
 

Private Member Functions

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.
 
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

WContainerWidgetlayout_
 
WPushButtontopSendButton_
 
WPushButtontopSaveNowButton_
 
WPushButtontopDiscardButton_
 
WPushButtonbotSendButton_
 
WPushButtonbotSaveNowButton_
 
WPushButtonbotDiscardButton_
 
WTextstatusMsg_
 
WTableedits_
 
AddresseeEdittoEdit_
 To: Addressees edit.
 
AddresseeEditccEdit_
 Cc: Addressees edit.
 
AddresseeEditbccEdit_
 Bcc: Addressees edit.
 
ContactSuggestionscontactSuggestions_
 The suggestions popup for the addressee edits.
 
WLineEditsubject_
 The subject line edit.
 
OptionListoptions_
 OptionsList for editing Cc or Bcc.
 
Optionaddcc_
 Option for editing Cc:
 
Optionaddbcc_
 Option for editing Bcc:
 
OptionattachFile_
 Option for attaching a file.
 
OptionattachOtherFile_
 Option for attaching another file.
 
std::vector< AttachmentEdit * > attachments_
 Array which holds all the attachments, including one extra invisible one.
 
WTextAreamessage_
 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
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 
- Static Public Member Functions inherited from Wt::WWidget
static WString tr (const char *key)
 
- Protected Member Functions inherited from Wt::WCompositeWidget
virtual void enableAjax ()
 
void setImplementation (WWidget *widget)
 
WWidgetimplementation ()
 
virtual int boxPadding (Orientation orientation) const
 
virtual int boxBorder (Orientation orientation) const
 
virtual void render (WFlags< RenderFlag > flags)
 
- Protected Member Functions inherited from Wt::WWidget
void setLayoutSizeAware (bool sizeAware)
 
virtual void layoutSizeChanged (int width, int height)
 
 WWidget (WContainerWidget *parent=0)
 
virtual void dropEvent (WDropEvent dropEvent)
 
void scheduleRender (WFlags< RepaintFlag > flags=0)
 
virtual WStatelessSlot * getStateless (Method method)
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 

Detailed Description

An E-mail composer widget.

This widget is part of the Wt composer example.

Definition at line 40 of file Composer.h.

Constructor & Destructor Documentation

◆ Composer()

Composer::Composer ( WContainerWidget parent = 0)

Construct a new Composer.

Definition at line 25 of file Composer.C.

27 saving_(false),
28 sending_(false)
29{
31
32 createUi();
33}
bool saving_
state when waiting asyncrhonously for attachments to be uploaded
Definition Composer.h:140
bool sending_
Definition Composer.h:140
WContainerWidget * layout_
Definition Composer.h:100
void createUi()
Definition Composer.C:93
void setImplementation(WWidget *widget)
WWidget * parent() const

Member Function Documentation

◆ 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.

332{
333 if (saving_) {
335 std::cerr << "Attachments still: " << attachmentsPending_ << std::endl;
336
337 if (attachmentsPending_ == 0)
338 saved();
339 }
340}
void saved()
All attachments have been processed, determine the result of saving the message.
Definition Composer.C:348
int attachmentsPending_
number of attachments waiting to be uploaded during saving
Definition Composer.h:143

◆ 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.

76{
77 std::vector<Attachment> attachments;
78
79 for (unsigned i = 0; i < attachments_.size() - 1; ++i) {
80 std::vector<Attachment> toadd = attachments_[i]->attachments();
81
82 attachments.insert(attachments.end(), toadd.begin(), toadd.end());
83 }
84
85 return attachments;
86}
std::vector< AttachmentEdit * > attachments_
Array which holds all the attachments, including one extra invisible one.
Definition Composer.h:134
std::vector< Attachment > attachments() const
Get the list of attachments.
Definition Composer.C:75

◆ attachMore()

void Composer::attachMore ( )
private

Add an attachment edit.

Definition at line 249 of file Composer.C.

250{
251 /*
252 * Create and append the next AttachmentEdit, that will be hidden.
253 */
254 AttachmentEdit *edit = new AttachmentEdit(this);
256 attachments_.push_back(edit);
257 attachments_.back()->hide();
258
259 // Connect the attachOtherFile_ option to show this attachment.
261 .connect(attachments_.back(), &WWidget::show);
262}
An edit field for an email attachment.
Option * attachOtherFile_
Option for attaching another file.
Definition Composer.h:131
WTable * edits_
Definition Composer.h:106
friend class AttachmentEdit
Definition Composer.h:194
WInteractWidget * item()
Returns the clickable part.
Definition Option.h:44
virtual void insertBefore(WWidget *widget, WWidget *before)
EventSignal< WMouseEvent > & clicked()
WTableCell * elementAt(int row, int column)

◆ bcc()

std::vector< Contact > Composer::bcc ( ) const

Get the Bc: contacts.

Definition at line 60 of file Composer.C.

61{
62 return bccEdit_->addressees();
63}
std::vector< Contact > addressees() const
Get a list of addressees.
AddresseeEdit * bccEdit_
Bcc: Addressees edit.
Definition Composer.h:113

◆ cc()

std::vector< Contact > Composer::cc ( ) const

Get the Cc: contacts.

Definition at line 55 of file Composer.C.

56{
57 return ccEdit_->addressees();
58}
AddresseeEdit * ccEdit_
Cc: Addressees edit.
Definition Composer.h:111

◆ createUi()

void Composer::createUi ( )
private

Definition at line 93 of file Composer.C.

94{
95 setStyleClass("darker");
96
97 // horizontal layout container, used for top and bottom buttons.
98 WContainerWidget *horiz;
99
100 /*
101 * Top buttons
102 */
103 horiz = new WContainerWidget(layout_);
104 horiz->setPadding(5);
105 topSendButton_ = new WPushButton(tr("msg.send"), horiz);
106 topSendButton_->setStyleClass("default"); // default action
107 topSaveNowButton_ = new WPushButton(tr("msg.savenow"), horiz);
108 topDiscardButton_ = new WPushButton(tr("msg.discard"), horiz);
109
110 // Text widget which shows status messages, next to the top buttons.
111 statusMsg_ = new WText(horiz);
113
114 /*
115 * To, Cc, Bcc, Subject, Attachments
116 *
117 * They are organized in a two-column table: left column for
118 * labels, and right column for the edit.
119 */
120 edits_ = new WTable(layout_);
121 edits_->setStyleClass("lighter");
125
126 /*
127 * To, Cc, Bcc
128 */
129 toEdit_ = new AddresseeEdit(tr("msg.to"), edits_->elementAt(0, 1),
130 edits_->elementAt(0, 0));
131 // add some space above To:
132 edits_->elementAt(0, 1)->setMargin(5, Top);
133 ccEdit_ = new AddresseeEdit(tr("msg.cc"), edits_->elementAt(1, 1),
134 edits_->elementAt(1, 0));
135 bccEdit_ = new AddresseeEdit(tr("msg.bcc"), edits_->elementAt(2, 1),
136 edits_->elementAt(2, 0));
137
138 ccEdit_->hide();
139 bccEdit_->hide();
140
141 /*
142 * Addressbook suggestions popup
143 */
145
149
150 /*
151 * We use an OptionList widget to show the expand options for
152 * ccEdit_ and bccEdit_ nicely next to each other, separated
153 * by pipe characters.
154 */
155 options_ = new OptionList(edits_->elementAt(3, 1));
156
157 options_->add(addcc_ = new Option(tr("msg.addcc")));
158 options_->add(addbcc_ = new Option(tr("msg.addbcc")));
159
160 /*
161 * Subject
162 */
163 new Label(tr("msg.subject"), edits_->elementAt(4, 0));
164 subject_ = new WLineEdit(edits_->elementAt(4, 1));
166
167 /*
168 * Attachments
169 */
170 new WImage("icons/paperclip.png", edits_->elementAt(5, 0));
172 edits_->elementAt(5, 0)->setPadding(3);
173
174 // Attachment edits: we always have the next attachmentedit ready
175 // but hidden. This improves the response time, since the show()
176 // and hide() slots are stateless.
177 attachments_.push_back(new AttachmentEdit(this, edits_->elementAt(5, 1)));
178 attachments_.back()->hide();
179
180 /*
181 * Two options for attaching files. The first does not say 'another'.
182 */
183 attachFile_ = new Option(tr("msg.attachfile"),
184 edits_->elementAt(5, 1));
185 attachOtherFile_ = new Option(tr("msg.attachanother"),
186 edits_->elementAt(5, 1));
188
189 /*
190 * Message
191 */
193 message_->setColumns(80);
194 message_->setRows(10); // should be 20, but let's keep it smaller
195 message_->setMargin(10);
196
197 /*
198 * Bottom buttons
199 */
200 horiz = new WContainerWidget(layout_);
201 horiz->setPadding(5);
202 botSendButton_ = new WPushButton(tr("msg.send"), horiz);
203 botSendButton_->setStyleClass("default");
204 botSaveNowButton_ = new WPushButton(tr("msg.savenow"), horiz);
205 botDiscardButton_ = new WPushButton(tr("msg.discard"), horiz);
206
207 /*
208 * Button events.
209 */
210 topSendButton_->clicked().connect(this, &Composer::sendIt);
211 botSendButton_->clicked().connect(this, &Composer::sendIt);
216
217 /*
218 * Option events to show the cc or Bcc edit.
219 *
220 * Clicking on the option should both show the corresponding edit, and
221 * hide the option itself.
222 */
223 addcc_->item()->clicked().connect(ccEdit_, &WWidget::show);
224 addcc_->item()->clicked().connect(addcc_, &WWidget::hide);
227
228 addbcc_->item()->clicked().connect(bccEdit_, &WWidget::show);
229 addbcc_->item()->clicked().connect(addbcc_, &WWidget::hide);
232
233 /*
234 * Option event to attach the first attachment.
235 *
236 * We show the first attachment, and call attachMore() to prepare the
237 * next attachment edit that will be hidden.
238 *
239 * In addition, we need to show the 'attach More' option, and hide the
240 * 'attach' option.
241 */
242 attachFile_->item()->clicked().connect(attachments_.back(), &WWidget::show);
245 attachFile_->item()->clicked().connect(this, &Composer::attachMore);
247}
An edit field for an email addressee.
WPushButton * botSaveNowButton_
Definition Composer.h:103
void sendIt()
Slot attached to the Send button.
Definition Composer.C:289
WText * statusMsg_
Definition Composer.h:104
WTextArea * message_
WTextArea for the main message.
Definition Composer.h:137
WPushButton * topSaveNowButton_
Definition Composer.h:102
WPushButton * topSendButton_
Definition Composer.h:102
AddresseeEdit * toEdit_
To: Addressees edit.
Definition Composer.h:109
void discardIt()
Slot attached to the Discard button.
Definition Composer.C:386
void attachMore()
Add an attachment edit.
Definition Composer.C:249
void saveNow()
Slot attached to the Save now button.
Definition Composer.C:302
WPushButton * botSendButton_
Definition Composer.h:103
WLineEdit * subject_
The subject line edit.
Definition Composer.h:119
WPushButton * topDiscardButton_
Definition Composer.h:102
ContactSuggestions * contactSuggestions_
The suggestions popup for the addressee edits.
Definition Composer.h:116
Option * attachFile_
Option for attaching a file.
Definition Composer.h:129
WPushButton * botDiscardButton_
Definition Composer.h:103
Option * addbcc_
Option for editing Bcc:
Definition Composer.h:127
Option * addcc_
Option for editing Cc:
Definition Composer.h:125
OptionList * options_
OptionsList for editing Cc or Bcc.
Definition Composer.h:122
A suggestion popup suggesting contacts from an addressbook.
A label.
Definition Label.h:25
A list of options, separated by '|'.
Definition OptionList.h:41
void add(Option *option)
Add an Option to the list.
Definition OptionList.C:18
void update()
Updates the stateless implementations after an Option has been hidden or shown.
Definition OptionList.C:30
A clickable option.
Definition Option.h:32
virtual void setStyleClass(const WString &styleClass)
void setContentAlignment(WFlags< AlignmentFlag > contentAlignment)
void setPadding(const WLength &padding, WFlags< Side > sides=All)
static WLength Auto
void forEdit(WFormWidget *edit, WFlags< PopupTrigger > popupTriggers=Editing)
void setRows(int rows)
void setColumns(int cols)
virtual void resize(const WLength &width, const WLength &height)
virtual void setMargin(const WLength &margin, WFlags< Side > sides=All)
virtual void setStyleClass(const WString &styleClass)
void setFocus()
static WString tr(const char *key)
AlignTop
AlignRight

◆ 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.

387{
388 discard.emit();
389}
Wt::Signal< void > discard
The message must be discarded.
Definition Composer.h:97
void emit(A1 a1=NoClass::none, A2 a2=NoClass::none, A3 a3=NoClass::none, A4 a4=NoClass::none, A5 a5=NoClass::none, A6 a6=NoClass::none) const

◆ message()

const WString & Composer::message ( ) const

Get the message.

Definition at line 88 of file Composer.C.

89{
90 return message_->text();
91}
const WString & text() const

◆ removeAttachment()

void Composer::removeAttachment ( AttachmentEdit attachment)
private

Remove the given attachment edit.

Definition at line 264 of file Composer.C.

265{
266 /*
267 * Remove the given attachment from the attachments list.
268 */
269 std::vector<AttachmentEdit *>::iterator i
270 = std::find(attachments_.begin(), attachments_.end(), attachment);
271
272 if (i != attachments_.end()) {
273 attachments_.erase(i);
274 delete attachment;
275
276 if (attachments_.size() == 1) {
277 /*
278 * This was the last visible attachment, thus, we should switch
279 * the option control again.
280 */
282 attachFile_->show();
284 .connect(attachments_.back(), &WWidget::show);
285 }
286 }
287}

◆ saved()

void Composer::saved ( )
private

All attachments have been processed, determine the result of saving the message.

Definition at line 348 of file Composer.C.

349{
350 /*
351 * All attachments have been processed.
352 */
353
354 bool attachmentsFailed = false;
355 for (unsigned i = 0; i < attachments_.size() - 1; ++i)
356 if (attachments_[i]->uploadFailed()) {
357 attachmentsFailed = true;
358 break;
359 }
360
361 if (attachmentsFailed) {
362 setStatus(tr("msg.attachment.failed"), "error");
363 } else {
364#ifndef WIN32
365 time_t t = time(0);
366 struct tm td;
367 gmtime_r(&t, &td);
368 char buffer[100];
369 strftime(buffer, 100, "%H:%M", &td);
370#else
371 char buffer[] = "server"; // Should fix this; for now just make sense
372#endif
373 setStatus(tr("msg.ok"), "status");
374 statusMsg_->setText(std::string("Draft saved at ") + buffer);
375
376 if (sending_) {
377 send.emit();
378 return;
379 }
380 }
381
382 saving_ = false;
383 sending_ = false;
384}
void setStatus(const WString &text, const WString &style)
Set the status, and apply the given style.
Definition Composer.C:342
Wt::Signal< void > send
The message is ready to be sent...
Definition Composer.h:93
bool setText(const WString &text)

◆ 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.

303{
304 if (!saving_) {
305 saving_ = true;
306
307 /*
308 * Check if any attachments still need to be uploaded.
309 * This may be the case when fileupload change events could not
310 * be caught (for example in Konqueror).
311 */
313
314 for (unsigned i = 0; i < attachments_.size() - 1; ++i) {
315 if (attachments_[i]->uploadNow()) {
317
318 // this will trigger attachmentDone() when done, see
319 // the AttachmentEdit constructor.
320 }
321 }
322
323 std::cerr << "Attachments pending: " << attachmentsPending_ << std::endl;
325 setStatus(tr("msg.uploading"), "status");
326 else
327 saved();
328 }
329}

◆ 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.

290{
291 if (!sending_) {
292 sending_ = true;
293
294 /*
295 * First save -- this will check for the sending_ state
296 * signal if successfull.
297 */
298 saveNow();
299 }
300}

◆ setAddressBook()

void Composer::setAddressBook ( const std::vector< Contact > &  addressBook)

Set the address book, for autocomplete suggestions.

Definition at line 65 of file Composer.C.

66{
68}
void setAddressBook(const std::vector< Contact > &contacts)
Set the address book.

◆ setMessage()

void Composer::setMessage ( const WString message)

Set the message.

Definition at line 45 of file Composer.C.

46{
48}
const WString & message() const
Get the message.
Definition Composer.C:88
virtual void setText(const WString &text)

◆ 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.

343{
344 statusMsg_->setText(text);
346}

◆ setSubject()

void Composer::setSubject ( const WString subject)

Set subject.

Definition at line 40 of file Composer.C.

41{
43}
const WString & subject() const
Get the subject.
Definition Composer.C:70
virtual void setText(const WString &text)

◆ setTo()

void Composer::setTo ( const std::vector< Contact > &  to)

Set message To: contacts.

Definition at line 35 of file Composer.C.

36{
38}
void setAddressees(const std::vector< Contact > &contacts)
Set a list of addressees.
std::vector< Contact > to() const
Get the To: contacts.
Definition Composer.C:50

◆ subject()

const WString & Composer::subject ( ) const

Get the subject.

Definition at line 70 of file Composer.C.

71{
72 return subject_->text();
73}
const WString & text() const

◆ to()

std::vector< Contact > Composer::to ( ) const

Get the To: contacts.

Definition at line 50 of file Composer.C.

51{
52 return toEdit_->addressees();
53}

Friends And Related Symbol Documentation

◆ AttachmentEdit

friend class AttachmentEdit
friend

Definition at line 194 of file Composer.h.

Member Data Documentation

◆ addbcc_

Option* Composer::addbcc_
private

Option for editing Bcc:

Definition at line 127 of file Composer.h.

◆ addcc_

Option* Composer::addcc_
private

Option for editing Cc:

Definition at line 125 of file Composer.h.

◆ attachFile_

Option* Composer::attachFile_
private

Option for attaching a file.

Definition at line 129 of file Composer.h.

◆ attachments_

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.

◆ 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

Option for attaching another file.

Definition at line 131 of file Composer.h.

◆ bccEdit_

AddresseeEdit* Composer::bccEdit_
private

Bcc: Addressees edit.

Definition at line 113 of file Composer.h.

◆ botDiscardButton_

WPushButton * Composer::botDiscardButton_
private

Definition at line 103 of file Composer.h.

◆ botSaveNowButton_

WPushButton * Composer::botSaveNowButton_
private

Definition at line 103 of file Composer.h.

◆ botSendButton_

WPushButton* Composer::botSendButton_
private

Definition at line 103 of file Composer.h.

◆ ccEdit_

AddresseeEdit* Composer::ccEdit_
private

Cc: Addressees edit.

Definition at line 111 of file Composer.h.

◆ contactSuggestions_

ContactSuggestions* Composer::contactSuggestions_
private

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_

WTable* Composer::edits_
private

Definition at line 106 of file Composer.h.

◆ layout_

WContainerWidget* Composer::layout_
private

Definition at line 100 of file Composer.h.

◆ message_

WTextArea* Composer::message_
private

WTextArea for the main message.

Definition at line 137 of file Composer.h.

◆ options_

OptionList* Composer::options_
private

OptionsList for editing Cc or Bcc.

Definition at line 122 of file Composer.h.

◆ saving_

bool Composer::saving_
private

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_

bool Composer::sending_
private

Definition at line 140 of file Composer.h.

◆ statusMsg_

WText* Composer::statusMsg_
private

Definition at line 104 of file Composer.h.

◆ subject_

WLineEdit* Composer::subject_
private

The subject line edit.

Definition at line 119 of file Composer.h.

◆ toEdit_

AddresseeEdit* Composer::toEdit_
private

To: Addressees edit.

Definition at line 109 of file Composer.h.

◆ topDiscardButton_

WPushButton * Composer::topDiscardButton_
private

Definition at line 102 of file Composer.h.

◆ topSaveNowButton_

WPushButton * Composer::topSaveNowButton_
private

Definition at line 102 of file Composer.h.

◆ topSendButton_

WPushButton* Composer::topSendButton_
private

Definition at line 102 of file Composer.h.


The documentation for this class was generated from the following files:

Generated on Fri May 17 2024 for the C++ Web Toolkit (Wt) by doxygen 1.9.8