AppleSAWS/src/ui/viewers/applesoftfileviewer.h

75 lines
1.8 KiB
C
Raw Normal View History

2015-12-05 03:45:27 +00:00
#ifndef APPLESOFTFILEVIEWER_H
#define APPLESOFTFILEVIEWER_H
#include <QWidget>
2016-10-15 15:13:53 +00:00
#include <QMenu>
#include <QAction>
#include "applesoftfile.h"
#include "applesoftformatter.h"
#include "viewerbase.h"
#include "applesoftfiledetailviewer.h"
2015-12-05 03:45:27 +00:00
namespace Ui {
class ApplesoftFileViewer;
}
class ApplesoftFileViewer : public FileViewerInterface
2015-12-05 03:45:27 +00:00
{
Q_OBJECT
public:
typedef enum {
ForceReformat,
NoReformat
} ReformatRule;
ApplesoftFileViewer(QWidget *parent = 0);
2015-12-05 03:45:27 +00:00
~ApplesoftFileViewer();
2016-10-15 15:13:53 +00:00
virtual bool optionsMenuItems(QMenu *menu);
virtual bool canPrint() const;
bool canExport() const;
2015-12-05 03:45:27 +00:00
public slots:
void setFile(GenericFile *file);
void setFile(ApplesoftFile *m_file);
2015-12-05 03:45:27 +00:00
void setData(QByteArray data);
void setText(QString text);
void findText();
void doPrint();
void doExport();
2015-12-05 03:45:27 +00:00
protected slots:
2016-10-15 21:01:26 +00:00
void toggleWordWrap(bool enabled);
void setSyntaxHighlighting(bool enabled, ReformatRule reformat = ForceReformat);
void setIndentCode(bool enabled, ReformatRule reformat = ForceReformat);
void setIntsAsHex(bool enabled, ReformatRule reformat = ForceReformat);
void setBreakAfterReturn(bool enabled, ReformatRule reformat = ForceReformat);
void setShowCtrlChars(bool enabled, ReformatRule reformat = ForceReformat);
void launchVarBrowser();
void reformatText();
2015-12-05 03:45:27 +00:00
private:
2016-10-15 15:13:53 +00:00
bool makeMenuOptions(QMenu *menu);
ApplesoftFile *m_file;
ApplesoftFormatter *m_formatter;
bool m_isFirstFind;
2015-12-05 03:45:27 +00:00
Ui::ApplesoftFileViewer *ui;
ApplesoftFileDetailViewer *m_afdv;
2016-10-29 21:28:25 +00:00
QAction *m_showIntsAction;
QAction *m_reindentCodeAction;
QAction *m_blankAfterReturnsAction;
QAction *m_syntaxHighlightingAction;
QAction *m_showVarExplorerAction;
QAction *m_wordWrapAction;
QAction *m_showCtrlCharsAction;
2015-12-05 03:45:27 +00:00
};
#endif // APPLESOFTFILEVIEWER_H