// -*- C++ -*-
-/* International support for LyX
-
-
+/**
+ * \file intl.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author unknown
+ * \author Lars Gullik Bjønnes
+ * \author Angus Leeming
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
*/
+
#ifndef INTL_H
#define INTL_H
-#include FORMS_H_LOCATION
+#include "trans_mgr.h"
-#ifdef __GNUG__
-#pragma interface
-#endif
-#include "LString.h"
-#include "form1.h"
-#include <sigc++/signal_system.h>
+namespace lyx {
-class LyXText;
-class Combox;
-class TransManager;
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Object;
-#endif
+/**
+ * This class is used for managing keymaps
+ * for composing characters in LyX.
+ */
+class Intl {
+public:
+ /// which keymap is currently used ?
+ enum Keymap {
+ PRIMARY,
+ SECONDARY
+ };
-/// default character set
-#define DEFCHSET "iso8859-1"
+ Intl();
+ /// {en/dis}able the keymap
+ void keyMapOn(bool on);
-/** The gui part and the non gui part should be split into two different
- classes. Probably should the gui class just have a pointer to the non
- gui class.
- */
-class Intl : public Object {
-public:
- ///
- Intl();
- ///
- ~Intl();
-
- /// show key mapping dialog
- void MenuKeymap();
- ///
- void KeyMapOn(bool on);
- ///
- void KeyMapPrim();
- ///
- void KeyMapSec();
+ /// set the primary language keymap
+ void keyMapPrim();
+
+ /// set the secondary language keymap
+ void keyMapSec();
/// turn on/off key mappings, status in keymapon
- void ToggleKeyMap();
+ void toggleKeyMap();
- ///
- int SetPrimary(string const &);
+ /// initialize key mapper
+ void initKeyMapper(bool on);
- ///
- int SetSecondary(string const &);
+ // Get the Translation Manager
+ TransManager & getTransManager();
- /// initialize key mapper
- void InitKeyMapper(bool on);
+ /// using primary or secondary keymap ?
+ Keymap keymap;
- /// Get the Translation Manager
- TransManager * getTrans();
- ///
- bool keymapon;
- ///
- bool primarykeymap;
- ///
- char * chsetcode;
- ///
- static void DispatchCallback(FL_OBJECT *, long);
private:
- /** Redraw the form (on receipt of a Signal indicating, for example,
- that the xform colors have been re-mapped).
- */
- void redraw();
- ///
- void update();
- ///
- static void LCombo(int i, void *, Combox *); // callback
- ///
- void Keymap(long code);
- ///
- int curkeymap;
- ///
- int otherkeymap;
-
- ///
- FD_KeyMap * fd_form_keymap;
- ///
- Combox * Language;
- ///
- Combox * Language2;
- ///
- string & prim_lang;
- ///
- string & sec_lang;
- ///
- TransManager * trans;
- /// Redraw connection.
- SigC::Connection r_;
+ /// is key mapping enabled ?
+ bool keymapon;
+ /// the primary language keymap
+ std::string & prim_lang;
+ /// the secondary language keymap
+ std::string & sec_lang;
+ /// the translation manager
+ TransManager trans;
};
inline
-TransManager * Intl::getTrans()
+TransManager & Intl::getTransManager()
{
return trans;
}
-#endif
+
+} // namespace lyx
+
+#endif /* INTL_H */