/* * LCD Image Converter. Converts images and fonts for embedded applications. * Copyright (C) 2010 riuson * mailto: riuson@gmail.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see #include #include //----------------------------------------------------------------------------- #include "conversion_options.h" //----------------------------------------------------------------------------- class IDocument; class IDataContainer; class Preset; class Tags; class QImage; class ParsedImageData; //----------------------------------------------------------------------------- class Parser : public QObject { Q_OBJECT public: enum TemplateType { TypeImage, TypeFont }; Parser(TemplateType templateType, Preset *preset, QObject *parent); virtual ~Parser(); QString name(); QString convert(IDocument *document, Tags &tags) const; private: Preset *mPreset; QString mTemplateFileName; QString parse(const QString &templateString, Tags &tags, IDocument *doc, QMap *images) const; QString parseImagesTable(const QString &templateString, Tags &tags, IDocument *doc, QMap *images) const; QString hexCode(const QString &key, const QString &encoding, bool bom) const; void addMatrixInfo(Tags &tags) const; void addImagesInfo(Tags &tags, QMap *images) const; void prepareImages(IDocument *doc, QMap *images, const Tags &tags) const; bool findNextTag(int startIndex, int *resultIndex, Tags); void imageParticles(const QString &templateString, QString *prefix, QString *suffix) const; const QStringList sortKeysWithEncoding(const QStringList &keys, const QString &encoding, bool useBom, ConversionOptions::CharactersSortOrder order) const; }; //----------------------------------------------------------------------------- #endif // PARSER_H