2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2006-06-17 09:14:58 +00:00
|
|
|
* \file Action.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
#ifndef ACTION_H
|
|
|
|
#define ACTION_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
2007-10-15 22:43:55 +00:00
|
|
|
class QIcon;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
2007-09-28 23:14:33 +00:00
|
|
|
|
|
|
|
class FuncRequest;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2007-11-05 13:52:37 +00:00
|
|
|
class GuiView;
|
2007-01-22 11:31:42 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2006-06-17 09:14:58 +00:00
|
|
|
* Action - Qt interface with LyX' FuncRequest.
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
2006-06-17 09:14:58 +00:00
|
|
|
* Action can be used in LyX menubar and/or toolbars.
|
2006-03-05 17:24:44 +00:00
|
|
|
*/
|
2007-09-28 23:14:33 +00:00
|
|
|
class Action : public QAction
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-09-28 23:14:33 +00:00
|
|
|
public:
|
2008-03-14 16:33:16 +00:00
|
|
|
Action(GuiView * lyxView, QIcon const & icon, QString const & text,
|
|
|
|
FuncRequest const & func, QString const & tooltip, QObject * parent);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2007-04-19 20:29:27 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
/// the current action is triggered
|
|
|
|
void triggered(QAction *);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
void action();
|
|
|
|
|
|
|
|
private:
|
|
|
|
FuncRequest const & func_ ;
|
2008-03-14 16:33:16 +00:00
|
|
|
GuiView * lyxView_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
#endif // ACTION_H
|