Back to index

scribus-ng  1.3.4.dfsg+svn20071115
textfilter.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef TEXTFILTER_H
00008 #define TEXTFILTER_H
00009 
00010 #include "pluginapi.h"
00011 #include "scribus.h"
00012 #include <prefscontext.h>
00013 #include "gtwriter.h"
00014 #include "tffilter.h"
00015 
00016 extern "C" PLUGIN_API void GetText(QString filename, QString encoding, bool textOnly, gtWriter *writer);
00017 
00018 extern "C" PLUGIN_API QString FileFormatName();
00019 
00020 extern "C" PLUGIN_API QStringList FileExtensions();
00021 
00022 class TextFilter
00023 {
00024 private:
00025        PrefsContext* prefs;
00026        QString text;
00027        QString encoding;
00028        QString filename;
00029        gtWriter* writer;
00030        std::vector<tfFilter*> *filters;
00031        void loadText();
00032        void toUnicode();
00033        void write();
00034        void replace(QString* text);
00035        void replaceHex(QString* text);
00036 public:
00037        TextFilter(const QString& fname, const QString& enc, gtWriter* w);
00038        ~TextFilter();
00039 };
00040 
00041 #endif // TEXTFILTER_H