AppleSAWS/src/applesoftfile/applesoftformatter.h

45 lines
886 B
C++

#ifndef APPLESOFTFORMATTER_H
#define APPLESOFTFORMATTER_H
#include <QObject>
#include <QFlags>
#include "applesoftfile.h"
class ApplesoftFormatter : public QObject
{
Q_OBJECT
public:
enum FormatOption {
NoOptions = 0x00,
FormatHTML = 0x01,
ShowCtrlChars = 0x02,
BreakAfterReturn = 0x04,
PrettyFlags = 0x07,
AllFlags = 0xffffffff
};
Q_DECLARE_FLAGS(FormatOptions, FormatOption)
public:
explicit ApplesoftFormatter(QObject *parent = 0);
void setFlags(FormatOptions options) { m_format_options = options; }
void setFile(ApplesoftFile *file);
QString formatText();
signals:
void newFile(ApplesoftFile *file);
public slots:
private:
FormatOptions m_format_options;
ApplesoftFile *m_file;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(ApplesoftFormatter::FormatOptions)
#endif // APPLESOFTFORMATTER_H