]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLyXKeySym.h
Some Qt graphics dialog improvements. Yet more work needed :/
[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 /**
22  * Qt-specific key press.
23  *
24  * This is some really sick stuff.
25  */
26 class QLyXKeySym : public LyXKeySym {
27 public:
28         QLyXKeySym();
29
30         virtual ~QLyXKeySym() {}
31
32         /// delayed constructor
33         void set(int key, bool shift);
34
35         /// set from a LyX symbolic name
36         virtual void init(string const & symbolname);
37
38         /// Is this a valid key?
39         virtual bool isOK() const;
40
41         /// Is this a modifier key only?
42         virtual bool isModifier() const;
43         
44         /// return the LyX symbolic name
45         virtual string getSymbolName() const;
46
47         /**
48          * Return the value of the keysym into the local ISO encoding.
49          * This converts the LyXKeySym to a 8-bit encoded character.
50          * This relies on user to use the right encoding.
51          */
52         virtual char getISOEncoded() const;
53
54         virtual bool operator==(LyXKeySym const & k) const;
55
56 private:
57         /// the Qt sym value
58         int key_;
59         /// shift held or not 
60         bool shift_;
61 };
62
63 #endif // QLYXKEYSYM_H