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 "frontends/LyXView.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
#include "FuncRequest.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-10-09 12:30:55 +00:00
|
|
|
#include "support/docstring.h"
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <QAction>
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiViewBase;
|
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-04-25 16:39:21 +00:00
|
|
|
class Action : public QAction {
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
Action(GuiViewBase & lyxView, docstring const & text,
|
2007-04-25 16:39:21 +00:00
|
|
|
FuncRequest const & func, docstring const & tooltip = docstring());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
Action(GuiViewBase & lyxView, std::string const & icon, docstring const & text,
|
2007-04-25 16:39:21 +00:00
|
|
|
FuncRequest const & func, docstring const & tooltip = docstring());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
|
|
|
// void setAction(FuncRequest const & func);
|
|
|
|
|
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_ ;
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiViewBase & lyxView_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
#endif // ACTION_H
|