| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_QTPLUGINS_INSERTDNA_H |
| 7 |
#define AVOGADRO_QTPLUGINS_INSERTDNA_H |
| 8 |
|
| 9 |
#include <avogadro/qtgui/extensionplugin.h> |
| 10 |
|
| 11 |
#include <QtCore/QMap> |
| 12 |
|
| 13 |
#include <string> |
| 14 |
|
| 15 |
namespace Avogadro { |
| 16 |
namespace Io { |
| 17 |
class FileFormat; |
| 18 |
} |
| 19 |
namespace QtPlugins { |
| 20 |
|
| 21 |
class InsertDNADialog; |
| 22 |
|
| 23 |
/** |
| 24 |
* @brief Load single-line molecule descriptors through an input dialog. |
| 25 |
*/ |
| 26 |
class InsertDna : public QtGui::ExtensionPlugin |
| 27 |
{ |
| 28 |
Q_OBJECT |
| 29 |
public: |
| 30 |
explicit InsertDna(QObject* parent_ = nullptr); |
| 31 |
~InsertDna() override; |
| 32 |
|
| 33 |
QString name() const override { return tr("InsertDNA"); } |
| 34 |
QString description() const override; |
| 35 |
QList<QAction*> actions() const override; |
| 36 |
QStringList menuPath(QAction*) const override; |
| 37 |
|
| 38 |
public slots: |
| 39 |
void setMolecule(QtGui::Molecule*) override; |
| 40 |
|
| 41 |
private slots: |
| 42 |
void showDialog(); |
| 43 |
|
| 44 |
void performInsert(); |
| 45 |
void updateText(); |
| 46 |
void updateBPTurns(int type); |
| 47 |
void changeNucleicType(int type); |
| 48 |
|
| 49 |
void dialogDestroyed(); |
| 50 |
|
| 51 |
private: |
| 52 |
QList<QAction*> m_actions; |
| 53 |
|
| 54 |
QtGui::Molecule* m_molecule; |
| 55 |
Io::FileFormat* m_reader; |
| 56 |
InsertDNADialog* m_dialog; |
| 57 |
|
| 58 |
void constructDialog(); |
| 59 |
}; |
| 60 |
|
| 61 |
inline QString InsertDna::description() const |
| 62 |
{ |
| 63 |
return tr("Insert DNA / RNA fragments through a dialog."); |
| 64 |
} |
| 65 |
|
| 66 |
} // namespace QtPlugins |
| 67 |
} // namespace Avogadro |
| 68 |
|
| 69 |
#endif // AVOGADRO_QTPLUGINS_INSERTDNA_H |