4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger and Jürgen
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/KeySymbol.h"
27 * Qt-specific key press.
29 * This is some really sick stuff.
31 class GuiKeySymbol : public KeySymbol {
35 virtual ~GuiKeySymbol() {}
38 /// inlined out because of profiling results under linux when
39 /// opening a document.
40 inline bool operator==(KeySymbol const& ks) const;
42 /// delayed constructor
43 void set(QKeyEvent * ev);
45 /// set from a LyX symbolic name
46 virtual void init(std::string const & symbolname);
48 /// Is this a valid key?
49 virtual bool isOK() const;
51 /// Is this a modifier key only?
52 virtual bool isModifier() const;
54 /// return the LyX symbolic name
55 virtual std::string getSymbolName() const;
57 /// Is this normal insertable text ? (last ditch attempt only)
58 virtual bool isText() const;
61 * Return the value of the keysym into the UCS-4 encoding.
62 * This converts the KeySymbol to a 32-bit encoded character.
64 virtual char_type getUCSEncoded() const;
67 * Return a human-readable version of a key+modifier pair.
68 * This will be the GUI version (translated and with special
69 * characters for Mac OS X) when \c forgui is true.
71 virtual docstring const print(key_modifier::state mod, bool forgui) const;
74 int key() const { return key_; }
79 /// the event string value
83 /// return the LyX key state from Qt's
84 key_modifier::state q_key_state(Qt::KeyboardModifiers state);
88 #endif // QLYXKEYSYM_H