2002-06-19 05:20:29 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QLyXKeySym.h
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author Asger and Juergen
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QLYXKEYSYM_H
|
|
|
|
#define QLYXKEYSYM_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include "frontends/LyXKeySym.h"
|
|
|
|
|
2002-08-25 05:41:42 +00:00
|
|
|
#include <qstring.h>
|
|
|
|
|
|
|
|
class QKeyEvent;
|
|
|
|
|
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-06-21 02:58:54 +00:00
|
|
|
/// return the LyX symbolic name
|
2002-06-19 05:20:29 +00:00
|
|
|
virtual string getSymbolName() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
virtual char getISOEncoded() const;
|
|
|
|
|
|
|
|
virtual bool operator==(LyXKeySym const & k) const;
|
|
|
|
|
|
|
|
private:
|
2002-06-21 02:58:54 +00:00
|
|
|
/// the Qt sym value
|
2002-06-19 05:20:29 +00:00
|
|
|
int key_;
|
2002-08-25 05:41:42 +00:00
|
|
|
/// the event string value
|
|
|
|
QString text_;
|
2002-06-19 05:20:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QLYXKEYSYM_H
|