Warning, file /office/calligra/libs/rdf/KoRdfSemanticTreeWidgetItem.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 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef RDF_KORDFSEMANTICTREEWIDGETITEM_H
0021 #define RDF_KORDFSEMANTICTREEWIDGETITEM_H
0022 
0023 #include "kordf_export.h"
0024 #include "RdfForward.h"
0025 // Qt
0026 #include <QObject>
0027 #include <QTreeWidgetItem>
0028 
0029 class QAction;
0030 class KoCanvasBase;
0031 
0032 
0033 /**
0034  * Code wishing to display a list of KoRdfSemanticItem objects can create TreeWidgetItems
0035  * using KoRdfSemanticItem::createQTreeWidgetItem().
0036  *
0037  * These tree widget items can in turn generate a context menu by calling the
0038  * actions() method. These actions are already setup to work on the underlying
0039  * KoRdfSemanticItem objects.
0040  *
0041  * @author Ben Martin <ben.martin@kogmbh.com>
0042  * @see KoRdfSemanticItem::createQTreeWidgetItem()
0043  * @see KoDocumentRdf
0044  */
0045 class KORDF_EXPORT KoRdfSemanticTreeWidgetItem : public QObject, public QTreeWidgetItem
0046 {
0047     Q_OBJECT
0048 protected:
0049     virtual QString uIObjectName() const = 0;
0050     void addApplyStylesheetActions(QWidget *parent, QList<QAction *> &actions, KoCanvasBase *host);
0051     QAction * createAction(QWidget *parent, KoCanvasBase *host, const QString &text);
0052 
0053 public:
0054     enum {
0055         ColName = 0,
0056         ColSize
0057     };
0058 
0059     explicit KoRdfSemanticTreeWidgetItem(QTreeWidgetItem *parent);
0060     virtual ~KoRdfSemanticTreeWidgetItem();
0061 
0062     /**
0063      * Get the underlying SemanticItem for this widget
0064      */
0065     virtual hKoRdfSemanticItem semanticItem() const = 0;
0066 
0067     virtual QList<QAction *> actions(QWidget *parent, KoCanvasBase *host = 0);
0068     virtual void insert(KoCanvasBase *host);
0069 
0070 public Q_SLOTS:
0071     virtual void edit();
0072 };
0073 #endif