/
ImportOrder.h
71 lines (50 loc) · 1.48 KB
/
ImportOrder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef IMPORTORDER_H
#define IMPORTORDER_H
#include <Wt/WContainerWidget>
//#include "Attachment.h"
using namespace Wt;
class ImportOrder : public WContainerWidget
{
public:
typedef enum {Order,Price} LoadMode;
ImportOrder(LoadMode mode,WContainerWidget *parent=0);
virtual ~ImportOrder();
bool uploadNow();
/*! \brief Returns whether the upload failed.
*/
bool uploadFailed() const { return m_uploadFailed; }
/*! \brief Returns the attachment.
*/
//std::vector<Attachment> attachments();
void uploaded();
Signal<void>& uploadDone() { return m_uploadDone; }
protected:
WTemplate *m_mainTemplate;
private:
WFileUpload *m_upload;
bool m_uploadFailed;
WContainerWidget *m_importButtonDiv;
LoadMode m_LoadMode;
void renderView();
void fileTooLarge(::int64_t size);
class UploadInfo : public WContainerWidget
{
public:
UploadInfo(const Http::UploadedFile& f, WContainerWidget *parent = 0);
Http::UploadedFile info_;
//! Anchor referencing the file.
WAnchor *downloadLink_;
//! The check box to keep or discard the uploaded file.
WCheckBox *keep_;
};
//! The text box to display an error (empty or too big file)
WText *m_error;
//! The option to cancel the file upload
//Option *m_remove;
WComboBox *m_splitter;
WComboBox *m_codePage;
void import();
std::vector<UploadInfo *> m_uploadInfo;
Signal<void> m_uploadDone;
};
#endif // IMPORTORDER_H