]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QMathDialog.h
* Painter.h:
[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 QListWidgetItem;
21
22 namespace lyx {
23
24 class IconPalette;
25
26 namespace frontend {
27
28 class QMAction : public QAction {
29         Q_OBJECT
30 public:
31         QMAction( const QString & text, const std::string & action, QObject * parent)
32         : QAction(text,parent), action_(action) {
33                 connect(this, SIGNAL(triggered()), this, SLOT(action()));
34         }
35 Q_SIGNALS:
36         void action(const std::string &);
37 protected Q_SLOTS:
38         void action() {
39                 // emit signal
40                 action(action_);
41         }
42 private:
43         std::string action_;
44 };
45
46
47 class QMath;
48
49 class QMathDialog : public QDialog, public Ui::QMathUi
50 {
51         Q_OBJECT
52 public:
53         QMathDialog(QMath * form);
54 public Q_SLOTS:
55         virtual void delimiterClicked();
56         virtual void expandClicked();
57         virtual void fracClicked();
58         virtual void functionSelected(QListWidgetItem *);
59         virtual void matrixClicked();
60         virtual void subscriptClicked();
61         virtual void superscriptClicked();
62         virtual void equationClicked();
63         void symbol_clicked(const std::string &);
64         void insertCubeRoot();
65
66         /// about to show a symbol panel
67         void showingPanel(int);
68 protected:
69         //needed ? virtual void closeEvent(QCloseEvent * e);
70 private:
71         /// add item to popup menu
72         void addMenuItem(QMenu * menu, const QString & label, const std::string &);
73         /// make a symbol panel
74         IconPalette * makePanel(QWidget * parent, char const ** entries);
75         /// add a symbol panel
76         void addPanel(int num);
77
78         /// owning form
79         QMath * form_;
80 };
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // QMATHDIALOG_H