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