BALL 1.5.0
Loading...
Searching...
No Matches
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_STRUCTURE_SMILESPARSER_H
18#endif
19
20#include <QtWidgets/QDialog>
21
22#include <map>
23#include <boost/unordered_map.hpp>
24
25class QNetworkAccessManager;
26class QNetworkReply;
27
28class QTreeWidgetItem;
29
30namespace Ui
31{
32 class PubChemDialogData;
33}
34
35namespace BALL
36{
37 namespace VIEW
38 {
42 : public QDialog,
43 public ModularWidget
44 {
45 Q_OBJECT
46
47 public:
48
50
51
52 PubChemDialog ( QWidget* parent = NULL, const char* name = "PubChemDialog" );
53
55 virtual ~PubChemDialog();
56
58 virtual void initializeWidget ( MainControl& main_control );
59
61 virtual void checkMenu ( MainControl& main_control );
62
64 void generateFromSMILES ( const String& SMILES );
65 public Q_SLOTS:
66
68 void show();
69
72
75
77 void switchView ( QTreeWidgetItem* item, int column );
78
81
83 void finished();
84
86 void updateDownloadProgress ( qint64 done, qint64 total );
87
89 void downloadFinished ( QNetworkReply* reply );
90
91 protected:
92 Ui::PubChemDialogData* ui_;
93
95
97 {
98 QString name;
99 QString description;
101 };
102
106
107 void insert_ ( ParsedResult_ d, QTreeWidgetItem* parent, bool plot );
108 bool handleDownloadError_ ( QNetworkReply* reply);
110 QString buildHeaderTemplate_(InfoDisplayStyle style, const char* str) const;
111
112 std::map<QTreeWidgetItem*, System*> sd_systems_;
113 std::map<QTreeWidgetItem*, System*> original_systems_;
114 std::map<QTreeWidgetItem*, ParsedResult_> descriptions_;
115
116 QAction* action1_, *action2_;
117
119 boost::unordered_map<String, QString> information_templates_;
120
122 QNetworkAccessManager* network_manager_;
123 };
124
125 }
126}
127#endif
#define BALL_VIEW_EXPORT
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
ModularWidget(const char *name="<ModularWidget>")
PubChemDialog(QWidget *parent=NULL, const char *name="PubChemDialog")
Default Constructor.
Ui::PubChemDialogData * ui_
void updateDownloadProgress(qint64 done, qint64 total)
std::map< QTreeWidgetItem *, System * > original_systems_
void generateFromSMILES(const String &SMILES)
virtual void checkMenu(MainControl &main_control)
void downloadFinished(QNetworkReply *reply)
HashMap< int, QTreeWidgetItem * > esummary_request_ids_
void show()
Show and raise dialog.
QString buildHeaderTemplate_(InfoDisplayStyle style, const char *str) const
void switchView(QTreeWidgetItem *item, int column)
void generateButtonClicked()
Generate a structure from SMILES.
void queryPubChem()
Query PubChem.
boost::unordered_map< String, QString > information_templates_
std::map< QTreeWidgetItem *, ParsedResult_ > descriptions_
QNetworkAccessManager * network_manager_
void insert_(ParsedResult_ d, QTreeWidgetItem *parent, bool plot)
virtual void initializeWidget(MainControl &main_control)
bool handleDownloadError_(QNetworkReply *reply)
std::map< QTreeWidgetItem *, System * > sd_systems_
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31