Source

KVNS / Textbox.h

Full commit
#ifndef TEXTBOX_H
#define TEXTBOX_H

#include <QString>
#include <QLabel>
#include <QTimer>
#include <QHash>
#include <QApplication>

#define CTRL_IS_DOWN (QApplication::keyboardModifiers() & Qt::ControlModifier)

#include "Music.h"

class QPaintEvent;
class QKeyEvent;
class Textbox : public QLabel
{
	Q_OBJECT

public:
	Textbox();
	~Textbox();
	
	void setSpeech(const QString& name, const QString& text, const QString& sound, bool autoConf);
	void loadedText();

private slots:
	void nextLetter();

signals:
	void textFinished();

protected:
	void keyPressEvent(QKeyEvent* ev);
	void mousePressEvent(QMouseEvent* ev);

private:
	void stopText();
	bool m_nextIsStopped;
	
	QString m_name;
	QString m_text;
	QString m_tmpText;
	int m_pos;
	bool m_autoConf;
	QTimer * m_timer;
	Music * m_music;
};

#endif