2002-06-19 05:20:29 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file QLyXKeySym.h
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 05:20:29 +00:00
|
|
|
|
*
|
2003-09-07 01:45:40 +00:00
|
|
|
|
* \author Asger and J<EFBFBD>rgen
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-19 05:20:29 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef QLYXKEYSYM_H
|
|
|
|
|
#define QLYXKEYSYM_H
|
|
|
|
|
|
|
|
|
|
#include "frontends/LyXKeySym.h"
|
|
|
|
|
|
2002-08-25 05:41:42 +00:00
|
|
|
|
#include <qstring.h>
|
|
|
|
|
|
|
|
|
|
class QKeyEvent;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2002-06-19 05:20:29 +00:00
|
|
|
|
/**
|
|
|
|
|
* Qt-specific key press.
|
2002-07-30 00:53:57 +00:00
|
|
|
|
*
|
|
|
|
|
* This is some really sick stuff.
|
2002-06-19 05:20:29 +00:00
|
|
|
|
*/
|
|
|
|
|
class QLyXKeySym : public LyXKeySym {
|
|
|
|
|
public:
|
|
|
|
|
QLyXKeySym();
|
|
|
|
|
|
2002-06-21 02:58:54 +00:00
|
|
|
|
virtual ~QLyXKeySym() {}
|
|
|
|
|
|
|
|
|
|
/// delayed constructor
|
2002-08-25 05:41:42 +00:00
|
|
|
|
void set(QKeyEvent * ev);
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
2002-06-21 02:58:54 +00:00
|
|
|
|
/// set from a LyX symbolic name
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual void init(std::string const & symbolname);
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
|
|
|
|
/// Is this a valid key?
|
|
|
|
|
virtual bool isOK() const;
|
|
|
|
|
|
|
|
|
|
/// Is this a modifier key only?
|
|
|
|
|
virtual bool isModifier() const;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2002-06-21 02:58:54 +00:00
|
|
|
|
/// return the LyX symbolic name
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string getSymbolName() const;
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
2002-12-12 13:46:06 +00:00
|
|
|
|
/// Is this normal insertable text ? (last ditch attempt only)
|
|
|
|
|
virtual bool isText() const;
|
2003-02-25 13:35:26 +00:00
|
|
|
|
|
2002-06-19 05:20:29 +00:00
|
|
|
|
/**
|
|
|
|
|
* Return the value of the keysym into the local ISO encoding.
|
|
|
|
|
* This converts the LyXKeySym to a 8-bit encoded character.
|
|
|
|
|
* This relies on user to use the right encoding.
|
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual char getISOEncoded(std::string const & encoding) const;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
///
|
|
|
|
|
int key() const {
|
|
|
|
|
return key_;
|
|
|
|
|
}
|
2002-06-19 05:20:29 +00:00
|
|
|
|
private:
|
2002-06-21 02:58:54 +00:00
|
|
|
|
/// the Qt sym value
|
2002-06-19 05:20:29 +00:00
|
|
|
|
int key_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
/// the event string value
|
2002-08-25 05:41:42 +00:00
|
|
|
|
QString text_;
|
2002-06-19 05:20:29 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // QLYXKEYSYM_H
|