OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qtoptionspage.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 (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32 #ifndef QTOPTIONSPAGE_H
33 #define QTOPTIONSPAGE_H
34
35 #include "debugginghelperbuildtask.h"
36
37 #include <coreplugin/dialogs/ioptionspage.h>
38
39 #include <QtCore/QSharedPointer>
40 #include <QtCore/QFutureInterface>
41
42 #include <QtGui/QWidget>
43
44 QT_BEGIN_NAMESPACE
45 class QTreeWidgetItem;
46 QT_END_NAMESPACE
47
48 namespace Qt4ProjectManager {
49
50 class QtVersion;
51
52 namespace Internal {
53 namespace Ui {
54 class QtVersionManager;
55 class QtVersionInfo;
56 class DebuggingHelper;
57 }
58
59 class QtOptionsPageWidget : public QWidget
60 {
61     Q_OBJECT
62     Q_DISABLE_COPY(QtOptionsPageWidget)
63 public:
64     QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> versions);
65     ~QtOptionsPageWidget();
66     QList<QtVersion *> versions() const;
67     void finish();
68     QString searchKeywords() const;
69
70     virtual bool eventFilter(QObject *o, QEvent *e);
71
72 private:
73     void showEnvironmentPage(QTreeWidgetItem * item);
74     void fixQtVersionName(int index);
75     int indexForTreeItem(const QTreeWidgetItem *item) const;
76     QTreeWidgetItem *treeItemForIndex(int index) const;
77     QtVersion *currentVersion() const;
78     int currentIndex() const;
79
80     const QString m_specifyNameString;
81     const QString m_specifyPathString;
82
83     Internal::Ui::QtVersionManager *m_ui;
84     Internal::Ui::QtVersionInfo *m_versionUi;
85     Internal::Ui::DebuggingHelper *m_debuggingHelperUi;
86     QList<QtVersion *> m_versions;
87     int m_defaultVersion;
88
89 private slots:
90     void versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old);
91     void addQtDir();
92     void removeQtDir();
93     void updateState();
94     void makeS60Visible(bool visible);
95     void onQtBrowsed();
96     void updateCurrentQtName();
97     void updateCurrentQMakeLocation();
98     void updateCurrentS60SDKDirectory();
99     void updateCurrentSbsV2Directory();
100     void updateDebuggingHelperUi();
101     void buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools
102                               = DebuggingHelperBuildTask::AllTools);
103     void buildGdbHelper();
104     void buildQmlDump();
105     void buildQmlDebuggingLibrary();
106     void buildQmlObserver();
107     void slotShowDebuggingBuildLog();
108     void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools);
109
110 private:
111     void updateDescriptionLabel();
112     void showDebuggingBuildLog(const QTreeWidgetItem *currentItem);
113 };
114
115 class QtOptionsPage : public Core::IOptionsPage
116 {
117     Q_OBJECT
118 public:
119     QtOptionsPage();
120     QString id() const;
121     QString displayName() const;
122     QString category() const;
123     QString displayCategory() const;
124     QIcon categoryIcon() const;
125     QWidget *createPage(QWidget *parent);
126     void apply();
127     void finish() {}
128     virtual bool matches(const QString &) const;
129
130 private:
131     QtOptionsPageWidget *m_widget;
132     QString m_searchKeywords;
133 };
134
135 } //namespace Internal
136 } //namespace Qt4ProjectManager
137
138
139 #endif // QTOPTIONSPAGE_H