• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

fileuploadwizard.h

Go to the documentation of this file.
00001 #ifndef FILEIMPORTWIZARD_H
00002 #define FILEIMPORTWIZARD_H
00003 
00004 #define DEBUG_SETSTARTUPPAGE
00005 #undef DEBUG_SETSTARTUPPAGE
00006 
00007 #include <QGridLayout>
00008 
00015 class WizardColumnLayout : public QGridLayout
00016 {
00017 public:
00018     WizardColumnLayout(QWidget *leftWidget, QWidget *rightWidget = 0, QWidget *parent = 0);
00019     void addRightWidget(QWidget *widget);
00020     void removeRightWidget(QWidget *widget);
00021     void addBottomWidget(QWidget *widget);
00022 
00023 private:
00024     QVBoxLayout *layoutR;
00025     QVBoxLayout *layoutL;
00026 };
00027 
00028 #include <QWizard>
00029 
00030 class FileSelectionView;
00031 class TemplatesView;
00032 
00067 class FileUploadWizard : public QWizard
00068 {
00069     Q_OBJECT
00070 public:
00071     enum Page {
00072         Page_Intro, Page_FileSelection, Page_TemplateSelection, Page_TemplateMaker,
00073         Page_Preview, Page_Conclusion
00074     };
00075 
00076     FileUploadWizard(QWidget *parent = 0);
00077     ~FileUploadWizard();
00078 
00079     void setDefaultButtonLayout();
00080     QList<QWizard::WizardButton> getDefaultLayout();
00081     FileSelectionView *getFileSelectionView();
00082     TemplatesView *getTemplateView();
00083 
00084 private:
00085     FileSelectionView *fileSelectionView;
00086     TemplatesView *templatesView;
00087     QList<QWizard::WizardButton> defaultButtonLayout;
00088 };
00089 
00090 #include <QWizardPage>
00091 
00095 class FileUploadWizardPage : public QWizardPage
00096 {
00097 public:
00098     FileUploadWizardPage(QWidget *parent = 0);
00099     FileUploadWizard * wizard() const;
00100 };
00101 
00111 class IntroPage : public FileUploadWizardPage
00112 {
00113 public:
00114     IntroPage(QWidget *parent = 0);
00115 };
00116 
00122 class FileSelectionPage : public FileUploadWizardPage
00123 {
00124     Q_OBJECT
00125 public:
00126     FileSelectionPage(QWidget *parent = 0);
00127     void setLayout(WizardColumnLayout *layout);
00128     WizardColumnLayout *layout() const;
00129 
00130 private:
00131     void setVisible(bool visible);
00132     bool isComplete() const;
00133 
00134 private:
00135     QPushButton *addFilesButton;
00136 };
00137 
00143 class TemplateSelectionPage : public FileUploadWizardPage
00144 {
00145     Q_OBJECT
00146 public:
00147     TemplateSelectionPage(QWidget *parent = 0);
00148     void setLayout(WizardColumnLayout *layout);
00149     WizardColumnLayout *layout() const;
00150 
00151 private:
00152     void setVisible(bool visible);
00153     bool isComplete() const;
00154     int nextId() const;
00155 };
00156 
00157 class FileSelectionModel;
00158 class TemplateMakerPageGui;
00159 class TagContainer;
00160 
00218 class TemplateMakerPage : public FileUploadWizardPage
00219 {
00220     Q_OBJECT
00221 public:
00222     TemplateMakerPage(FileSelectionModel *model, QWidget *parent = 0);
00223 
00224 private:
00225     int nextId() const;
00226     void setVisible(bool visible);
00227 
00228 private slots:
00229     void customButtonClicked(int buttonNr);
00230 
00231 private:
00232     TemplateMakerPageGui *m_form;
00233     TagContainer *m_tagContainer;
00234     QList<QWizard::WizardButton> buttonLayout;
00235     QString lastLoadedTemplate;
00236 };
00237 
00238 #include <QPointer>
00239 #include <QItemSelection> // needed by moc
00240 
00241 class ImportFileView;
00242 class QAbstractItemModel;
00243 class QProgressDialog;
00244 class QListView;
00245 
00251 class PreviewPage : public FileUploadWizardPage
00252 {
00253     Q_OBJECT
00254 public:
00255     PreviewPage(FileSelectionModel *fileSelectionModel, QWidget *parent = 0);
00256     void setLayout(WizardColumnLayout *layout );
00257     WizardColumnLayout *layout() const;
00258     void setVisible(bool visible);
00259 
00260 private:
00261     bool uploadFile(QAbstractItemModel *model, QProgressDialog *progress);
00262 
00263 private slots:
00264     void slot_fileSelected(QItemSelection selected, QItemSelection);
00265     void startUploadProcess();
00266 
00267 private:
00268     void setButtonsEnabled(bool flag);
00269 
00270 private:
00271     QList<QWizard::WizardButton> buttonLayout;
00272     QListView *selectedFilesView;
00273     QPointer<ImportFileView> preview;
00274     QString spCode;
00275     QString spName;
00276     QString spArgs;
00277 
00278 };
00279 
00285 class ConclusionPage : public FileUploadWizardPage
00286 {
00287 public:
00288     ConclusionPage(QWidget *parent = 0);
00289 
00290 private:
00291     void setVisible(bool visible);
00292 
00293 private:
00294     QList<QWizard::WizardButton> buttonLayout;
00295 };
00296  // end of group file_upload_wizard_pages
00298 
00299 
00300 #endif // FILEIMPORTWIZARD_H
00301 
00302 

Generated on Tue Aug 24 2010 15:58:55 for Smartlet by  doxygen 1.7.1