2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file QLyXKeySym.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Asger and J<EFBFBD>rgen
|
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef QLYXKEYSYM_H
|
|
|
|
|
#define QLYXKEYSYM_H
|
|
|
|
|
|
|
|
|
|
#include "frontends/LyXKeySym.h"
|
|
|
|
|
|
2006-05-07 10:20:43 +00:00
|
|
|
|
#include <QString>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
|
|
|
|
class QKeyEvent;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Qt-specific key press.
|
|
|
|
|
*
|
|
|
|
|
* This is some really sick stuff.
|
|
|
|
|
*/
|
|
|
|
|
class QLyXKeySym : public LyXKeySym {
|
|
|
|
|
public:
|
|
|
|
|
QLyXKeySym();
|
|
|
|
|
|
|
|
|
|
virtual ~QLyXKeySym() {}
|
|
|
|
|
|
|
|
|
|
/// delayed constructor
|
|
|
|
|
void set(QKeyEvent * ev);
|
|
|
|
|
|
|
|
|
|
/// set from a LyX symbolic name
|
|
|
|
|
virtual void init(std::string const & symbolname);
|
|
|
|
|
|
|
|
|
|
/// Is this a valid key?
|
|
|
|
|
virtual bool isOK() const;
|
|
|
|
|
|
|
|
|
|
/// Is this a modifier key only?
|
|
|
|
|
virtual bool isModifier() const;
|
|
|
|
|
|
|
|
|
|
/// return the LyX symbolic name
|
|
|
|
|
virtual std::string getSymbolName() const;
|
|
|
|
|
|
|
|
|
|
/// Is this normal insertable text ? (last ditch attempt only)
|
|
|
|
|
virtual bool isText() const;
|
|
|
|
|
|
|
|
|
|
/**
|
2006-08-13 22:54:59 +00:00
|
|
|
|
* Return the value of the keysym into the UCS-4 encoding.
|
|
|
|
|
* This converts the LyXKeySym to a 32-bit encoded character.
|
2006-03-05 17:24:44 +00:00
|
|
|
|
*/
|
2006-08-13 22:54:59 +00:00
|
|
|
|
virtual size_t getUCSEncoded() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// Return a human-readable version of a key+modifier pair.
|
|
|
|
|
virtual std::string const print(key_modifier::state mod) const;
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
QString const qprint(key_modifier::state mod) const;
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
int key() const {
|
|
|
|
|
return key_;
|
|
|
|
|
}
|
|
|
|
|
private:
|
|
|
|
|
/// the Qt sym value
|
|
|
|
|
int key_;
|
|
|
|
|
/// the event string value
|
|
|
|
|
QString text_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // QLYXKEYSYM_H
|