X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiKeySymbol.h;h=d113f50ff2284f1069c64191316f002f1b2ea805;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=a88314cf916850814ac2a7733200c4f5fc7772ca;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiKeySymbol.h b/src/frontends/qt4/GuiKeySymbol.h index a88314cf91..d113f50ff2 100644 --- a/src/frontends/qt4/GuiKeySymbol.h +++ b/src/frontends/qt4/GuiKeySymbol.h @@ -4,85 +4,27 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Asger and Jürgen + * \author Asger and Jürgen * \author John Levon * * Full author contact details are available in file CREDITS. */ -#ifndef QLYXKEYSYM_H -#define QLYXKEYSYM_H +#ifndef GUIKEYSYM_H +#define GUIKEYSYM_H #include "frontends/KeySymbol.h" -#include -#include - - class QKeyEvent; namespace lyx { -/** - * Qt-specific key press. - * - * This is some really sick stuff. - */ -class GuiKeySymbol : public KeySymbol { -public: - GuiKeySymbol(); - - virtual ~GuiKeySymbol() {} - - /// . - /// inlined out because of profiling results under linux when - /// opening a document. - inline bool operator==(KeySymbol const& ks) const; - - /// 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 KeySymbol to a 32-bit encoded character. - */ - virtual char_type getUCSEncoded() const; - - /** - * Return a human-readable version of a key+modifier pair. - * This will be the GUI version (translated and with special - * characters for Mac OS X) when \c forgui is true. - */ - virtual docstring const print(key_modifier::state mod, bool forgui) const; - - /// - int key() const { return key_; } - -private: - /// the Qt sym value - int key_; - /// the event string value - QString text_; -}; +/// delayed constructor +void setKeySymbol(KeySymbol * sym, QKeyEvent * ev); /// return the LyX key state from Qt's -key_modifier::state q_key_state(Qt::KeyboardModifiers state); +KeyModifier q_key_state(Qt::KeyboardModifiers state); } // namespace lyx -#endif // QLYXKEYSYM_H +#endif // GUIKEYSYM_H