00001 /*************************************************************************** 00002 * file klfbackend.h 00003 * This file is part of the KLatexFormula Project. 00004 * Copyright (C) 2007 by Philippe Faist 00005 * philippe.faist@bluewin.ch 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 ***************************************************************************/ 00022 00023 #ifndef KLFBACKEND_H 00024 #define KLFBACKEND_H 00025 00026 #include <qstring.h> 00027 #ifdef KLFBACKEND_QT4 00028 #include <QByteArray> 00029 #else 00030 #include <qmemarray.h> 00031 #endif 00032 #include <qimage.h> 00033 00034 00036 00057 00058 00066 class KLFBackend 00067 { 00068 public: 00069 00071 00073 struct klfSettings { 00074 QString tempdir; 00075 QString klfclspath; 00076 QString latexexec; 00077 QString dvipsexec; 00078 QString gsexec; 00079 QString epstopdfexec; 00081 int tborderoffset; 00082 int rborderoffset; 00083 int bborderoffset; 00084 int lborderoffset; 00085 }; 00086 00088 00090 struct klfInput { 00091 QString latex; 00092 QString mathmode; 00097 QString preamble; 00099 unsigned long fg_color; 00101 unsigned long bg_color; 00105 int dpi; 00107 }; 00108 00110 00112 struct klfOutput { 00113 int status; 00117 QString errorstr; 00120 QImage result; 00121 QByteArray pngdata; 00122 QByteArray epsdata; 00123 QByteArray pdfdata; 00124 }; 00125 00171 static klfOutput getLatexFormula(const klfInput& in, const klfSettings& settings); 00172 00173 00174 00175 private: 00176 KLFBackend(); 00177 00178 static void cleanup(QString tempfname); 00179 00180 }; 00181 00182 #endif
1.4.6