summaryrefslogtreecommitdiff
path: root/src/main-view/FieldContentCodec.h
blob: 8a13dba74835763aaeac269ed8d48ffd48645c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef FIELD_CONTENT_CODEC_H
#define FIELD_CONTENT_CODEC_H

#include <QtCore>

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