]> git.lyx.org Git - lyx.git/blob - src/intl.h
1327dee213b5e6c48dae1b07b00bd4aeb884dc8e
[lyx.git] / src / intl.h
1 // -*- C++ -*-
2 /* International support for LyX
3
4
5  */
6 #ifndef INTL_H
7 #define INTL_H
8
9 #include FORMS_H_LOCATION
10
11 #ifdef __GNUG__
12 #pragma interface
13 #endif
14
15 #include <boost/smart_ptr.hpp>
16 #include <sigc++/signal_system.h>
17 #include "LString.h"
18 #include "form1.h"
19 #include "trans_mgr.h"
20
21 class LyXText;
22 class Combox;
23
24 /// default character set
25 #define DEFCHSET "iso8859-1"
26
27
28 /** The gui part and the non gui part should be split into two different
29   classes. Probably should the gui class just have a pointer to the non
30   gui class.
31   */
32 class Intl : public SigC::Object {
33 public:
34         ///
35         Intl();
36         ///
37         ~Intl();
38         
39         /// show key mapping dialog
40         void MenuKeymap(); 
41         ///
42         void KeyMapOn(bool on);
43         ///
44         void KeyMapPrim();
45         ///
46         void KeyMapSec();
47
48         /// turn on/off key mappings, status in keymapon
49         void ToggleKeyMap();
50
51         ///
52         int SetPrimary(string const &);
53
54         ///
55         int SetSecondary(string const &);
56
57         /// initialize key mapper
58         void InitKeyMapper(bool on);
59
60         // Get the Translation Manager
61         TransManager & getTrans();
62         ///
63         bool keymapon;
64         ///
65         bool primarykeymap;
66         ///
67         char * chsetcode;
68         ///
69         static void DispatchCallback(FL_OBJECT *, long);
70 private:
71         /** Redraw the form (on receipt of a Signal indicating, for example,
72             that the xform colors have been re-mapped).
73         */
74         void redraw();
75         ///
76         void update();
77         ///
78         static void LCombo(int i, void *, Combox *); // callback
79         ///
80         void Keymap(long code);
81         ///
82         int curkeymap;
83         ///
84         int otherkeymap;
85         
86         ///
87         FD_KeyMap * fd_form_keymap;
88         ///
89         boost::scoped_ptr<Combox> Language;
90         ///
91         boost::scoped_ptr<Combox> Language2;
92         ///
93         string & prim_lang;
94         ///
95         string & sec_lang;
96         ///
97         TransManager trans;
98         /// Redraw connection.
99         SigC::Connection r_;
100 };
101
102
103 inline
104 TransManager & Intl::getTrans()
105 {
106         return trans;
107 }
108
109 #endif