]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLyXKeySym.h
better selection and scrolling behaviour
[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 Juergen
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 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "LString.h"
21 #include "frontends/LyXKeySym.h"
22
23 #include <qstring.h>
24
25 class QKeyEvent;
26
27 /**
28  * Qt-specific key press.
29  *
30  * This is some really sick stuff.
31  */
32 class QLyXKeySym : public LyXKeySym {
33 public:
34         QLyXKeySym();
35
36         virtual ~QLyXKeySym() {}
37
38         /// delayed constructor
39         void set(QKeyEvent * ev);
40
41         /// set from a LyX symbolic name
42         virtual void init(string const & symbolname);
43
44         /// Is this a valid key?
45         virtual bool isOK() const;
46
47         /// Is this a modifier key only?
48         virtual bool isModifier() const;
49
50         /// return the LyX symbolic name
51         virtual string getSymbolName() const;
52
53         /**
54          * Return the value of the keysym into the local ISO encoding.
55          * This converts the LyXKeySym to a 8-bit encoded character.
56          * This relies on user to use the right encoding.
57          */
58         virtual char getISOEncoded() const;
59         ///
60         int key() const {
61                 return key_;
62         }
63 private:
64         /// the Qt sym value
65         int key_;
66         /// the event string value
67         QString text_;
68 };
69
70 #endif // QLYXKEYSYM_H