Wt examples
3.3.8
|
An E-mail composer widget. More...
#include <Composer.h>
Public Member Functions | |
Composer (WContainerWidget *parent=0) | |
Construct a new Composer. More... | |
void | setTo (const std::vector< Contact > &to) |
Set message To: contacts. More... | |
void | setSubject (const WString &subject) |
Set subject. More... | |
void | setMessage (const WString &message) |
Set the message. More... | |
void | setAddressBook (const std::vector< Contact > &addressBook) |
Set the address book, for autocomplete suggestions. More... | |
std::vector< Contact > | to () const |
Get the To: contacts. More... | |
std::vector< Contact > | cc () const |
Get the Cc: contacts. More... | |
std::vector< Contact > | bcc () const |
Get the Bc: contacts. More... | |
const WString & | subject () const |
Get the subject. More... | |
std::vector< Attachment > | attachments () const |
Get the list of attachments. More... | |
const WString & | message () const |
Get the message. More... | |
![]() | |
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< Side > | clearSides () 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 WCssDecorationStyle & | decorationStyle () |
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 WWidget * | find (const std::string &name) |
virtual WWidget * | findById (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(finaloverride) |
virtual void | setScrollVisibilityEnabled (bool enabled) WT_CXX11ONLY(finaloverride) |
virtual int | scrollVisibilityMargin () const WT_CXX11ONLY(finaloverride) |
virtual void | setScrollVisibilityMargin (int margin) WT_CXX11ONLY(finaloverride) |
virtual Signal< bool > & | scrollVisibilityChanged () WT_CXX11ONLY(finaloverride) |
virtual bool | isScrollVisible () const WT_CXX11ONLY(finaloverride) |
virtual void | setThemeStyleEnabled (bool enabled) |
virtual bool | isThemeStyleEnabled () const |
![]() | |
virtual | ~WWidget () |
WWidget * | parent () const |
virtual void | removeChild (WObject *child) |
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 |
![]() | |
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 |
WObject * | parent () const |
Public Attributes | |
Wt::Signal< void > | send |
The message is ready to be sent... More... | |
Wt::Signal< void > | discard |
The message must be discarded. More... | |
Private Member Functions | |
void | attachMore () |
Add an attachment edit. More... | |
void | removeAttachment (AttachmentEdit *attachment) |
Remove the given attachment edit. More... | |
void | sendIt () |
Slot attached to the Send button. More... | |
void | saveNow () |
Slot attached to the Save now button. More... | |
void | discardIt () |
Slot attached to the Discard button. More... | |
void | attachmentDone () |
Slotcalled when an attachment has been uploaded. More... | |
void | createUi () |
void | saved () |
All attachments have been processed, determine the result of saving the message. More... | |
void | setStatus (const WString &text, const WString &style) |
Set the status, and apply the given style. More... | |
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. More... | |
AddresseeEdit * | ccEdit_ |
Cc: Addressees edit. More... | |
AddresseeEdit * | bccEdit_ |
Bcc: Addressees edit. More... | |
ContactSuggestions * | contactSuggestions_ |
The suggestions popup for the addressee edits. More... | |
WLineEdit * | subject_ |
The subject line edit. More... | |
OptionList * | options_ |
OptionsList for editing Cc or Bcc. More... | |
Option * | addcc_ |
Option for editing Cc: More... | |
Option * | addbcc_ |
Option for editing Bcc: More... | |
Option * | attachFile_ |
Option for attaching a file. More... | |
Option * | attachOtherFile_ |
Option for attaching another file. More... | |
std::vector< AttachmentEdit * > | attachments_ |
Array which holds all the attachments, including one extra invisible one. More... | |
WTextArea * | message_ |
WTextArea for the main message. More... | |
bool | saving_ |
state when waiting asyncrhonously for attachments to be uploaded More... | |
bool | sending_ |
int | attachmentsPending_ |
number of attachments waiting to be uploaded during saving More... | |
Friends | |
class | AttachmentEdit |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
![]() | |
static WString | tr (const char *key) |
![]() | |
virtual void | enableAjax () |
void | setImplementation (WWidget *widget) |
WWidget * | implementation () |
virtual int | boxPadding (Orientation orientation) const |
virtual int | boxBorder (Orientation orientation) const |
virtual void | render (WFlags< RenderFlag > flags) |
![]() | |
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 WObject * | sender () |
An E-mail composer widget.
This widget is part of the Wt composer example.
Definition at line 40 of file Composer.h.
Composer::Composer | ( | WContainerWidget * | parent = 0 | ) |
Construct a new Composer.
Definition at line 25 of file Composer.C.
|
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.
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.
|
private |
Add an attachment edit.
Definition at line 249 of file Composer.C.
std::vector< Contact > Composer::bcc | ( | ) | const |
Get the Bc: contacts.
Definition at line 60 of file Composer.C.
std::vector< Contact > Composer::cc | ( | ) | const |
Get the Cc: contacts.
Definition at line 55 of file Composer.C.
|
private |
Definition at line 93 of file Composer.C.
|
private |
Slot attached to the Discard button.
Discards the current message: emits the discard event.
Definition at line 386 of file Composer.C.
const WString & Composer::message | ( | ) | const |
|
private |
Remove the given attachment edit.
Definition at line 264 of file Composer.C.
|
private |
All attachments have been processed, determine the result of saving the message.
Definition at line 348 of file Composer.C.
|
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.
|
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.
void Composer::setAddressBook | ( | const std::vector< Contact > & | addressBook | ) |
Set the address book, for autocomplete suggestions.
Definition at line 65 of file Composer.C.
void Composer::setMessage | ( | const WString & | message | ) |
Set the message.
Definition at line 45 of file Composer.C.
Set the status, and apply the given style.
Definition at line 342 of file Composer.C.
void Composer::setSubject | ( | const WString & | subject | ) |
void Composer::setTo | ( | const std::vector< Contact > & | to | ) |
Set message To: contacts.
Definition at line 35 of file Composer.C.
const WString & Composer::subject | ( | ) | const |
std::vector< Contact > Composer::to | ( | ) | const |
Get the To: contacts.
Definition at line 50 of file Composer.C.
|
friend |
Definition at line 194 of file Composer.h.
|
private |
Option for editing Bcc:
Definition at line 127 of file Composer.h.
|
private |
Option for editing Cc:
Definition at line 125 of file Composer.h.
|
private |
Option for attaching a file.
Definition at line 129 of file Composer.h.
|
private |
Array which holds all the attachments, including one extra invisible one.
Definition at line 134 of file Composer.h.
|
private |
number of attachments waiting to be uploaded during saving
Definition at line 143 of file Composer.h.
|
private |
Option for attaching another file.
Definition at line 131 of file Composer.h.
|
private |
Bcc: Addressees edit.
Definition at line 113 of file Composer.h.
|
private |
Definition at line 103 of file Composer.h.
|
private |
Definition at line 103 of file Composer.h.
|
private |
Definition at line 103 of file Composer.h.
|
private |
Cc: Addressees edit.
Definition at line 111 of file Composer.h.
|
private |
The suggestions popup for the addressee edits.
Definition at line 116 of file Composer.h.
Wt::Signal<void> Composer::discard |
The message must be discarded.
Definition at line 97 of file Composer.h.
|
private |
Definition at line 106 of file Composer.h.
|
private |
Definition at line 100 of file Composer.h.
|
private |
WTextArea for the main message.
Definition at line 137 of file Composer.h.
|
private |
OptionsList for editing Cc or Bcc.
Definition at line 122 of file Composer.h.
|
private |
state when waiting asyncrhonously for attachments to be uploaded
Definition at line 140 of file Composer.h.
Wt::Signal<void> Composer::send |
The message is ready to be sent...
Definition at line 93 of file Composer.h.
|
private |
Definition at line 140 of file Composer.h.
|
private |
Definition at line 104 of file Composer.h.
|
private |
The subject line edit.
Definition at line 119 of file Composer.h.
|
private |
To: Addressees edit.
Definition at line 109 of file Composer.h.
|
private |
Definition at line 102 of file Composer.h.
|
private |
Definition at line 102 of file Composer.h.
|
private |
Definition at line 102 of file Composer.h.