SciDAVis  1.D4
TextDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : TextDialog.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7  Description : Text label/axis label options dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 
30 #ifndef TEXTDLG_H
31 #define TEXTDLG_H
32 
33 #include <QDialog>
34 class QGroupBox;
35 class QTextEdit;
36 class QTextCursor;
37 class QComboBox;
38 class QLabel;
39 class QSpinBox;
40 
41 #include "ColorButton.h"
42 #include "TextFormatButtons.h"
43 
45 class TextDialog : public QDialog
46 {
47  Q_OBJECT
48 
49 public:
51  enum TextType{
54  };
55 
57 
62  TextDialog(TextType type, QWidget* parent = 0, Qt::WFlags fl = 0 );
65 
67 
70  int alignment();
72  int angle();
73 
74 public slots:
76 
82  void setBackgroundType(int bkg);
84  void setAngle(int angle);
86  void setBackgroundColor(QColor c);
88  void setTextColor(QColor c);
90  void setFont(const QFont& fnt);
92  void setText(const QString & t);
94 
98  void setAlignment(int align);
99 
100 private slots:
102  void customFont();
104  void pickBackgroundColor();
106  void pickTextColor();
108  void accept();
110  void apply();
111  void setDefaultValues();
112 
113  void updateTransparency(int alpha);
114 
115 signals:
117 
125  void values(const QString& text, int angle, int bkg, const QFont& fnt, const QColor& textColor, const QColor& backgroundColor);
126 
128  void changeText(const QString &);
130  void changeColor(const QColor &);
132  void changeAlignment(int);
134  void changeFont(const QFont &);
135 
136 protected:
140 
142  QPushButton *buttonFont;
143  QComboBox *backgroundBox;
144  QPushButton *buttonOk;
145  QPushButton *buttonCancel;
146  QPushButton *buttonApply;
147  QPushButton *buttonDefault;
148  QComboBox *rotateBox;
149  QTextEdit *textEditBox;
150  QGroupBox *groupBox1, *groupBox2;
151  QComboBox *alignmentBox;
154 };
155 
156 #endif // TEXTDLG_H