parley
basiccontainermodel.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 00003 Copyright 2007-2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 00004 00005 ***************************************************************************/ 00006 00007 /*************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef BASICCONTAINERMODEL_H 00017 #define BASICCONTAINERMODEL_H 00018 00019 #include <QAbstractItemModel> 00020 #include <QModelIndex> 00021 00022 #include <QObject> 00023 00024 #include <keduvocdocument.h> 00025 #include <keduvoclesson.h> 00026 00032 class BasicContainerModel : public QAbstractItemModel 00033 { 00034 Q_OBJECT 00035 00036 public: 00037 explicit BasicContainerModel(KEduVocContainer::EnumContainerType type, QObject *parent = 0); 00038 00039 virtual QVariant data(const QModelIndex &index, int role) const; 00040 virtual Qt::ItemFlags flags(const QModelIndex &index) const; 00041 00042 QModelIndex index(int row, int column, 00043 const QModelIndex &parent = QModelIndex()) const; 00044 00045 QModelIndex index(KEduVocContainer* container) const; 00046 00047 QModelIndex parent(const QModelIndex &index) const; 00048 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 00049 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 00050 00051 KEduVocContainer::EnumContainerType containerType(); 00052 00053 public slots: 00056 void setDocument(KEduVocDocument *doc); 00057 00058 protected: 00059 virtual KEduVocContainer *rootContainer() const = 0; 00060 KEduVocContainer::EnumContainerType m_type; 00061 KEduVocDocument *m_doc; 00062 }; 00063 00064 00065 #endif
KDE 4.2 API Reference