]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XLyXKeySym.h
*duck*
[lyx.git] / src / frontends / xforms / XLyXKeySym.h
1 // -*- C++ -*-
2 /**
3  * \file XLyXKeySym.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Asger and Juergen
8  */
9
10 #ifndef XLYXKEYSYM_H
11 #define XLYXKEYSYM_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "LString.h"
18 #include <X11/Xlib.h>
19 #include "frontends/LyXKeySym.h"
20
21 /**
22  * This is a base class for representing a keypress.
23  * Each frontend has to implement this to provide
24  * the functionality that LyX needs in regards to
25  * key presses.
26  */
27 class XLyXKeySym : public LyXKeySym {
28 public:
29         XLyXKeySym();
30
31         /// X11 specific initialization with an X11 KeySym
32         void initFromKeySym(KeySym);
33
34         virtual void init(string const & symbolname);
35
36         virtual ~XLyXKeySym() {}
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         virtual string getSymbolName() const;
45
46         /**
47          * Return the value of the keysym into the local ISO encoding.
48          * This converts the LyXKeySym to a 8-bit encoded character.
49          * This relies on user to use the right encoding.
50          */
51         virtual char getISOEncoded() const;
52
53         virtual bool operator==(LyXKeySym const & k) const;
54
55 private:
56         unsigned int keysym;
57 };
58
59 #endif
60