]> git.lyx.org Git - lyx.git/blobdiff - src/trans.h
fix compiler warnings about unused parameter
[lyx.git] / src / trans.h
index 4b923e87e6e35289f9b986e4bef1dddb34955ef2..ce529a2b9f991c2d58bf850373d2e52e35dcdd86 100644 (file)
@@ -1,55 +1,34 @@
 // -*- C++ -*-
-#ifndef Trans_h
-#define Trans_h
+/**
+ * \file trans.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author Matthias Ettrich
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef TRANS_H
+#define TRANS_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "trans_decl.h"
 
 #include <map>
 
-#include "tex-accent.h"
-#include "LString.h"
-#include "trans_decl.h"
 
-class LyXLex;
+namespace lyx {
 
-class TransManager;
 
-#if 0
-/**
-  TransInterface: the interface that every translation class
-  should obey too.
-  Visitor pattern applied here
-  */
-class TransInterface {
-public:
-       ///
-       virtual string const process(char, TransManager &) = 0;
-       ///
-       virtual bool isAccentDefined(tex_accent, KmodInfo &) const = 0;
-};
+class LyXLex;
 
-/**
-  DefaultTrans: the default translation class. Holds info
-  on tex-accents. Monostate
-  */
-class DefaultTrans : public TransInterface {
-public:
-       ///
-       DefaultTrans();
-       ///
-       virtual string const process(char, TransManager &);
-private:
-       ///
-       static bool init_;
-};
-#endif
+class TransManager;
 
 /**
-  Trans: holds a .kmap file 
+  Trans: holds a .kmap file
   */
-//class Trans : public TransInterface {
 class Trans {
 public:
        ///
@@ -58,75 +37,54 @@ public:
        ~Trans();
 
        ///
-       int Load(string const & language);
+       int load(std::string const & language);
        ///
-       bool IsDefined() const;
+       bool isDefined() const;
        ///
-       string const & GetName() const;
+       std::string const & getName() const;
        ///
-       string const process(char, TransManager &);
+       std::string const process(char, TransManager &);
        ///
        bool isAccentDefined(tex_accent, KmodInfo &) const;
-    
+
 private:
-#if 0
-       ///
-       typedef KmodInfo kmod_list_decl;
-       ///
-       typedef KmodException keyexc;
-#endif
-#if 0
-       ///
-       void AddDeadkey(tex_accent, string const &, string const &);
-#else
        ///
-       void AddDeadkey(tex_accent, string const &);
-#endif
+       void addDeadkey(tex_accent, std::string const &);
        ///
-       void FreeKeymap();
+       void freeKeymap();
        ///
-       int Load(LyXLex &);
+       int load(LyXLex &);
        ///
-       inline string const & Match(unsigned char c);
+       std::string const & match(unsigned char c);
        ///
-       void InsertException(KmodException & exclist, char c,
-                            string const & data, bool = false,
+       void insertException(KmodException & exclist, char c,
+                            std::string const & data, bool = false,
                             tex_accent = TEX_NOACCENT);
        ///
-       void FreeException(KmodException & exclist);
+       void freeException(KmodException & exclist);
 
        ///
-       string name_;
-#if 0
+       std::string name_;
        ///
-       string keymap_[256];
-#else
-       std::map<int, string> keymap_;
-#endif
-#if 0
+       std::map<int, std::string> keymap_;
        ///
-       kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1];
-#else
-       ///
-       //KmodInfo * kmod_list_[TEX_MAX_ACCENT+1];
        std::map<int, KmodInfo> kmod_list_;
-#endif
 };
 
 
 ///
-string const & Trans::Match(unsigned char c)
+inline
+std::string const & Trans::match(unsigned char c)
 {
-#if 0
-       return keymap_[c];
-#else
-       std::map<int, string>::iterator it = keymap_.find(c);
+       std::map<int, std::string>::iterator it = keymap_.find(c);
        if (it != keymap_.end()) {
                return it->second;
        }
-       static string dummy;
+       static std::string dummy;
        return dummy;
-#endif
 }
 
-#endif 
+
+} // namespace lyx
+
+#endif // TRANS_H