Warning, file /office/calligra/libs/rdf/KoRdfSemanticTree.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (C) 2010 KO GmbH <ben.martin@kogmbh.com> 0003 Copyright (C) 2010 Thomas Zander <zander@kde.org> 0004 0005 This library is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU Library General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License, or (at your option) any later version. 0009 0010 This library is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 Library General Public License for more details. 0014 0015 You should have received a copy of the GNU Library General Public License 0016 along with this library; see the file COPYING.LIB. If not, write to 0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef __rdf_KoRdfSemanticTree_h__ 0022 #define __rdf_KoRdfSemanticTree_h__ 0023 0024 #include "kordf_export.h" 0025 // Qt 0026 #include <QSharedPointer> 0027 #include <QTreeWidget> 0028 #include <QTreeWidgetItem> 0029 0030 class KoDocumentRdf; 0031 class KoRdfSemanticTreePrivate; 0032 0033 namespace Soprano { 0034 class Model; 0035 } 0036 /** 0037 * @short Manage a QTreeWidget showing a collection of Semantic Items 0038 * @author Ben Martin <ben.martin@kogmbh.com> 0039 * 0040 * Because a tree viewing people, places, events etc "Semantic Objects" 0041 * is created and updated in multiple places, it makes sense to collect 0042 * the code handling it into a central location for easy global updates. 0043 */ 0044 class KORDF_EXPORT KoRdfSemanticTree 0045 { 0046 public: 0047 KoRdfSemanticTree(); 0048 explicit KoRdfSemanticTree(QTreeWidget *tree); 0049 KoRdfSemanticTree(const KoRdfSemanticTree &orig); 0050 KoRdfSemanticTree &operator=(const KoRdfSemanticTree &other); 0051 ~KoRdfSemanticTree(); 0052 0053 /** 0054 * Setup the TreeWidget with a default sorting order etc and 0055 * initialize the people, events and locations base tree Items. 0056 */ 0057 static KoRdfSemanticTree createTree(QTreeWidget *v); 0058 0059 /** 0060 * Update the Items shown in the tree to reflect the Rdf in the 0061 * given model. if the model is not passed in then any Rdf in the 0062 * KoDocumentRdf is used to populate the tree. 0063 */ 0064 void update(KoDocumentRdf *rdf, QSharedPointer<Soprano::Model> model = QSharedPointer<Soprano::Model>(0)); 0065 0066 private: 0067 QExplicitlySharedDataPointer<KoRdfSemanticTreePrivate> d; 0068 }; 0069 0070 #endif 0071 0072