OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggersourcepathmappingwidget.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
33 #ifndef DEBUGGERSOURCEPATHMAPPINGWIDGET_H
34 #define DEBUGGERSOURCEPATHMAPPINGWIDGET_H
35
36 #include <QtGui/QGroupBox>
37 #include <QtCore/QMap>
38 #include <QtCore/QPair>
39
40 QT_BEGIN_NAMESPACE
41 class QStandardItemModel;
42 class QTreeView;
43 class QLineEdit;
44 class QPushButton;
45 class QLineEdit;
46 class QModelIndex;
47 QT_END_NAMESPACE
48
49 namespace Utils {
50 class PathChooser;
51 }
52
53 namespace Debugger {
54 namespace Internal {
55 class SourcePathMappingModel;
56
57 class DebuggerSourcePathMappingWidget : public QGroupBox
58 {
59     Q_OBJECT
60 public:
61     typedef QMap<QString, QString> SourcePathMap;
62
63     explicit DebuggerSourcePathMappingWidget(QWidget *parent = 0);
64
65     SourcePathMap sourcePathMap() const;
66     void setSourcePathMap(const SourcePathMap &);
67
68     /* Merge settings for an installed Qt (unless another setting
69      * is already in the map. */
70     static SourcePathMap mergePlatformQtPath(const QString &qtInstallPath,
71                                              const SourcePathMap &in);
72
73 signals:
74
75 private slots:
76     void slotAdd();
77     void slotAddQt();
78     void slotRemove();
79     void slotCurrentRowChanged(const QModelIndex &,const QModelIndex &);
80     void slotEditSourceFieldChanged();
81     void slotEditTargetFieldChanged();
82
83 private:
84     void resizeColumns();
85     void updateEnabled();
86     QString editSourceField() const;
87     QString editTargetField() const;
88     void setEditFieldMapping(const QPair<QString, QString> &m);
89     int currentRow() const;
90     void setCurrentRow(int r);
91
92     SourcePathMappingModel *m_model;
93     QTreeView *m_treeView;
94     QPushButton *m_addButton;
95     QPushButton *m_addQtButton;
96     QPushButton *m_removeButton;
97     QLineEdit *m_sourceLineEdit;
98     Utils::PathChooser *m_targetChooser;
99 };
100
101 } // namespace Internal
102 } // namespace Debugger
103
104 #endif // DEBUGGERSOURCEPATHMAPPINGWIDGET_H