]> git.lyx.org Git - features.git/blob - src/frontends/qt2/QLyXKeySym.h
Replace LString.h with support/std_string.h,
[features.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
17 #include "support/std_string.h"
18 #include "frontends/LyXKeySym.h"
19
20 #include <qstring.h>
21
22 class QKeyEvent;
23
24 /**
25  * Qt-specific key press.
26  *
27  * This is some really sick stuff.
28  */
29 class QLyXKeySym : public LyXKeySym {
30 public:
31         QLyXKeySym();
32
33         virtual ~QLyXKeySym() {}
34
35         /// delayed constructor
36         void set(QKeyEvent * ev);
37
38         /// set from a LyX symbolic name
39         virtual void init(string const & symbolname);
40
41         /// Is this a valid key?
42         virtual bool isOK() const;
43
44         /// Is this a modifier key only?
45         virtual bool isModifier() const;
46
47         /// return the LyX symbolic name
48         virtual string getSymbolName() const;
49
50         /// Is this normal insertable text ? (last ditch attempt only)
51         virtual bool isText() 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(string const & encoding) 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