1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 12:22:34 +01:00
openrw/rwviewer/views/TextViewer.hpp

65 lines
1.3 KiB
C++
Raw Normal View History

2017-09-07 19:03:18 +02:00
#ifndef _TEXTVIEWER_HPP_
#define _TEXTVIEWER_HPP_
#include "ViewerInterface.hpp"
#include <fonts/GameTexts.hpp>
#include <rw/filesystem.hpp>
#include <QTableView>
#include <vector>
class TextModel;
class ViewerWidget;
class QLayout;
class QItemSelection;
class QLineEdit;
class QTextEdit;
class QModelIndex;
class QString;
class QWidget;
class TextTableView : public QTableView {
Q_OBJECT
protected slots:
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
signals:
void gameStringChanged(const GameString &string);
};
class TextViewer : public ViewerInterface {
Q_OBJECT
TextModel *textModel;
TextTableView *textTable;
ViewerWidget *viewerWidget;
QLineEdit *hexLineEdit;
QTextEdit *textEdit;
2018-08-30 02:19:38 +02:00
void worldChanged() override;
2017-09-07 19:03:18 +02:00
GameString currentGameString;
font_t currentFont;
int currentFontSize;
void updateRender();
void setGameString(const GameString &gameString);
std::vector<std::string> getFontTextureNames();
public:
TextViewer(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
2017-09-07 19:03:18 +02:00
signals:
void fontChanged(font_t font);
private slots:
void onGameStringChange(const GameString &gameString);
void onStringChange();
void onFontChange(size_t font);
void onFontSizeChange(int font);
};
#endif