]> git.lyx.org Git - lyx.git/blob - src/intl.h
117d56966a5953dc01809dc0f94602b6a00ffa5a
[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 #ifdef SIGC_CXX_NAMESPACES
25 using SigC::Object;
26 using SigC::Connection;
27 #endif
28
29 /// default character set
30 #define DEFCHSET "iso8859-1"
31
32
33 /** The gui part and the non gui part should be split into two different
34   classes. Probably should the gui class just have a pointer to the non
35   gui class.
36   */
37 class Intl : public Object {
38 public:
39         ///
40         Intl();
41         ///
42         ~Intl();
43         
44         /// show key mapping dialog
45         void MenuKeymap(); 
46         ///
47         void KeyMapOn(bool on);
48         ///
49         void KeyMapPrim();
50         ///
51         void KeyMapSec();
52
53         /// turn on/off key mappings, status in keymapon
54         void ToggleKeyMap();
55
56         ///
57         int SetPrimary(string const &);
58
59         ///
60         int SetSecondary(string const &);
61
62         /// initialize key mapper
63         void InitKeyMapper(bool on);
64
65         // Get the Translation Manager
66         TransManager & getTrans();
67         ///
68         bool keymapon;
69         ///
70         bool primarykeymap;
71         ///
72         char * chsetcode;
73         ///
74         static void DispatchCallback(FL_OBJECT *, long);
75 private:
76         /** Redraw the form (on receipt of a Signal indicating, for example,
77             that the xform colors have been re-mapped).
78         */
79         void redraw();
80         ///
81         void update();
82         ///
83         static void LCombo(int i, void *, Combox *); // callback
84         ///
85         void Keymap(long code);
86         ///
87         int curkeymap;
88         ///
89         int otherkeymap;
90         
91         ///
92         boost::scoped_ptr<FD_KeyMap> fd_form_keymap;
93         ///
94         boost::scoped_ptr<Combox> Language;
95         ///
96         boost::scoped_ptr<Combox> Language2;
97         ///
98         string & prim_lang;
99         ///
100         string & sec_lang;
101         ///
102         TransManager trans;
103         /// Redraw connection.
104         Connection r_;
105 };
106
107
108 inline
109 TransManager & Intl::getTrans()
110 {
111         return trans;
112 }
113
114 #endif