From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/main-view/FieldContentCodec.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main-view/FieldContentCodec.h (limited to 'src/main-view/FieldContentCodec.h') diff --git a/src/main-view/FieldContentCodec.h b/src/main-view/FieldContentCodec.h new file mode 100644 index 0000000..8a13dba --- /dev/null +++ b/src/main-view/FieldContentCodec.h @@ -0,0 +1,28 @@ +#ifndef FIELD_CONTENT_CODEC_H +#define FIELD_CONTENT_CODEC_H + +#include + +class FieldContentPainter; + +class FieldContentCodec +{ +public: + FieldContentCodec(FieldContentPainter* painter); + void parse(const QString& text); + +private: + void initLoopParams(); + int findNextImage(); + void drawTextChunk(int len); + void drawImage(); + +private: + FieldContentPainter* painter; + QString text; + QRegExp imageRx; + int textPos; + int prevTextPos; +}; +#endif + -- cgit