Composer Class Reference
[Composer example]

An E-mail composer widget. More...

#include <Composer.h>

Inheritance diagram for Composer:

Inheritance graph
[legend]

List of all members.

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

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


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 ( WContainerWidget parent = 0  ) 

Construct a new Composer.

Definition at line 25 of file Composer.C.


Member Function Documentation

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

Set message To: contacts.

Definition at line 35 of file Composer.C.

void Composer::setSubject ( const WString subject  ) 

Set subject.

Definition at line 40 of file Composer.C.

void Composer::setMessage ( const WString message  ) 

Set the message.

Definition at line 45 of file Composer.C.

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

Set the address book, for autocomplete suggestions.

Definition at line 65 of file Composer.C.

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

Get the To: contacts.

Definition at line 50 of file Composer.C.

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

Get the Cc: contacts.

Definition at line 55 of file Composer.C.

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

Get the Bc: contacts.

Definition at line 60 of file Composer.C.

const WString & Composer::subject (  )  const

Get the subject.

Definition at line 70 of file Composer.C.

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

Get the message.

Definition at line 87 of file Composer.C.

void Composer::attachMore (  )  [private, slot]

Add an attachment edit.

Definition at line 246 of file Composer.C.

void Composer::removeAttachment ( AttachmentEdit attachment  )  [private, slot]

Remove the given attachment edit.

Definition at line 261 of file Composer.C.

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.

void Composer::setStatus ( const WString text,
const WString style 
) [private]

Set the status, and apply the given style.

Definition at line 339 of file Composer.C.


Friends And Related Function Documentation

friend class AttachmentEdit [friend]

Definition at line 195 of file Composer.h.


Member Data Documentation

Wt::Signal<void> Composer::send

The message is ready to be sent...

Definition at line 93 of file Composer.h.

Wt::Signal<void> Composer::discard

The message must be discarded.

Definition at line 97 of file Composer.h.

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]

To: Addressees edit.

Definition at line 109 of file Composer.h.

AddresseeEdit* Composer::ccEdit_ [private]

Cc: Addressees edit.

Definition at line 111 of file Composer.h.

AddresseeEdit* Composer::bccEdit_ [private]

Bcc: Addressees edit.

Definition at line 113 of file Composer.h.

ContactSuggestions* Composer::contactSuggestions_ [private]

The suggestions popup for the addressee edits.

Definition at line 116 of file Composer.h.

WLineEdit* Composer::subject_ [private]

The subject line edit.

Definition at line 119 of file Composer.h.

OptionList* Composer::options_ [private]

OptionsList for editing Cc or Bcc.

Definition at line 122 of file Composer.h.

Option* Composer::addcc_ [private]

Option for editing Cc:.

Definition at line 125 of file Composer.h.

Option* Composer::addbcc_ [private]

Option for editing Bcc:.

Definition at line 127 of file Composer.h.

Option* Composer::attachFile_ [private]

Option for attaching a file.

Definition at line 129 of file Composer.h.

Option* Composer::attachOtherFile_ [private]

Option for attaching another file.

Definition at line 131 of file Composer.h.

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]

WTextArea for the main message.

Definition at line 137 of file Composer.h.

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.


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 17:06:00 2008 for Wt by doxygen 1.5.3