]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLyXKeySym.h
This new citation dialog follows a new design similar to lyx-1.3:
[lyx.git] / src / frontends / qt4 / 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 //Added by qt3to4:
20 #include <QKeyEvent>
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(std::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 std::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(std::string const & encoding) const;
59
60         /// Return a human-readable version of a key+modifier pair.
61         virtual std::string const print(key_modifier::state mod) const;
62
63         ///
64         QString const qprint(key_modifier::state mod) const;
65
66         ///
67         int key() const {
68                 return key_;
69         }
70 private:
71         /// the Qt sym value
72         int key_;
73         /// the event string value
74         QString text_;
75 };
76
77 #endif // QLYXKEYSYM_H