]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QMathDialog.h
getting rid of even more qt3 convenience classes and unused headers...
[lyx.git] / src / frontends / qt4 / QMathDialog.h
1 // -*- C++ -*-
2 /**
3  * \file QMathDialog.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QMATHDIALOG_H
13 #define QMATHDIALOG_H
14
15 #include "ui/QMathUi.h"
16 #include <string>
17
18 #include <QDialog>
19
20 class IconPalette;
21 class QListWidgetItem;
22
23 namespace lyx {
24 namespace frontend {
25
26 class QMAction : public QAction {
27         Q_OBJECT
28 public:
29         QMAction( const QString & text, const std::string & action, QObject * parent)
30         : QAction(text,parent), action_(action) {
31                 connect(this, SIGNAL(triggered()), this, SLOT(action()));
32         }
33 signals:
34         void action(const std::string &);
35 protected slots:
36         void action() {
37                 emit action(action_);
38         }
39 private:
40         std::string action_;
41 };
42
43
44 class QMath;
45
46 class QMathDialog : public QDialog, public Ui::QMathUi
47 {
48         Q_OBJECT
49 public:
50         QMathDialog(QMath * form);
51 public slots:
52         virtual void delimiterClicked();
53         virtual void expandClicked();
54         virtual void fracClicked();
55         virtual void functionSelected(QListWidgetItem *);
56         virtual void matrixClicked();
57         virtual void subscriptClicked();
58         virtual void superscriptClicked();
59         virtual void equationClicked();
60         void symbol_clicked(const std::string &);
61         void insertCubeRoot();
62
63         /// about to show a symbol panel
64         void showingPanel(int);
65 protected:
66         //needed ? virtual void closeEvent(QCloseEvent * e);
67 private:
68         /// add item to popup menu
69         void addMenuItem(QMenu * menu, const QString & label, const std::string &);
70         /// make a symbol panel
71         IconPalette * makePanel(QWidget * parent, char const ** entries);
72         /// add a symbol panel
73         void addPanel(int num);
74
75         /// owning form
76         QMath * form_;
77 };
78
79 } // namespace frontend
80 } // namespace lyx
81
82 #endif // QMATHDIALOG_H