BALL  1.5.0
downloadPDBFile.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
6 #define BALL_VIEW_DIALOGS_DOWNLOADPDBFILE_H
7 
8 #ifndef BALL_COMMON_GLOBAL_H
9 # include <BALL/COMMON/global.h>
10 #endif
11 
12 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
14 #endif
15 
16 #ifndef BALL_DATATYPE_HASHSET_H
17 # include <BALL/DATATYPE/hashSet.h>
18 #endif
19 
20 #include <BALL/VIEW/UIC/ui_downloadPDBFile.h>
21 
22 #include <QtNetwork/QNetworkReply>
23 
24 class QProgressBar;
25 class QNetworkAccessManager;
26 
27 namespace BALL
28 {
29  namespace VIEW
30  {
35  : public QDialog,
36  public Ui_DownloadPDBFileData,
37  public ModularWidget
38  {
39  Q_OBJECT
40  public:
42 
43 
44  DownloadPDBFile(QWidget* parent = 0, const char* name = "DownloadPDBFileDialog",
45  bool modal = false, Qt::WindowFlags fl = 0 );
46 
48  ~DownloadPDBFile();
49 
51  virtual void initializeWidget(VIEW::MainControl& main_control);
52 
54  virtual void fetchPreferences(INIFile& inifile);
55 
57  virtual void writePreferences(INIFile& inifile);
58 
62  void setPrefix(String s) { prefix_ = s;}
63 
67  void setSuffix(String s) { suffix_ = s;}
68 
70  void checkMenu(MainControl& mc);
71 
72  public Q_SLOTS:
73 
75  void slotDownload();
76 
78  void idChanged();
79 
81  virtual void abort();
82 
84  void downloadFinished();
85 
87  void downloadProgress(qint64 received, qint64 total);
88 
89  protected:
90 
91  //_
92  void downloadStarted_();
93 
94  //_
95  void downloadEnded_();
96 
97  bool threadedDownload_(const String& url);
98  void removeFile_(const String& filename);
99 
100  bool aborted_;
101  bool error_;
102 
104 
105  // e.g. gif images if not supported
107 
108  QAction* menu_id_;
109  String prefix_, suffix_;
111 
112  // the current network reply
113  QNetworkReply* current_reply_;
114 
115  // the current progress bar
116  QProgressBar* progress_bar_;
117  QNetworkAccessManager* network_manager_;
118  };
119 
120  }
121 } //namespaces
122 #endif
BALL::VIEW::DownloadPDBFile::setPrefix
void setPrefix(String s)
Definition: downloadPDBFile.h:62
BALL::VIEW::DownloadPDBFile::current_reply_
QNetworkReply * current_reply_
Definition: downloadPDBFile.h:113
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::HashSet< String >
BALL::VIEW::DownloadPDBFile::unsupported_images_
HashSet< String > unsupported_images_
Definition: downloadPDBFile.h:106
QWidget
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
QDialog
BALL::VIEW::DownloadPDBFile::biounit_suffix_
String biounit_suffix_
Definition: downloadPDBFile.h:110
BALL::VIEW::DownloadPDBFile::suffix_
String suffix_
Definition: downloadPDBFile.h:109
BALL::VIEW::DownloadPDBFile::progress_bar_
QProgressBar * progress_bar_
Definition: downloadPDBFile.h:116
BALL::VIEW::DownloadPDBFile
Definition: downloadPDBFile.h:34
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::DownloadPDBFile::menu_id_
QAction * menu_id_
Definition: downloadPDBFile.h:108
BALL
Definition: constants.h:12
BALL::String
Definition: string.h:56
BALL::VIEW::DownloadPDBFile::error_
bool error_
Definition: downloadPDBFile.h:101
modularWidget.h
BALL::VIEW::MainControl
Definition: mainControl.h:114
BALL::VIEW::DownloadPDBFile::image_cache_
HashMap< String, QImage > image_cache_
Definition: downloadPDBFile.h:103
BALL::VIEW::DownloadPDBFile::setSuffix
void setSuffix(String s)
Definition: downloadPDBFile.h:67
hashSet.h
BALL::VIEW::DownloadPDBFile::aborted_
bool aborted_
Definition: downloadPDBFile.h:100
BALL::VIEW::DownloadPDBFile::network_manager_
QNetworkAccessManager * network_manager_
Definition: downloadPDBFile.h:117
global.h
BALL::VIEW::ModularWidget
Definition: modularWidget.h:60
BALL::INIFile
Definition: INIFile.h:28