#include <AttachmentEdit.h>
Public Member Functions | |
AttachmentEdit (Composer *composer, WContainerWidget *parent=0) | |
Create an attachment edit field. | |
~AttachmentEdit () | |
bool | uploadNow () |
Update the file now. | |
bool | uploadFailed () const |
Return whether the upload failed. | |
bool | include () const |
Return whether this attachment must be included in the message. | |
Attachment | attachment () |
Return the attachment. | |
Public Attributes | |
Signal< void > | uploadDone |
Signal emitted when a new attachment has been uploaded (or failed to upload. | |
Private Slots | |
void | uploaded () |
Slot triggered when the WFileUpload completed an upload. | |
void | fileTooLarge (int size) |
Slot triggered when the WFileUpload received an oversized file. | |
void | remove () |
Slot triggered when the users wishes to remove this attachment edit. | |
Private Attributes | |
Composer * | composer_ |
WFileUpload * | upload_ |
The WFileUpload control. | |
WText * | uploaded_ |
The text describing the uploaded file. | |
WCheckBox * | keep_ |
The check box to keep or discard the uploaded file. | |
Option * | remove_ |
The option to remove the file. | |
WText * | error_ |
The text box to display an error (empty or too big file). | |
bool | uploadFailed_ |
The state of the last upload process. | |
std::wstring | fileName_ |
The filename of the uploaded file. | |
std::string | spoolFileName_ |
The filename of the local spool file. | |
std::wstring | contentDescription_ |
The content description that was sent along with the file. | |
bool | taken_ |
Whether the spool file is "taken" and is no longer managed by the edit. |
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 | |||
) |
AttachmentEdit::~AttachmentEdit | ( | ) |
Definition at line 85 of file AttachmentEdit.C.
bool AttachmentEdit::uploadNow | ( | ) |
Update 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 92 of file AttachmentEdit.C.
bool AttachmentEdit::uploadFailed | ( | ) | const [inline] |
bool AttachmentEdit::include | ( | ) | const |
Return whether this attachment must be included in the message.
Definition at line 176 of file AttachmentEdit.C.
Attachment AttachmentEdit::attachment | ( | ) |
void AttachmentEdit::uploaded | ( | ) | [private, slot] |
Slot triggered when the WFileUpload completed an upload.
Definition at line 108 of file AttachmentEdit.C.
void AttachmentEdit::fileTooLarge | ( | int | size | ) | [private, slot] |
Slot triggered when the WFileUpload received an oversized file.
Definition at line 165 of file AttachmentEdit.C.
void AttachmentEdit::remove | ( | ) | [private, slot] |
Slot triggered when the users wishes to remove this attachment edit.
Definition at line 160 of file AttachmentEdit.C.
Signal emitted when a new attachment has been uploaded (or failed to upload.
Definition at line 68 of file AttachmentEdit.h.
Composer* AttachmentEdit::composer_ [private] |
Definition at line 71 of file AttachmentEdit.h.
WFileUpload* AttachmentEdit::upload_ [private] |
WText* AttachmentEdit::uploaded_ [private] |
WCheckBox* AttachmentEdit::keep_ [private] |
Option* AttachmentEdit::remove_ [private] |
WText* AttachmentEdit::error_ [private] |
The text box to display an error (empty or too big file).
Definition at line 86 of file AttachmentEdit.h.
bool AttachmentEdit::uploadFailed_ [private] |
std::wstring AttachmentEdit::fileName_ [private] |
std::string AttachmentEdit::spoolFileName_ [private] |
std::wstring AttachmentEdit::contentDescription_ [private] |
The content description that was sent along with the file.
Definition at line 98 of file AttachmentEdit.h.
bool AttachmentEdit::taken_ [private] |
Whether the spool file is "taken" and is no longer managed by the edit.
Definition at line 101 of file AttachmentEdit.h.