File indexing completed on 2024-04-14 15:17:42

0001 /*
0002  *
0003  * Copyright (C) 2004  Simon Martin <simartin@users.sourceforge.net>
0004  *
0005  * This program is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU General Public License as
0007  * published by the Free Software Foundation; either version 2 of
0008  * the License, or (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  *
0018  */
0019 
0020 #ifndef _PLAINTOLATEXCONVERTER_H_
0021 #define _PLAINTOLATEXCONVERTER_H_
0022 
0023 #include <qmap.h>
0024 #include <QString>
0025 
0026 /**
0027  * A class that replaces the selection in the document (plain text) by its
0028  * "LaTeX version" (ie. "_" -> "\_", "%" -> "\%"...).
0029  */
0030 class PlainToLaTeXConverter
0031 {
0032 public:
0033     PlainToLaTeXConverter();
0034     ~PlainToLaTeXConverter();
0035 
0036     QString ConvertToLaTeX(const QString&) const;
0037 
0038 private:
0039     QMap<QChar, QString> m_replaceMap;
0040 };
0041 
0042 #endif /* _PLAINTOLATEXCONVERTER_H_ */