2007-10-25 03:08:22 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file CustomizedWidgets.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Bo Peng
|
|
|
|
|
* \author Edwin Leuven
|
2008-07-22 08:29:50 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
2007-10-25 03:08:22 +00:00
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef CUSTOMIZEDWIDGETS_H
|
|
|
|
|
#define CUSTOMIZEDWIDGETS_H
|
|
|
|
|
|
2008-07-21 14:54:07 +00:00
|
|
|
|
#include <QLabel>
|
2007-10-26 20:43:22 +00:00
|
|
|
|
#include "KeySequence.h"
|
|
|
|
|
|
|
|
|
|
class QEvent;
|
|
|
|
|
class QKeyEvent;
|
2007-10-25 03:08:22 +00:00
|
|
|
|
|
2007-10-29 08:56:30 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-10-25 03:08:22 +00:00
|
|
|
|
/**
|
2008-07-21 14:54:07 +00:00
|
|
|
|
* A widget for inputting shortcuts
|
2007-10-25 03:08:22 +00:00
|
|
|
|
*/
|
2008-07-21 14:54:07 +00:00
|
|
|
|
class ShortcutWidget : public QLabel {
|
2007-10-25 03:08:22 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2008-07-21 14:54:07 +00:00
|
|
|
|
ShortcutWidget(QWidget * parent);
|
2007-10-26 20:43:22 +00:00
|
|
|
|
void reset();
|
|
|
|
|
bool eventFilter(QObject*, QEvent* e );
|
2008-08-24 20:29:20 +00:00
|
|
|
|
KeySequence const getKeySequence() const;
|
2008-07-22 08:29:50 +00:00
|
|
|
|
void setKeySequence(lyx::KeySequence const s);
|
|
|
|
|
void removeFromSequence();
|
2007-10-25 03:08:22 +00:00
|
|
|
|
protected Q_SLOTS:
|
2007-10-26 20:43:22 +00:00
|
|
|
|
bool event(QEvent* e);
|
2007-10-25 03:08:22 +00:00
|
|
|
|
void keyPressEvent(QKeyEvent * e);
|
2007-10-26 20:43:22 +00:00
|
|
|
|
private:
|
|
|
|
|
void appendToSequence(QKeyEvent * e);
|
2008-08-24 20:29:20 +00:00
|
|
|
|
KeySequence keysequence_;
|
2007-10-26 20:43:22 +00:00
|
|
|
|
bool has_cursor_;
|
2007-10-25 03:08:22 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-10-29 08:56:30 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-10-25 03:08:22 +00:00
|
|
|
|
|
|
|
|
|
#endif // CUSTOMIZEDWIDGETS_H
|