00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
00008 #define BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifdef BALL_COMPILER_MSVC
00015 # include <BALL/VIEW/UIC/ui_downloadPDBFile.h>
00016 #else
00017 # include <BALL/VIEW/UIC/downloadPDBFileData.h>
00018 #endif
00019
00020
00021 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00022 # include <BALL/VIEW/KERNEL/modularWidget.h>
00023 #endif
00024
00025 #ifndef BALL_DATATYPE_HASHSET_H
00026 # include <BALL/DATATYPE/hashSet.h>
00027 #endif
00028
00029 namespace BALL
00030 {
00031 class TCPTransfer;
00032
00033 namespace VIEW
00034 {
00035
00036 class FetchHTMLThread;
00037
00041 class BALL_VIEW_EXPORT DownloadPDBFile
00042 : public QDialog,
00043 public Ui_DownloadPDBFileData,
00044 public ModularWidget
00045 {
00046 Q_OBJECT
00047 public:
00048 BALL_EMBEDDABLE(DownloadPDBFile, ModularWidget)
00049
00050
00051 DownloadPDBFile(QWidget* parent = 0, const char* name = "DownloadPDBFileDialog",
00052 bool modal = FALSE, Qt::WFlags fl = 0 );
00053
00055 ~DownloadPDBFile();
00056
00058 virtual void initializeWidget(VIEW::MainControl& main_control);
00059
00061 virtual void fetchPreferences(INIFile& inifile);
00062
00064 virtual void writePreferences(INIFile& inifile);
00065
00069 void setPrefix(String s) { prefix_ = s;}
00070
00074 void setSuffix(String s) { suffix_ = s;}
00075
00077 void checkMenu(MainControl& mc);
00078
00079 public slots:
00080
00082 void slotDownload();
00083
00085 void idChanged();
00086
00088 virtual void abort();
00089
00090 protected:
00091
00092
00093 void downloadStarted_();
00094
00095
00096 void downloadEnded_();
00097
00098 bool threadedDownload_(const String& url);
00099 void removeFile_(const String& filename);
00100
00101 void setProxyAndTransfer_(TCPTransfer& tcp);
00102
00103 FetchHTMLThread *thread_;
00104 bool aborted_;
00105 bool error_;
00106
00107 HashMap<String, QImage> image_cache_;
00108
00109
00110 HashSet<String> unsupported_images_;
00111
00112 QAction* menu_id_;
00113 String prefix_, suffix_;
00114 };
00115
00116 }
00117 }
00118 #endif