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
|
|
|
*
|
|
|
|
* \author Asger and Juergen
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-06-19 05:20:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QLYXKEYSYM_H
|
|
|
|
#define QLYXKEYSYM_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "LString.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
|
2002-06-19 05:20:29 +00:00
|
|
|
virtual void init(string const & symbolname);
|
|
|
|
|
|
|
|
/// 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
|
2002-06-19 05:20:29 +00:00
|
|
|
virtual string getSymbolName() const;
|
|
|
|
|
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-01-05 22:38:42 +00:00
|
|
|
virtual char getISOEncoded(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
|