]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLyXKeySym.h
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QLyXKeySym.h
1 // -*- C++ -*-
2 /**
3  * \file QLyXKeySym.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger and Jürgen
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QLYXKEYSYM_H
14 #define QLYXKEYSYM_H
15
16 #include "frontends/LyXKeySym.h"
17
18 #include <qstring.h>
19
20 class QKeyEvent;
21
22 /**
23  * Qt-specific key press.
24  *
25  * This is some really sick stuff.
26  */
27 class QLyXKeySym : public LyXKeySym {
28 public:
29         QLyXKeySym();
30
31         virtual ~QLyXKeySym() {}
32
33         /// delayed constructor
34         void set(QKeyEvent * ev);
35
36         /// set from a LyX symbolic name
37         virtual void init(std::string const & symbolname);
38
39         /// Is this a valid key?
40         virtual bool isOK() const;
41
42         /// Is this a modifier key only?
43         virtual bool isModifier() const;
44
45         /// return the LyX symbolic name
46         virtual std::string getSymbolName() const;
47
48         /// Is this normal insertable text ? (last ditch attempt only)
49         virtual bool isText() const;
50
51         /**
52          * Return the value of the keysym into the local ISO encoding.
53          * This converts the LyXKeySym to a 8-bit encoded character.
54          * This relies on user to use the right encoding.
55          */
56         virtual char getISOEncoded(std::string const & encoding) const;
57         ///
58         int key() const {
59                 return key_;
60         }
61 private:
62         /// the Qt sym value
63         int key_;
64         /// the event string value
65         QString text_;
66 };
67
68 #endif // QLYXKEYSYM_H