File indexing completed on 2024-04-28 07:28:54

0001 /*
0002     SPDX-FileCopyrightText: 2009 Kashyap R Puranik <kashthealien@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef CALCULATOR_H
0008 #define CALCULATOR_H
0009 
0010 #include <QDialog>
0011 
0012 #include <KActionCollection>
0013 
0014 #include "concCalculator.h"
0015 #include "gasCalculator.h"
0016 #include "molcalcwidget.h"
0017 #include "nuclearCalculator.h"
0018 #include "titrationCalculator.h"
0019 #include "ui_calculator.h"
0020 
0021 #include <config-kalzium.h>
0022 #ifdef HAVE_FACILE
0023 #include <eqchemview.h>
0024 #endif
0025 
0026 /**
0027  * This widget implements the body of the calculator widget,
0028  * various calculators like the nuclear Calculator will be added to this.
0029  *
0030  * @author Kashyap R Puranik
0031  */
0032 class calculator : public QDialog
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     /*
0038      * The class constructor and destructor, takes in a Widget as parent
0039      */
0040     explicit calculator(QWidget *parent = nullptr); // constructor
0041     ~calculator() override; // destructor
0042 
0043 private:
0044     Ui::calculator ui; // The user interface
0045     KActionCollection *m_actionCollection;
0046 
0047     // These are the various calculator widgets that will be added to this calculator
0048 
0049     nuclearCalculator *m_nuclearCalculator; // The nuclear calculator
0050     gasCalculator *m_gasCalculator; // The gas calculator
0051     concCalculator *m_concCalculator; // The concentration calculator
0052     titrationCalculator *m_titraCalculator; // The concentration calculator
0053     MolcalcWidget *m_moleCalculator; // The molecular mass calculator
0054 #ifdef HAVE_FACILE
0055     EQChemDialog *m_equationBalancer; // The equation balancer
0056 #endif
0057 protected Q_SLOTS:
0058     /**
0059      * invoke the help of the correct chapter
0060      */
0061     virtual void slotHelp();
0062 private Q_SLOTS:
0063 
0064     // occurs when an tree item is selected, opens the corresponding calculator
0065     void slotItemSelection(QTreeWidgetItem *item);
0066 };
0067 
0068 #endif // CALCULATOR_H