Wt examples
3.3.1
|
An edit field for an email attachment. More...
#include <AttachmentEdit.h>
Classes | |
class | UploadInfo |
Public Member Functions | |
AttachmentEdit (Composer *composer, WContainerWidget *parent=0) | |
Creates an attachment edit field. More... | |
bool | uploadNow () |
Updates the file now. More... | |
bool | uploadFailed () const |
Returns whether the upload failed. More... | |
std::vector< Attachment > | attachments () |
Returns the attachment. More... | |
Signal< void > & | uploadDone () |
Signal emitted when new attachment(s) have been uploaded (or failed to upload. More... | |
![]() | |
virtual void | setPositionScheme (PositionScheme scheme)=0 |
virtual PositionScheme | positionScheme () const =0 |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=All)=0 |
virtual WLength | offset (Side side) const =0 |
virtual void | resize (const WLength &width, const WLength &height) |
virtual WLength | width () const =0 |
virtual WLength | height () const =0 |
virtual void | setMinimumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | minimumWidth () const =0 |
virtual WLength | minimumHeight () const =0 |
virtual void | setMaximumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | maximumWidth () const =0 |
virtual WLength | maximumHeight () const =0 |
virtual void | setLineHeight (const WLength &height)=0 |
virtual WLength | lineHeight () const =0 |
virtual void | setFloatSide (Side s)=0 |
virtual Side | floatSide () const =0 |
virtual void | setClearSides (WFlags< Side > sides)=0 |
virtual WFlags< Side > | clearSides () const =0 |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=All)=0 |
virtual WLength | margin (Side side) const =0 |
virtual void | setHiddenKeepsGeometry (bool enabled)=0 |
virtual bool | hiddenKeepsGeometry () const =0 |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation())=0 |
virtual bool | isHidden () const =0 |
virtual bool | isVisible () const =0 |
virtual void | setDisabled (bool disabled)=0 |
virtual bool | isDisabled () const =0 |
virtual bool | isEnabled () const =0 |
virtual void | setPopup (bool popup)=0 |
virtual bool | isPopup () const =0 |
virtual void | setInline (bool inlined)=0 |
virtual bool | isInline () const =0 |
virtual void | setDecorationStyle (const WCssDecorationStyle &style)=0 |
virtual WCssDecorationStyle & | decorationStyle ()=0 |
virtual void | setStyleClass (const WString &styleClass)=0 |
virtual WString | styleClass () const =0 |
virtual void | addStyleClass (const WString &styleClass, bool force=false)=0 |
virtual void | removeStyleClass (const WString &styleClass, bool force=false)=0 |
virtual bool | hasStyleClass (const WString &styleClass) const =0 |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto)=0 |
virtual AlignmentFlag | verticalAlignment () const =0 |
virtual WLength | verticalAlignmentLength () const =0 |
virtual void | setToolTip (const WString &text, TextFormat textFormat=PlainText)=0 |
virtual const WString & | toolTip () const =0 |
virtual void | refresh () |
virtual void | setAttributeValue (const std::string &name, const WString &value)=0 |
virtual WString | attributeValue (const std::string &name) const =0 |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value)=0 |
virtual std::string | javaScriptMember (const std::string &name) const =0 |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args)=0 |
virtual void | load ()=0 |
virtual bool | loaded () const =0 |
virtual void | setTabIndex (int index)=0 |
virtual int | tabIndex () const =0 |
virtual void | setId (const std::string &id)=0 |
virtual WWidget * | find (const std::string &name)=0 |
virtual void | setSelectable (bool selectable)=0 |
virtual void | doJavaScript (const std::string &js)=0 |
Private Member Functions | |
void | uploaded () |
Slot triggered when the WFileUpload completed an upload. More... | |
void | fileTooLarge (::int64_t size) |
Slot triggered when the WFileUpload received an oversized file. More... | |
void | remove () |
Slot triggered when the users wishes to remove this attachment edit. More... | |
Private Attributes | |
Composer * | composer_ |
Signal< void > | uploadDone_ |
WFileUpload * | upload_ |
The WFileUpload control. More... | |
std::vector< UploadInfo * > | uploadInfo_ |
WText * | error_ |
The text box to display an error (empty or too big file) More... | |
Option * | remove_ |
The option to cancel the file upload. More... | |
bool | uploadFailed_ |
The state of the last upload process. More... | |
Additional Inherited Members | |
![]() | |
virtual void | enableAjax ()=0 |
virtual void | propagateSetEnabled (bool enabled)=0 |
virtual void | render (WFlags< RenderFlag > flags) |
An edit field for an email attachment.
This widget managements one attachment edit: it shows a file upload control, handles the upload, and gives feed-back on the file uploaded.
This widget is part of the Wt composer example.
Definition at line 37 of file AttachmentEdit.h.
AttachmentEdit::AttachmentEdit | ( | Composer * | composer, |
WContainerWidget * | parent = 0 |
||
) |
Creates an attachment edit field.
Definition at line 71 of file AttachmentEdit.C.
std::vector< Attachment > AttachmentEdit::attachments | ( | ) |
Returns the attachment.
Definition at line 191 of file AttachmentEdit.C.
|
private |
Slot triggered when the WFileUpload received an oversized file.
Definition at line 178 of file AttachmentEdit.C.
|
private |
Slot triggered when the users wishes to remove this attachment edit.
Definition at line 173 of file AttachmentEdit.C.
|
inline |
Signal emitted when new attachment(s) have been uploaded (or failed to upload.
Definition at line 63 of file AttachmentEdit.h.
|
private |
Slot triggered when the WFileUpload completed an upload.
Definition at line 145 of file AttachmentEdit.C.
|
inline |
Returns whether the upload failed.
Definition at line 54 of file AttachmentEdit.h.
bool AttachmentEdit::uploadNow | ( | ) |
Updates the file now.
Returns whether a new file will be uploaded. If so, the uploadDone signal will be signalled when the file is uploaded (or failed to upload).
Definition at line 129 of file AttachmentEdit.C.
|
private |
Definition at line 66 of file AttachmentEdit.h.
|
private |
The text box to display an error (empty or too big file)
Definition at line 90 of file AttachmentEdit.h.
|
private |
The option to cancel the file upload.
Definition at line 93 of file AttachmentEdit.h.
|
private |
The WFileUpload control.
Definition at line 71 of file AttachmentEdit.h.
|
private |
Definition at line 68 of file AttachmentEdit.h.
|
private |
The state of the last upload process.
Definition at line 96 of file AttachmentEdit.h.
|
private |
Definition at line 87 of file AttachmentEdit.h.