BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pubchemDialog.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_DIALOGSPUBCHEMDIALOG_H
6 #define BALL_VIEW_DIALOGSPUBCHEMDIALOG_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_VIEW_WIDGETS_SDWIDGET_H
18 #endif
19 
20 #ifndef BALL_STRUCTURE_SMILESPARSER_H
22 #endif
23 
24 #ifndef BALL_FORMAT_PUBCHEMDOWNLOADER_H
26 #endif
27 
28 #include <BALL/VIEW/UIC/ui_pubchemDialog.h>
29 
30 #include <QtGui/QDialog>
31 
32 #include <map>
33 
34 class QProgressBar;
35 
36 namespace BALL
37 {
38  namespace VIEW
39  {
40  class PubChemDialog;
41 
42  namespace PubChemDialogPrivate
43  {
45  : public QThread
46  {
47  Q_OBJECT
48 
49  public:
51 
52  void run();
53 
56 
57  protected:
59  };
60  }
61 
65  : public QDialog,
66  public Ui_PubChemDialogData,
67  public ModularWidget
68  {
69  Q_OBJECT
70 
72 
73  public:
74 
76 
77 
78  PubChemDialog(QWidget *parent = NULL, const char *name = "PubChemDialog");
79 
81  virtual ~PubChemDialog();
82 
84  virtual void initializeWidget(MainControl& main_control);
85 
87  virtual void checkMenu(MainControl& main_control);
88 
90  void generateFromSMILES(const String& SMILES);
91  public slots:
92 
94  void show();
95 
97  void generateButtonClicked();
98 
100  void queryPubChem();
101 
103  void switchView(QTreeWidgetItem* item, int column);
104 
106  void clearEntries();
107 
109  void finished();
110 
112  void updateDownloadProgress(qint64 done, qint64 total);
113 
115  void downloadFinished(const QString& filename);
116 
117  protected:
118 
119  SmilesParser smiles_parser_;
120 
122  {
126  };
127 
128  void parseItemRecursive_(const QDomNode& current_node, Position level, ParsedResult_& result);
129 
130  void insert_(ParsedResult_ d, QTreeWidgetItem* parent, bool plot);
131 
133 
134  std::map<QTreeWidgetItem*, System*> sd_systems_;
135  std::map<QTreeWidgetItem*, System*> original_systems_;
136  std::map<QTreeWidgetItem*, ParsedResult_> descriptions_;
137 
138  QAction* action1_, *action2_;
139 
141 
143  QProgressBar *progress_;
144 
146 
148  };
149 
150  }
151 }
152 #endif