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>
|
|
|
|
|
2015-12-14 10:48:19 +00:00
|
|
|
#include "applesoftfile.h"
|
|
|
|
#include "applesoftformatter.h"
|
2016-10-14 22:27:28 +00:00
|
|
|
#include "viewerbase.h"
|
2016-10-30 16:59:03 +00:00
|
|
|
#include "applesoftfiledetailviewer.h"
|
|
|
|
|
2015-12-05 03:45:27 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ApplesoftFileViewer;
|
|
|
|
}
|
|
|
|
|
2016-10-14 22:27:28 +00:00
|
|
|
class ApplesoftFileViewer : public FileViewerInterface
|
2015-12-05 03:45:27 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-10-25 03:53:35 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ForceReformat,
|
|
|
|
NoReformat
|
|
|
|
} ReformatRule;
|
|
|
|
|
2016-10-14 22:27:28 +00:00
|
|
|
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);
|
2016-10-14 22:27:28 +00:00
|
|
|
|
2016-10-24 18:37:37 +00:00
|
|
|
virtual bool canPrint() const;
|
|
|
|
|
|
|
|
bool canExport() const;
|
2016-10-25 03:53:35 +00:00
|
|
|
|
2015-12-05 03:45:27 +00:00
|
|
|
public slots:
|
2016-10-24 18:37:37 +00:00
|
|
|
void setFile(GenericFile *file);
|
2015-12-14 10:48:19 +00:00
|
|
|
void setFile(ApplesoftFile *m_file);
|
2015-12-05 03:45:27 +00:00
|
|
|
void setData(QByteArray data);
|
|
|
|
void setText(QString text);
|
2016-07-05 13:35:38 +00:00
|
|
|
void findText();
|
2016-10-24 18:37:37 +00:00
|
|
|
void doPrint();
|
|
|
|
void doExport();
|
2015-12-05 03:45:27 +00:00
|
|
|
|
2016-10-12 22:52:13 +00:00
|
|
|
protected slots:
|
2016-10-15 21:01:26 +00:00
|
|
|
void toggleWordWrap(bool enabled);
|
2016-10-29 22:21:49 +00:00
|
|
|
void setSyntaxHighlighting(bool enabled, ReformatRule reformat = ForceReformat);
|
2016-10-25 03:53:35 +00:00
|
|
|
void setIndentCode(bool enabled, ReformatRule reformat = ForceReformat);
|
|
|
|
void setIntsAsHex(bool enabled, ReformatRule reformat = ForceReformat);
|
2016-10-29 21:10:54 +00:00
|
|
|
void setBreakAfterReturn(bool enabled, ReformatRule reformat = ForceReformat);
|
2016-10-29 23:11:42 +00:00
|
|
|
void setShowCtrlChars(bool enabled, ReformatRule reformat = ForceReformat);
|
2016-10-12 22:52:13 +00:00
|
|
|
void launchVarBrowser();
|
2016-10-13 21:18:46 +00:00
|
|
|
void reformatText();
|
2016-10-12 22:52:13 +00:00
|
|
|
|
2015-12-05 03:45:27 +00:00
|
|
|
private:
|
2016-10-15 15:13:53 +00:00
|
|
|
bool makeMenuOptions(QMenu *menu);
|
|
|
|
|
2015-12-14 10:48:19 +00:00
|
|
|
ApplesoftFile *m_file;
|
|
|
|
ApplesoftFormatter *m_formatter;
|
2016-07-05 13:35:38 +00:00
|
|
|
bool m_isFirstFind;
|
2015-12-05 03:45:27 +00:00
|
|
|
Ui::ApplesoftFileViewer *ui;
|
2016-10-30 16:59:03 +00:00
|
|
|
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;
|
2016-10-29 23:11:42 +00:00
|
|
|
QAction *m_showCtrlCharsAction;
|
2015-12-05 03:45:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPLESOFTFILEVIEWER_H
|