OSDN Git Service

It's 2011 now.
[qt-creator-jp/qt-creator-jp.git] / src / libs / qmleditorwidgets / contextpanetextwidget.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef CONTEXTPANETEXTWIDGET_H
35 #define CONTEXTPANETEXTWIDGET_H
36
37 #include <qmleditorwidgets_global.h>
38 #include <QWidget>
39 #include <QVariant>
40
41 QT_BEGIN_NAMESPACE
42 namespace Ui {
43     class ContextPaneTextWidget;
44 }
45 QT_END_NAMESPACE
46
47 namespace QmlJS {
48     class PropertyReader;
49 }
50
51 namespace QmlEditorWidgets {
52
53 class CustomColorDialog;
54
55 class QMLEDITORWIDGETS_EXPORT ContextPaneTextWidget : public QWidget
56 {
57     Q_OBJECT
58
59 public:
60     explicit ContextPaneTextWidget(QWidget *parent = 0);
61     ~ContextPaneTextWidget();
62     void setProperties(QmlJS::PropertyReader *propertyReader);
63     void setVerticalAlignmentVisible(bool);
64     void setStyleVisible(bool);
65
66 public slots:
67     void onTextColorButtonToggled(bool);
68     void onColorButtonToggled(bool);
69     void onColorDialogApplied(const QColor &color);
70     void onColorDialogCancled();
71     void onFontSizeChanged(int value);
72     void onFontFormatChanged();
73     void onBoldCheckedChanged(bool value);
74     void onItalicCheckedChanged(bool value);
75     void onUnderlineCheckedChanged(bool value);
76     void onStrikeoutCheckedChanged(bool value);
77     void onCurrentFontChanged(const QFont &font);
78     void onHorizontalAlignmentChanged();
79     void onVerticalAlignmentChanged();
80     void onStyleComboBoxChanged(const QString &style);
81
82
83 signals:
84     void propertyChanged(const QString &, const QVariant &);
85     void removeProperty(const QString &);
86     void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool removeFirst);
87
88 protected:
89     void changeEvent(QEvent *e);
90     void timerEvent(QTimerEvent *event);
91
92 private:
93     Ui::ContextPaneTextWidget *ui;
94     QString m_verticalAlignment;
95     QString m_horizontalAlignment;
96     int m_fontSizeTimer;
97 };
98
99 } //QmlDesigner
100
101 #endif // CONTEXTPANETEXTWIDGET_H