2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-11 01:08:20 +01:00
|
|
|
|
|
|
|
#include <QRect>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <QString>
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-01-11 01:08:20 +01:00
|
|
|
class Word;
|
|
|
|
|
|
|
|
class WordPart
|
|
|
|
{
|
|
|
|
public:
|
2017-12-23 21:18:13 +01:00
|
|
|
WordPart(Word &getWord, int getX, int getY, float scale, int _lineNumber,
|
|
|
|
const QString &getCopyText, bool allowTrailingSpace = true);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
WordPart(Word &getWord, int getX, int getY, int getWidth, int getHeight, int _lineNumber,
|
2017-09-21 02:20:02 +02:00
|
|
|
const QString &getCopyText, const QString &customText, bool allowTrailingSpace = true,
|
|
|
|
int wordCharOffset = 0);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
const Word &getWord() const;
|
|
|
|
int getWidth() const;
|
|
|
|
int getHeight() const;
|
|
|
|
int getX() const;
|
|
|
|
int getY() const;
|
|
|
|
void setPosition(int _x, int _y);
|
|
|
|
void setY(int _y);
|
|
|
|
int getRight() const;
|
|
|
|
int getBottom() const;
|
|
|
|
QRect getRect() const;
|
|
|
|
const QString getCopyText() const;
|
|
|
|
int hasTrailingSpace() const;
|
|
|
|
const QString &getText() const;
|
2017-09-12 19:06:16 +02:00
|
|
|
int getLineNumber() const;
|
|
|
|
int getCharacterLength() const;
|
2017-12-23 21:18:13 +01:00
|
|
|
short getCharWidth(int index, float scale) const;
|
2017-02-17 23:51:35 +01:00
|
|
|
|
2017-01-11 01:08:20 +01:00
|
|
|
private:
|
2017-09-21 12:15:01 +02:00
|
|
|
Word &word;
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
QString copyText;
|
|
|
|
QString text;
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int width;
|
|
|
|
int height;
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
int lineNumber;
|
2017-02-17 23:51:35 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
bool _trailingSpace;
|
2017-09-21 02:20:02 +02:00
|
|
|
int wordCharOffset;
|
2017-01-11 01:08:20 +01:00
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace messages
|
|
|
|
} // namespace chatterino
|