Wt examples: composer/AttachmentEdit.h Source File

Wt examples 4.10.4

Loading...
Searching...
No Matches
AttachmentEdit.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7#ifndef ATTACHMENT_EDIT_H_
8#define ATTACHMENT_EDIT_H_
9
10#include <Wt/WContainerWidget.h>
11
12namespace Wt {
13 class WFileUpload;
14 class WText;
15 class WCheckBox;
16}
17
18class Attachment;
19class Composer;
20class Option;
21
22using namespace Wt;
23
28
37 class AttachmentEdit : public WContainerWidget
38{
39public:
42 AttachmentEdit(Composer *composer);
43
50 bool uploadNow();
51
54 bool uploadFailed() const { return uploadFailed_; }
55
58 std::vector<Attachment> attachments();
59
63 Signal<>& uploadDone() { return uploadDone_; }
64
65private:
66 Composer *composer_;
67
68 Signal<> uploadDone_;
69
71 WFileUpload *upload_;
72
73 class UploadInfo : public WContainerWidget
74 {
75 public:
76 UploadInfo(const Http::UploadedFile& f);
77
78 Http::UploadedFile info_;
79
81 WAnchor *downloadLink_;
82
84 WCheckBox *keep_;
85 };
86
87 std::vector<UploadInfo *> uploadInfo_;
88
90 WText *error_;
91
93 Option *remove_;
94
96 bool uploadFailed_;
97
99 void uploaded();
100
102 void fileTooLarge(::int64_t size);
103
105 void remove();
106};
107
110#endif // ATTACHMENT_EDIT_H_
AttachmentEdit::UploadInfo
Definition AttachmentEdit.h:74
AttachmentEdit::UploadInfo::keep_
WCheckBox * keep_
The check box to keep or discard the uploaded file.
Definition AttachmentEdit.h:84
AttachmentEdit::UploadInfo::downloadLink_
WAnchor * downloadLink_
Anchor referencing the file.
Definition AttachmentEdit.h:81
AttachmentEdit::UploadInfo::UploadInfo
UploadInfo(const Http::UploadedFile &f)
Definition AttachmentEdit.C:29
AttachmentEdit::UploadInfo::info_
Http::UploadedFile info_
Definition AttachmentEdit.h:78
AttachmentEdit
An edit field for an email attachment.
Definition AttachmentEdit.h:38
AttachmentEdit::uploadNow
bool uploadNow()
Updates the file now.
Definition AttachmentEdit.C:126
AttachmentEdit::remove
void remove()
Slot triggered when the users wishes to remove this attachment edit.
Definition AttachmentEdit.C:171
AttachmentEdit::error_
WText * error_
The text box to display an error (empty or too big file)
Definition AttachmentEdit.h:90
AttachmentEdit::uploadFailed
bool uploadFailed() const
Returns whether the upload failed.
Definition AttachmentEdit.h:54
AttachmentEdit::composer_
Composer * composer_
Definition AttachmentEdit.h:66
AttachmentEdit::remove_
Option * remove_
The option to cancel the file upload.
Definition AttachmentEdit.h:93
AttachmentEdit::uploadDone_
Signal uploadDone_
Definition AttachmentEdit.h:68
AttachmentEdit::uploadFailed_
bool uploadFailed_
The state of the last upload process.
Definition AttachmentEdit.h:96
AttachmentEdit::uploaded
void uploaded()
Slot triggered when the WFileUpload completed an upload.
Definition AttachmentEdit.C:142
AttachmentEdit::attachments
std::vector< Attachment > attachments()
Returns the attachment.
Definition AttachmentEdit.C:189
AttachmentEdit::upload_
WFileUpload * upload_
The WFileUpload control.
Definition AttachmentEdit.h:71
AttachmentEdit::uploadDone
Signal & uploadDone()
Signal emitted when new attachment(s) have been uploaded (or failed to upload.
Definition AttachmentEdit.h:63
AttachmentEdit::uploadInfo_
std::vector< UploadInfo * > uploadInfo_
Definition AttachmentEdit.h:87
AttachmentEdit::AttachmentEdit
AttachmentEdit(Composer *composer)
Creates an attachment edit field.
Definition AttachmentEdit.C:68
AttachmentEdit::fileTooLarge
void fileTooLarge(::int64_t size)
Slot triggered when the WFileUpload received an oversized file.
Definition AttachmentEdit.C:176
Attachment
An email attachment.
Definition Attachment.h:20
Composer
An E-mail composer widget.
Definition Composer.h:41
Option
A clickable option.
Definition Option.h:32
Wt
Definition AddresseeEdit.h:16