File indexing completed on 2021-12-21 14:36:19

0001 /*
0002     SPDX-FileCopyrightText: 2001-2013 Evan Teran <evan.teran@gmail.com>
0003     SPDX-FileCopyrightText: 2003-2005 Klaus Niederkrueger <kniederk@math.uni-koeln.de>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QMenu>
0011 #include <QString>
0012 
0013 enum ConstantCategory { Mathematics = 1, Electromagnetic = 2, Nuclear = 4, Thermodynamics = 8, Gravitation = 16 };
0014 
0015 struct science_constant {
0016     QString label;
0017     QString name;
0018     QString whatsthis;
0019     QString value;
0020     ConstantCategory category;
0021 };
0022 
0023 class KCalcConstMenu : public QMenu
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit KCalcConstMenu(QWidget *parent = nullptr);
0029     explicit KCalcConstMenu(const QString &title, QWidget *parent = nullptr);
0030 
0031 public:
0032     static void init_consts();
0033 
0034 Q_SIGNALS:
0035     void triggeredConstant(const science_constant &);
0036 
0037 private:
0038     void init_all();
0039 
0040 public Q_SLOTS:
0041     void slotPassSignalThrough(QAction *chosen_const);
0042 };
0043