BuildLogViewer/DomModel.h
author John Kern <johnk@symbian.org>
Wed, 02 Sep 2009 19:04:26 -0700
changeset 1 8e9c5760ce6f
parent 0 bbe0af256f1b
permissions -rwxr-xr-x
working on a status view
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
 /****************************************************************************
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
 ** Contact: Nokia Corporation (qt-info@nokia.com)
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
 ** This file is part of the examples of the Qt Toolkit.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
 ** $QT_BEGIN_LICENSE:LGPL$
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
 ** Commercial Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
 ** Licensees holding valid Qt Commercial licenses may use this file in
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
 ** accordance with the Qt Commercial License Agreement provided with the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
 ** Software or, alternatively, in accordance with the terms contained in
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
 ** a written agreement between you and Nokia.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
 ** GNU Lesser General Public License Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
 ** Alternatively, this file may be used under the terms of the GNU Lesser
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
 ** General Public License version 2.1 as published by the Free Software
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
 ** Foundation and appearing in the file LICENSE.LGPL included in the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
 ** packaging of this file.  Please review the following information to
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
 ** ensure the GNU Lesser General Public License version 2.1 requirements
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
 ** In addition, as a special exception, Nokia gives you certain
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
 ** additional rights. These rights are described in the Nokia Qt LGPL
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
 ** package.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
 ** GNU General Public License Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
 ** Alternatively, this file may be used under the terms of the GNU
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
 ** General Public License version 3.0 as published by the Free Software
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
 ** Foundation and appearing in the file LICENSE.GPL included in the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
 ** packaging of this file.  Please review the following information to
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
 ** ensure the GNU General Public License version 3.0 requirements will be
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
 ** met: http://www.gnu.org/copyleft/gpl.html.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
 ** If you are unsure which license is appropriate for your use, please
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
 ** contact the sales department at http://www.qtsoftware.com/contact.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
 ** $QT_END_LICENSE$
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
 ****************************************************************************/
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
 #ifndef DOMMODEL_H
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
 #define DOMMODEL_H
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    44
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    45
 #include <QAbstractItemModel>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
 #include <QDomDocument>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
 #include <QModelIndex>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
 #include <QVariant>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    50
/*
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    51
  * This class encapsulates the DOM tree for the build output log and provides
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    52
  * an interface to the classes which presents it to the user.
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    53
  */
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    54
0
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    55
 class DomItem;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    56
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    57
 class DomModel : public QAbstractItemModel
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    58
 {
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    59
     Q_OBJECT
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    60
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    61
 public:
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    62
     DomModel(QDomDocument *document, QObject *parent = 0);
0
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    63
     ~DomModel();
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    64
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    65
     QVariant data(const QModelIndex &index, int role) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    66
     Qt::ItemFlags flags(const QModelIndex &index) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    67
     QVariant headerData(int section, Qt::Orientation orientation,
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    68
                         int role = Qt::DisplayRole) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    69
     QModelIndex index(int row, int column,
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    70
                       const QModelIndex &parent = QModelIndex()) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    71
     QModelIndex parent(const QModelIndex &child) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    72
     int rowCount(const QModelIndex &parent = QModelIndex()) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    73
     int columnCount(const QModelIndex &parent = QModelIndex()) const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    74
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    75
 private:
1
8e9c5760ce6f working on a status view
John Kern <johnk@symbian.org>
parents: 0
diff changeset
    76
     QDomDocument *domDocument;
0
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    77
     DomItem *rootItem;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    78
 };
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    79
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    80
#endif