Wt examples
3.7.1
|
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 () | |
WCompositeWidget (std::unique_ptr< WWidget > implementation) | |
virtual std::vector< WWidget *> | children () const override |
virtual std::unique_ptr< WWidget > | removeWidget (WWidget *widget) override |
virtual void | setObjectName (const std::string &name) override |
virtual std::string | objectName () const override |
virtual const std::string | id () const override |
virtual void | setPositionScheme (PositionScheme scheme) override |
virtual PositionScheme | positionScheme () const override |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=AllSides) override |
virtual WLength | offset (Side s) const override |
virtual void | resize (const WLength &width, const WLength &height) override |
virtual WLength | width () const override |
virtual WLength | height () const override |
virtual void | setMinimumSize (const WLength &width, const WLength &height) override |
virtual WLength | minimumWidth () const override |
virtual WLength | minimumHeight () const override |
virtual void | setMaximumSize (const WLength &width, const WLength &height) override |
virtual WLength | maximumWidth () const override |
virtual WLength | maximumHeight () const override |
virtual void | setLineHeight (const WLength &height) override |
virtual WLength | lineHeight () const override |
virtual void | setFloatSide (Side s) override |
virtual Side | floatSide () const override |
virtual void | setClearSides (WFlags< Side > sides) override |
virtual WFlags< Side > | clearSides () const override |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=AllSides) override |
virtual WLength | margin (Side side) const override |
virtual void | setHiddenKeepsGeometry (bool enabled) override |
virtual bool | hiddenKeepsGeometry () const override |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) override |
virtual bool | isHidden () const override |
virtual bool | isVisible () const override |
virtual void | setDisabled (bool disabled) override |
virtual bool | isDisabled () const override |
virtual bool | isEnabled () const override |
virtual void | setPopup (bool popup) override |
virtual bool | isPopup () const override |
virtual void | setInline (bool isInline) override |
virtual bool | isInline () const override |
virtual void | setDecorationStyle (const WCssDecorationStyle &style) override |
virtual WCssDecorationStyle & | decorationStyle () override |
virtual void | setStyleClass (const WString &styleClass) override |
virtual WString | styleClass () const override |
virtual void | addStyleClass (const WString &styleClass, bool force=false) override |
virtual void | removeStyleClass (const WString &styleClass, bool force=false) override |
virtual bool | hasStyleClass (const WString &styleClass) const override |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto) override |
virtual AlignmentFlag | verticalAlignment () const override |
virtual WLength | verticalAlignmentLength () const override |
virtual void | setToolTip (const WString &text, TextFormat textFormat=TextFormat::Plain) override |
virtual WString | toolTip () const override |
virtual void | setDeferredToolTip (bool enable, TextFormat textFormat=TextFormat::Plain) override |
virtual void | refresh () override |
virtual void | setAttributeValue (const std::string &name, const WString &value) override |
virtual WString | attributeValue (const std::string &name) const override |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value) override |
virtual std::string | javaScriptMember (const std::string &name) const override |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args) override |
virtual void | load () override |
virtual bool | loaded () const override |
virtual void | setCanReceiveFocus (bool enabled) override |
virtual bool | canReceiveFocus () const override |
virtual void | setFocus (bool focus) override |
virtual bool | setFirstFocus () override |
virtual bool | hasFocus () const override |
virtual void | setTabIndex (int index) override |
virtual int | tabIndex () const override |
virtual void | setId (const std::string &id) override |
virtual WWidget * | find (const std::string &name) override |
virtual WWidget * | findById (const std::string &name) override |
virtual void | setSelectable (bool selectable) override |
virtual void | doJavaScript (const std::string &js) override |
virtual void | propagateSetEnabled (bool enabled) override |
virtual bool | scrollVisibilityEnabled () const final override |
virtual void | setScrollVisibilityEnabled (bool enabled) final override |
virtual int | scrollVisibilityMargin () const final override |
virtual void | setScrollVisibilityMargin (int margin) final override |
virtual Signal< bool > & | scrollVisibilityChanged () final override |
virtual bool | isScrollVisible () const final override |
virtual void | setThemeStyleEnabled (bool enabled) final override |
virtual bool | isThemeStyleEnabled () const final override |
![]() | |
virtual | ~WWidget () |
WWidget * | parent () const |
std::unique_ptr< Widget > | removeWidget (Widget *widget) |
std::unique_ptr< WWidget > | removeFromParent () |
void | setWidth (const WLength &width) |
void | setHeight (const WLength &height) |
virtual void | positionAt (const WWidget *widget, Orientation 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 |
![]() | |
void | addChild (std::unique_ptr< WObject > child) |
Child * | addChild (std::unique_ptr< Child > child) |
std::unique_ptr< WObject > | removeChild (WObject *child) |
std::unique_ptr< Child > | removeChild (Child *child) |
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) |
![]() | |
observable () noexcept | |
virtual | ~observable () |
auto | bindSafe (void(C::*method)(Args...)) noexcept |
auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
auto | bindSafe (const Function &function) noexcept |
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 () override |
void | setImplementation (std::unique_ptr< WWidget > widget) |
Widget * | setImplementation (std::unique_ptr< Widget > widget) |
W * | setNewImplementation (Args &&... args) |
WWidget * | implementation () |
virtual int | boxPadding (Orientation orientation) const override |
virtual int | boxBorder (Orientation orientation) const override |
virtual void | render (WFlags< RenderFlag > flags) override |
![]() | |
void | setLayoutSizeAware (bool sizeAware) |
virtual void | layoutSizeChanged (int width, int height) |
WWidget () | |
virtual void | dropEvent (WDropEvent dropEvent) |
void | scheduleRender (WFlags< RepaintFlag > flags=None) |
virtual WStatelessSlot * | getStateless (Method method) override |
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 26 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 332 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 76 of file Composer.C.
|
private |
Add an attachment edit.
Definition at line 250 of file Composer.C.
std::vector< Contact > Composer::bcc | ( | ) | const |
Get the Bc: contacts.
Definition at line 61 of file Composer.C.
std::vector< Contact > Composer::cc | ( | ) | const |
Get the Cc: contacts.
Definition at line 56 of file Composer.C.
|
private |
Definition at line 94 of file Composer.C.
|
private |
Slot attached to the Discard button.
Discards the current message: emits the discard event.
Definition at line 379 of file Composer.C.
const WString & Composer::message | ( | ) | const |
|
private |
Remove the given attachment edit.
Definition at line 265 of file Composer.C.
|
private |
All attachments have been processed, determine the result of saving the message.
Definition at line 349 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 303 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 290 of file Composer.C.
void Composer::setAddressBook | ( | const std::vector< Contact > & | addressBook | ) |
Set the address book, for autocomplete suggestions.
Definition at line 66 of file Composer.C.
void Composer::setMessage | ( | const WString & | message | ) |
Set the message.
Definition at line 46 of file Composer.C.
Set the status, and apply the given style.
Definition at line 343 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 36 of file Composer.C.
const WString & Composer::subject | ( | ) | const |
std::vector< Contact > Composer::to | ( | ) | const |
Get the To: contacts.
Definition at line 51 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.