2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QMathDialog.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QMATHDIALOG_H
|
|
|
|
#define QMATHDIALOG_H
|
|
|
|
|
|
|
|
#include "ui/QMathUi.h"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2006-04-05 15:10:34 +00:00
|
|
|
class QListWidgetItem;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
2006-11-19 17:12:33 +00:00
|
|
|
namespace frontend {
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
class IconPalette;
|
|
|
|
|
2006-04-05 15:10:34 +00:00
|
|
|
class QMAction : public QAction {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QMAction( const QString & text, const std::string & action, QObject * parent)
|
|
|
|
: QAction(text,parent), action_(action) {
|
|
|
|
connect(this, SIGNAL(triggered()), this, SLOT(action()));
|
|
|
|
}
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-04-05 15:10:34 +00:00
|
|
|
void action(const std::string &);
|
2006-06-30 14:37:33 +00:00
|
|
|
protected Q_SLOTS:
|
2006-04-05 15:10:34 +00:00
|
|
|
void action() {
|
2006-06-30 14:11:50 +00:00
|
|
|
// emit signal
|
|
|
|
action(action_);
|
2006-04-05 15:10:34 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
std::string action_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
class QMath;
|
|
|
|
|
|
|
|
class QMathDialog : public QDialog, public Ui::QMathUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QMathDialog(QMath * form);
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual void delimiterClicked();
|
|
|
|
virtual void expandClicked();
|
2006-04-05 15:10:34 +00:00
|
|
|
virtual void functionSelected(QListWidgetItem *);
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual void matrixClicked();
|
|
|
|
virtual void subscriptClicked();
|
|
|
|
virtual void superscriptClicked();
|
|
|
|
virtual void equationClicked();
|
|
|
|
void symbol_clicked(const std::string &);
|
2006-04-05 15:10:34 +00:00
|
|
|
void insertCubeRoot();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// about to show a symbol panel
|
|
|
|
void showingPanel(int);
|
|
|
|
protected:
|
|
|
|
//needed ? virtual void closeEvent(QCloseEvent * e);
|
|
|
|
private:
|
2006-04-05 15:10:34 +00:00
|
|
|
/// add item to popup menu
|
|
|
|
void addMenuItem(QMenu * menu, const QString & label, const std::string &);
|
2006-03-05 17:24:44 +00:00
|
|
|
/// make a symbol panel
|
|
|
|
IconPalette * makePanel(QWidget * parent, char const ** entries);
|
|
|
|
/// add a symbol panel
|
|
|
|
void addPanel(int num);
|
|
|
|
|
|
|
|
/// owning form
|
|
|
|
QMath * form_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QMATHDIALOG_H
|