Loading...
Searching...
No Matches
pubchemDialog.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_DIALOGSPUBCHEMDIALOG_H
#define BALL_VIEW_DIALOGSPUBCHEMDIALOG_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
# include <BALL/VIEW/KERNEL/modularWidget.h>
#endif
#ifndef BALL_STRUCTURE_SMILESPARSER_H
# include <BALL/STRUCTURE/smilesParser.h>
#endif
#include <QtWidgets/QDialog>
#include <map>
#include <boost/unordered_map.hpp>
class QNetworkAccessManager;
class QNetworkReply;
class QTreeWidgetItem;
namespace Ui
{
class PubChemDialogData;
}
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT PubChemDialog
: public QDialog,
public ModularWidget
{
Q_OBJECT
public:
BALL_EMBEDDABLE ( PubChemDialog,ModularWidget )
PubChemDialog ( QWidget* parent = NULL, const char* name = "PubChemDialog" );
virtual ~PubChemDialog();
virtual void initializeWidget ( MainControl& main_control );
virtual void checkMenu ( MainControl& main_control );
void generateFromSMILES ( const String& SMILES );
public Q_SLOTS:
void show();
void generateButtonClicked();
void queryPubChem();
void switchView ( QTreeWidgetItem* item, int column );
void clearEntries();
void finished();
void updateDownloadProgress ( qint64 done, qint64 total );
void downloadFinished ( QNetworkReply* reply );
protected:
Ui::PubChemDialogData* ui_;
SmilesParser smiles_parser_;
struct ParsedResult_
{
QString name;
QString description;
String smiles;
};
enum InfoDisplayStyle{
LONG, SHORT
};
void insert_ ( ParsedResult_ d, QTreeWidgetItem* parent, bool plot );
bool handleDownloadError_ ( QNetworkReply* reply);
void buildInformationTemplates_();
QString buildHeaderTemplate_(InfoDisplayStyle style, const char* str) const;
std::map<QTreeWidgetItem*, System*> sd_systems_;
std::map<QTreeWidgetItem*, System*> original_systems_;
std::map<QTreeWidgetItem*, ParsedResult_> descriptions_;
QAction* action1_, *action2_;
HashMap<int, QTreeWidgetItem*> esummary_request_ids_;
boost::unordered_map<String, QString> information_templates_;
QPushButton* add_button_;
QNetworkAccessManager* network_manager_;
};
}
}
#endif
global.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::SmilesParser
Definition smilesParser.h:37
BALL::String
Definition string.h:57
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::ModularWidget::ModularWidget
ModularWidget(const char *name="<ModularWidget>")
BALL::VIEW::PubChemDialog::PubChemDialog
PubChemDialog(QWidget *parent=NULL, const char *name="PubChemDialog")
Default Constructor.
BALL::VIEW::PubChemDialog::clearEntries
void clearEntries()
BALL::VIEW::PubChemDialog::ui_
Ui::PubChemDialogData * ui_
Definition pubchemDialog.h:92
BALL::VIEW::PubChemDialog::action2_
QAction * action2_
Definition pubchemDialog.h:116
BALL::VIEW::PubChemDialog::updateDownloadProgress
void updateDownloadProgress(qint64 done, qint64 total)
BALL::VIEW::PubChemDialog::finished
void finished()
BALL::VIEW::PubChemDialog::action1_
QAction * action1_
Definition pubchemDialog.h:116
BALL::VIEW::PubChemDialog::original_systems_
std::map< QTreeWidgetItem *, System * > original_systems_
Definition pubchemDialog.h:113
BALL::VIEW::PubChemDialog::generateFromSMILES
void generateFromSMILES(const String &SMILES)
BALL::VIEW::PubChemDialog::buildInformationTemplates_
void buildInformationTemplates_()
BALL::VIEW::PubChemDialog::InfoDisplayStyle
InfoDisplayStyle
Definition pubchemDialog.h:103
BALL::VIEW::PubChemDialog::LONG
@ LONG
Definition pubchemDialog.h:104
BALL::VIEW::PubChemDialog::SHORT
@ SHORT
Definition pubchemDialog.h:104
BALL::VIEW::PubChemDialog::checkMenu
virtual void checkMenu(MainControl &main_control)
BALL::VIEW::PubChemDialog::downloadFinished
void downloadFinished(QNetworkReply *reply)
BALL::VIEW::PubChemDialog::esummary_request_ids_
HashMap< int, QTreeWidgetItem * > esummary_request_ids_
Definition pubchemDialog.h:118
BALL::VIEW::PubChemDialog::show
void show()
Show and raise dialog.
BALL::VIEW::PubChemDialog::buildHeaderTemplate_
QString buildHeaderTemplate_(InfoDisplayStyle style, const char *str) const
BALL::VIEW::PubChemDialog::smiles_parser_
SmilesParser smiles_parser_
Definition pubchemDialog.h:94
BALL::VIEW::PubChemDialog::switchView
void switchView(QTreeWidgetItem *item, int column)
BALL::VIEW::PubChemDialog::generateButtonClicked
void generateButtonClicked()
Generate a structure from SMILES.
BALL::VIEW::PubChemDialog::queryPubChem
void queryPubChem()
Query PubChem.
BALL::VIEW::PubChemDialog::information_templates_
boost::unordered_map< String, QString > information_templates_
Definition pubchemDialog.h:119
BALL::VIEW::PubChemDialog::descriptions_
std::map< QTreeWidgetItem *, ParsedResult_ > descriptions_
Definition pubchemDialog.h:114
BALL::VIEW::PubChemDialog::network_manager_
QNetworkAccessManager * network_manager_
Definition pubchemDialog.h:122
BALL::VIEW::PubChemDialog::insert_
void insert_(ParsedResult_ d, QTreeWidgetItem *parent, bool plot)
BALL::VIEW::PubChemDialog::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::PubChemDialog::add_button_
QPushButton * add_button_
Definition pubchemDialog.h:121
BALL::VIEW::PubChemDialog::handleDownloadError_
bool handleDownloadError_(QNetworkReply *reply)
BALL::VIEW::PubChemDialog::sd_systems_
std::map< QTreeWidgetItem *, System * > sd_systems_
Definition pubchemDialog.h:112
QDialog
QPushButton
QTreeWidgetItem
QWidget
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
modularWidget.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
Ui
Definition pluginDialog.h:19
smilesParser.h
BALL::VIEW::PubChemDialog::ParsedResult_
Definition pubchemDialog.h:97
BALL::VIEW::PubChemDialog::ParsedResult_::description
QString description
Definition pubchemDialog.h:99
BALL::VIEW::PubChemDialog::ParsedResult_::name
QString name
Definition pubchemDialog.h:98
BALL::VIEW::PubChemDialog::ParsedResult_::smiles
String smiles
Definition pubchemDialog.h:100