lyx_mirror/src/frontends/qt4/QLyXKeySym.h
Lars Gullik Bjønnes c46b7d8955 Merge the unicode branch into trunk.
- src/support/unicode.[Ch]: new files with functions for converting
  to and fro ucs4, ucs2 and utf8.
- src/support/docstring.h: specialization of basic_string that
  holds a uint32_t internally.
- Several functions changed to use char_type instead of char or unsigned char.
- Qt3 and Qt4 sends ucs2 on to core
- Gtk sends ucs4 on to core
- Read and write utf-8 .lyx files.
- font_metrics and painter updated to handle ucs4 chars as input.
- Quite a bit of ugly compability code, conversion string->docstring, etc.
- Have fun...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14661 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-13 22:54:59 +00:00

76 lines
1.5 KiB
C++

// -*- 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ürgen
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QLYXKEYSYM_H
#define QLYXKEYSYM_H
#include "frontends/LyXKeySym.h"
#include <QString>
#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;
/**
* Return the value of the keysym into the UCS-4 encoding.
* This converts the LyXKeySym to a 32-bit encoded character.
*/
virtual size_t getUCSEncoded() const;
/// 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