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 {
|
|
|
|
|
|
|
|
/**
|
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:
|
2013-05-02 17:22:10 +00:00
|
|
|
Action(QIcon const & icon, QString const & text,
|
2008-03-14 16:33:16 +00:00
|
|
|
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_ ;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
#endif // ACTION_H
|