1
/* This file is part of the KDE libraries and the Kate part.
3
* Copyright (C) 2007 David Nolden <david.nolden.kdevelop@art-master.de>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public License
16
* along with this library; see the file COPYING.LIB. If not, write to
17
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#ifndef KATEARGUMENTHINTMODEL_H
22
#define KATEARGUMENTHINTMODEL_H
24
#include <QAbstractListModel>
25
#include "katecompletionmodel.h"
26
#include "expandingtree/expandingwidgetmodel.h"
28
class KateCompletionWidget;
30
class KateArgumentHintModel : public ExpandingWidgetModel {
33
KateArgumentHintModel( KateCompletionWidget* parent );
35
virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
37
virtual int rowCount ( const QModelIndex & parent ) const;
39
virtual int columnCount ( const QModelIndex & /*parent*/ ) const;
41
virtual QTreeView* treeView() const;
43
virtual bool indexIsItem(const QModelIndex& index) const;
45
void emitDataChanged( const QModelIndex& start, const QModelIndex& end );
47
//Returns the index in the source-model for an index within this model
48
QModelIndex mapToSource( const QModelIndex & proxyIndex ) const;
53
virtual int contextMatchQuality(const QModelIndex& row) const;
55
void parentModelReset();
57
void contentStateChanged(bool hasContent);
59
KateCompletionModel::Group* group() const;
60
KateCompletionModel* model() const;
62
QList<int> m_rows; //Maps rows to either a positive row-number in the source group, or to a negative number which indicates a label
64
KateCompletionWidget* m_parent;