Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsModFileUpload.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2006-Today Guy Deleeuw
3 *
4 * See the LICENSE file for terms of use.
5 */
6 
7 #ifndef WsModFileUpload_H__
8 #define WsModFileUpload_H__ 1
9 
10 #include <Wt/WContainerWidget>
11 #include <Wt/WFileUpload>
12 #include <Wt/WProgressBar>
13 
14 #include <WsModule/WsModule.h>
15 
16 using namespace Wt;
17 
24 class WsFileUpload : public Wt::WContainerWidget, public WsOptions {
25 public :
27  WsFileUpload(Wt::WContainerWidget* parent = 0);
28  ~WsFileUpload();
29  void load();
30 
31 public slots :
32  void doUpload();
33  void doFileTooLarge(int64_t nSize);
34  void doUploaded();
35  void doCancel();
36 
37 private :
38  Wt::WFileUpload* m_pFU;
39  WDialog* m_dialog;
40 };
41 
42 class WsModFileUpload : public WsModule {
43 public :
46  ~WsModFileUpload();
47  Wt::WWidget* createContentsMenuBar(Wt::WContainerWidget* parent = 0) const;
48  Wt::WWidget* createContents(Wt::WContainerWidget* parent = 0) const;
49  WsEditorWidget* createEditor(Wt::WContainerWidget* parent = 0) const;
50  Wt::WWidget* createAdmin(Wt::WContainerWidget* parent = 0) const;
51  std::string description() const;
52 };
53 
54 extern "C" {
55  // http://phoxis.org/2011/04/27/c-language-constructors-and-destructors-with-gcc/
56  void WsModFileUploadInit(void) __attribute__((constructor));
57 
59  {
60  return new WsModFileUpload();
61  }
62 }
63 
64 #endif // ifndef WsModFileUpload_H__
65 
WDialog * m_dialog
void WsModFileUploadInit(void) __attribute__((constructor))
WsModFileUpload * buildModule()
Wt::WFileUpload * m_pFU