Nepomuk
simpleresourcemodel.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the Nepomuk KDE project. 00003 Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) version 3, or any 00009 later version accepted by the membership of KDE e.V. (or its 00010 successor approved by the membership of KDE e.V.), which shall 00011 act as a proxy defined in Section 6 of version 3 of the license. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef _NEPOMUK_SIMPLE_RESOURCE_MODEL_H_ 00023 #define _NEPOMUK_SIMPLE_RESOURCE_MODEL_H_ 00024 00025 #include "resourcemodel.h" 00026 00027 #include "nepomukutils_export.h" 00028 00029 #include "resource.h" 00030 #include "result.h" 00031 00032 #include <QtCore/QList> 00033 00034 namespace Nepomuk { 00035 namespace Utils { 00047 class NEPOMUKUTILS_EXPORT SimpleResourceModel : public ResourceModel 00048 { 00049 Q_OBJECT 00050 00051 public: 00055 SimpleResourceModel( QObject* parent = 0 ); 00056 00060 ~SimpleResourceModel(); 00061 00068 QModelIndex indexForResource( const Resource& res ) const; 00069 00076 Resource resourceForIndex( const QModelIndex& index ) const; 00077 00081 int rowCount( const QModelIndex& parent = QModelIndex() ) const; 00082 00086 QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const; 00087 00091 bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); 00092 00093 public Q_SLOTS: 00097 void setResources( const QList<Nepomuk::Resource>& resources ); 00098 00103 void addResources( const QList<Nepomuk::Resource>& resources ); 00104 00109 void addResource( const Nepomuk::Resource& resource ); 00110 00116 void setResults( const QList<Nepomuk::Query::Result>& results ); 00117 00123 void addResults( const QList<Nepomuk::Query::Result>& results ); 00124 00130 void addResult( const Nepomuk::Query::Result result ); 00131 00135 void clear(); 00136 00137 private: 00138 class Private; 00139 Private* const d; 00140 }; 00141 } 00142 } 00143 00144 #endif
KDE 4.7 API Reference