X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fintl.h;h=07de268332e114544d1e580e919e05e6202a2feb;hb=2af1fccc61b68e273bd690c506df85d4a2c8e30e;hp=90317e85d32ccb265b9492648b1d144044da0890;hpb=74b224fcba406f4ea4d1f1fa91a63aea39ca2712;p=lyx.git diff --git a/src/intl.h b/src/intl.h index 90317e85d3..07de268332 100644 --- a/src/intl.h +++ b/src/intl.h @@ -1,138 +1,80 @@ // -*- 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 - -#ifdef __GNUG__ -#pragma interface -#endif - -#include -#include "LString.h" -#include "form1.h" - -#if 1 #include "trans_mgr.h" -#endif -class LyXText; -class Combox; -#if 0 -class TransManager; -#endif +namespace lyx { -#ifdef SIGC_CXX_NAMESPACES -using SigC::Object; -using SigC::Connection; -#endif -/// default character set -#define DEFCHSET "iso8859-1" - - -/** 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 { +/** + * This class is used for managing keymaps + * for composing characters in LyX. + */ +class Intl { public: - /// + /// which keymap is currently used ? + enum Keymap { + PRIMARY, + SECONDARY + }; + Intl(); - /// - ~Intl(); - - /// show key mapping dialog - void MenuKeymap(); - /// - void KeyMapOn(bool on); - /// - void KeyMapPrim(); - /// - void KeyMapSec(); - /// turn on/off key mappings, status in keymapon - void ToggleKeyMap(); + /// {en/dis}able the keymap + void keyMapOn(bool on); - /// - int SetPrimary(string const &); + /// set the primary language keymap + void keyMapPrim(); - /// - int SetSecondary(string const &); + /// set the secondary language keymap + void keyMapSec(); + + /// turn on/off key mappings, status in keymapon + void toggleKeyMap(); /// initialize key mapper - void InitKeyMapper(bool on); + void initKeyMapper(bool on); -#if 0 - /// Get the Translation Manager - TransManager * getTrans(); -#else // Get the Translation Manager - TransManager & getTrans(); -#endif - /// - bool keymapon; - /// - bool primarykeymap; - /// - char * chsetcode; - /// - static void DispatchCallback(FL_OBJECT *, long); + TransManager & getTransManager(); + + /// using primary or secondary keymap ? + Keymap keymap; + 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; -#if 0 - /// - TransManager * trans; -#else - /// + /// 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; -#endif - /// Redraw connection. - Connection r_; }; -#if 0 inline -TransManager * Intl::getTrans() +TransManager & Intl::getTransManager() { return trans; } -#else -inline -TransManager & Intl::getTrans() -{ - return trans; -} -#endif -#endif + +} // namespace lyx + +#endif /* INTL_H */