File indexing completed on 2024-04-21 04:32:15

0001 /*
0002  * Copyright (C) 2010-2015 by Stephen Allewell
0003  * steve.allewell@gmail.com
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 2 of the License, or
0008  * (at your option) any later version.
0009  */
0010 
0011 #ifndef TextToolDlg_H
0012 #define TextToolDlg_H
0013 
0014 #include <QDialog>
0015 #include <QFont>
0016 #include <QString>
0017 
0018 #include "ui_TextTool.h"
0019 
0020 class QHideEvent;
0021 class QShowEvent;
0022 
0023 class TextToolDlg : public QDialog
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit TextToolDlg(QWidget *);
0029     virtual ~TextToolDlg() = default;
0030 
0031     QImage image();
0032 
0033 protected:
0034     virtual void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
0035     virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
0036 
0037 private slots:
0038     void on_TextToolFont_currentFontChanged(const QFont &);
0039     void on_TextToolSize_valueChanged(int);
0040     void on_TextToolText_textChanged(const QString &);
0041     void on_DialogButtonBox_accepted();
0042     void on_DialogButtonBox_rejected();
0043     void on_DialogButtonBox_helpRequested();
0044 
0045 private:
0046     Ui::TextTool ui;
0047 
0048     QFont m_font;
0049     int m_size;
0050     QString m_text;
0051 };
0052 
0053 #endif // TextToolDlg_H