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"
|
|
|
|
|
|
|
|
#include <qstring.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Qt-specific key press.
|
|
|
|
*/
|
|
|
|
class QLyXKeySym : public LyXKeySym {
|
|
|
|
public:
|
|
|
|
QLyXKeySym();
|
|
|
|
|
2002-06-21 02:58:54 +00:00
|
|
|
virtual ~QLyXKeySym() {}
|
|
|
|
|
|
|
|
/// delayed constructor
|
2002-06-19 05:20:29 +00:00
|
|
|
void set(int key, QString const & text);
|
|
|
|
|
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-06-21 02:58:54 +00:00
|
|
|
/**
|
|
|
|
* The generated text from the symbol. This will only be
|
|
|
|
* filled when the QLyXKeySym is used to pass a key press
|
|
|
|
* event, not when stored in a kbsequence etc.
|
|
|
|
*/
|
2002-06-19 05:20:29 +00:00
|
|
|
QString text_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QLYXKEYSYM_H
|