Wt examples: /home/koen/project/wt/public-git/wt/examples/composer/AttachmentEdit.h Source File

Wt examples 3.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

/home/koen/project/wt/public-git/wt/examples/composer/AttachmentEdit.h
Go to the documentation of this file.

    00001 // This may look like C code, but it's really -*- C++ -*-
    00002 /*
    00003  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
    00004  *
    00005  * See the LICENSE file for terms of use.
    00006  */
    00007 #ifndef ATTACHMENT_EDIT_H_
    00008 #define ATTACHMENT_EDIT_H_
    00009
    00010 #include <Wt/WContainerWidget>
    00011
    00012 namespace Wt {
    00013   class WFileUpload;
    00014   class WText;
    00015   class WCheckBox;
    00016 }
    00017
    00018 class Attachment;
    00019 class Composer;
    00020 class Option;
    00021
    00022 using namespace Wt;
    00023
    00028
    00037 class AttachmentEdit : public WContainerWidget
    00038 {
    00039 public:
    00042   AttachmentEdit(Composer *composer, WContainerWidget *parent = 0);
    00043
    00050   bool uploadNow();
    00051
    00054   bool uploadFailed() const { return uploadFailed_; }
    00055
    00058   std::vector<Attachment> attachments();
    00059
    00063   Signal<void>& uploadDone() { return uploadDone_; }
    00064
    00065 private:
    00066   Composer    *composer_;
    00067
    00068   Signal<void> uploadDone_;
    00069
    00071   WFileUpload *upload_;
    00072
    00073   class UploadInfo : public WContainerWidget
    00074   {
    00075   public:
    00076     UploadInfo(const Http::UploadedFile& f, WContainerWidget *parent = 0);
    00077
    00078     Http::UploadedFile info_;
    00079
    00081     WAnchor   *downloadLink_;
    00082
    00084     WCheckBox *keep_;
    00085   };
    00086
    00087   std::vector<UploadInfo *> uploadInfo_;
    00088
    00090   WText *error_;
    00091
    00093   Option *remove_;
    00094
    00096   bool uploadFailed_;
    00097
    00099   void uploaded();
    00100
    00102   void fileTooLarge(::int64_t size);
    00103
    00105   void remove();
    00106 };
    00107
    00110 #endif // ATTACHMENT_EDIT_H_