downloadPDBFile.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
00006 #define BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
00007 
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011 
00012 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00013 # include <BALL/VIEW/KERNEL/modularWidget.h>
00014 #endif
00015 
00016 #ifndef BALL_DATATYPE_HASHSET_H
00017 # include <BALL/DATATYPE/hashSet.h>
00018 #endif
00019 
00020 #include <BALL/VIEW/UIC/ui_downloadPDBFile.h>
00021 
00022 namespace BALL
00023 {
00024   class TCPTransfer;
00025 
00026   namespace VIEW
00027   {
00028 
00029     class FetchHTMLThread;
00030 
00034     class BALL_VIEW_EXPORT DownloadPDBFile 
00035       : public QDialog,
00036         public Ui_DownloadPDBFileData,
00037         public ModularWidget
00038     { 
00039         Q_OBJECT
00040       public:
00041         BALL_EMBEDDABLE(DownloadPDBFile, ModularWidget)
00042 
00043         
00044         DownloadPDBFile(QWidget* parent = 0, const char* name = "DownloadPDBFileDialog", 
00045                         bool modal = FALSE, Qt::WFlags fl = 0 );
00046 
00048         ~DownloadPDBFile();
00049 
00051         virtual void initializeWidget(VIEW::MainControl& main_control);
00052 
00054         virtual void fetchPreferences(INIFile& inifile);
00055 
00057         virtual void writePreferences(INIFile& inifile);
00058 
00062         void setPrefix(String s) { prefix_ = s;}
00063 
00067         void setSuffix(String s) { suffix_ = s;}
00068 
00070         void checkMenu(MainControl& mc);
00071 
00072       public slots:
00073 
00075         void slotDownload();
00076 
00078         void idChanged();
00079 
00081         virtual void abort();
00082 
00083       protected:
00084 
00085         //_
00086         void downloadStarted_();
00087 
00088         //_  
00089         void downloadEnded_();
00090 
00091         bool threadedDownload_(const String& url);
00092         void removeFile_(const String& filename);
00093 
00094         void setProxyAndTransfer_(TCPTransfer& tcp);
00095         
00096         FetchHTMLThread         *thread_;
00097         bool                    aborted_;
00098         bool                    error_;
00099 
00100         HashMap<String, QImage> image_cache_;
00101 
00102         // e.g. gif images if not supported
00103         HashSet<String>         unsupported_images_;
00104 
00105         QAction* menu_id_;
00106         String   prefix_, suffix_;
00107     };
00108 
00109   } 
00110 } //namespaces
00111 #endif