2
* This file is part of the qx11grab project
4
* Copyright (C) Juergen Heinemann (Undefined) http://qx11grab.hjcms.de, (C) 2007-2012
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Library General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Library General Public License for more details.
16
* You should have received a copy of the GNU Library General Public License
17
* along with this library; see the file COPYING.LIB. If not, write to
18
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
22
#ifndef QX11GRAB_DRAWTEXT_H
23
#define QX11GRAB_DRAWTEXT_H
26
#include <QtCore/QObject>
27
#include <QtCore/QSettings>
28
#include <QtCore/QString>
29
#include <QtCore/QVariant>
32
#include <QtGui/QColor>
33
#include <QtGui/QComboBox>
34
#include <QtGui/QDialog>
35
#include <QtGui/QFont>
36
#include <QtGui/QIcon>
37
#include <QtGui/QLineEdit>
38
#include <QtGui/QSpinBox>
39
#include <QtGui/QSlider>
40
#include <QtGui/QWidget>
47
class Q_DECL_EXPORT drawtext : public QDialog
50
Q_CLASSINFO ( "Author", "Jürgen Heinemann (Undefined)" )
51
Q_CLASSINFO ( "URL", "http://qx11grab.hjcms.de" )
55
void setSettings ( const QString &key, const QVariant &value );
56
const QVariant settingsValue ( const QString &key, const QVariant &defaultValue = QVariant() );
59
/** types for color dialog */
60
enum ColorType { BACKGROUND, FOREGROUND, TEXTSHADOW };
62
/** drawed Text previewer */
63
FontPreview* m_fontPreview;
65
/** groubox for shadow configuration */
66
DropShadowBox* m_dropShadowBox;
68
/** color preview label for drawed text */
69
ColorPreview* m_foregroundPreview;
71
/** color preview label for background */
72
ColorPreview* m_backgroundPreview;
74
/** set drawed text Position */
75
TextPosition* m_textPosition;
77
/** icon for combobox items */
80
/** current selected font */
83
/** absolute fontfile path */
87
QComboBox* m_fontComboBox;
90
QLineEdit* m_textInputEdit;
92
/** slider for font size */
93
QSlider* m_sliderSize;
95
/** filter commandline */
96
QLineEdit* m_lineEditOutput;
98
/** freetype fontfile path */
104
/** preview background color */
107
/** text shadow color */
110
/** get all .ttf files in fontconfig database */
111
void initFontConfigDatabase();
113
/** open qcolordialog and set type */
114
void openColorChooser ( ColorType type );
117
/** combobox items changed */
118
void fontIndexChanged ( int );
120
/** Slider Size Changed */
121
void fontSizeChanged ( int );
123
/** set previewer background color */
124
void setBackgroundColor();
126
/** set text color */
127
void setForegroundColor();
129
/** set shadow color */
130
void setShadowColor();
132
/** set shadow x, y offset */
133
void setShadowOffset ( int );
135
/** set shadow alpha */
136
void setShadowAlpha ( int );
138
/** update the commandline and all previewers */
141
/** copy dataset into clipboard */
145
explicit drawtext ( QWidget * parent = 0 );
147
/** initial fontconfig and start dialog */
150
/** filter commandline */
151
Q_SCRIPTABLE const QString data();