]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLyXKeySym.h
Remove crap again. Make redo key binding work.
[lyx.git] / src / frontends / qt2 / QLyXKeySym.h
1 // -*- C++ -*-
2 /**
3  * \file QLyXKeySym.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Asger and Juergen
8  * \author John Levon <moz@compsoc.man.ac.uk>
9  */
10
11 #ifndef QLYXKEYSYM_H
12 #define QLYXKEYSYM_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "LString.h"
19 #include "frontends/LyXKeySym.h"
20
21 #include <qstring.h>
22
23 class QKeyEvent;
24  
25 /**
26  * Qt-specific key press.
27  *
28  * This is some really sick stuff.
29  */
30 class QLyXKeySym : public LyXKeySym {
31 public:
32         QLyXKeySym();
33
34         virtual ~QLyXKeySym() {}
35
36         /// delayed constructor
37         void set(QKeyEvent * ev);
38
39         /// set from a LyX symbolic name
40         virtual void init(string const & symbolname);
41
42         /// Is this a valid key?
43         virtual bool isOK() const;
44
45         /// Is this a modifier key only?
46         virtual bool isModifier() const;
47         
48         /// return the LyX symbolic name
49         virtual string getSymbolName() 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() const;
57
58         virtual bool operator==(LyXKeySym const & k) const;
59
60 private:
61         /// the Qt sym value
62         int key_;
63         /// the event string value 
64         QString text_;
65 };
66
67 #endif // QLYXKEYSYM_H