OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / libs / valgrind / xmlprotocol / stackmodel.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator Instrumentation Tools
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com)
8 **
9 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 **
11 **
12 ** GNU Lesser General Public License Usage
13 **
14 ** This file may be used under the terms of the GNU Lesser General Public
15 ** License version 2.1 as published by the Free Software Foundation and
16 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
17 ** Please review the following information to ensure the GNU Lesser General
18 ** Public License version 2.1 requirements will be met:
19 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
20 **
21 ** In addition, as a special exception, Nokia gives you certain additional
22 ** rights. These rights are described in the Nokia Qt LGPL Exception
23 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
24 **
25 ** Other Usage
26 **
27 ** Alternatively, this file may be used in accordance with the terms and
28 ** conditions contained in a signed written agreement between you and Nokia.
29 **
30 ** If you have questions regarding the use of this file, please contact
31 ** Nokia at qt-info@nokia.com.
32 **
33 **************************************************************************/
34
35 #ifndef LIBVALGRIND_PROTOCOL_STACKMODEL_H
36 #define LIBVALGRIND_PROTOCOL_STACKMODEL_H
37
38 #include "../valgrind_global.h"
39
40 #include <QtCore/QAbstractItemModel>
41
42 namespace Valgrind {
43 namespace XmlProtocol {
44
45 class Error;
46
47 class VALGRINDSHARED_EXPORT StackModel : public QAbstractItemModel
48 {
49     Q_OBJECT
50 public:
51     enum Column {
52         NameColumn=0,
53         FunctionNameColumn,
54         DirectoryColumn,
55         FileColumn,
56         LineColumn,
57         InstructionPointerColumn,
58         ObjectColumn,
59         ColumnCount
60     };
61
62     enum Role {
63         ObjectRole=Qt::UserRole,
64         FunctionNameRole,
65         DirectoryRole,
66         FileRole,
67         LineRole
68     };
69
70     explicit StackModel(QObject *parent=0);
71     ~StackModel();
72
73     QVariant data(const QModelIndex &index, int role) const;
74     QVariant headerData(int section, Qt::Orientation orientation, int role) const;
75     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
76     QModelIndex parent(const QModelIndex &child) const;
77     int rowCount(const QModelIndex &parent = QModelIndex()) const;
78     int columnCount(const QModelIndex &parent = QModelIndex()) const;
79
80     void clear();
81
82 public Q_SLOTS:
83     void setError(const Valgrind::XmlProtocol::Error &error);
84
85 private:
86     class Private;
87     Private *const d;
88 };
89
90 }
91 }
92
93 #endif // LIBVALGRIND_PROTOCOL_STACKMODEL_H