File indexing completed on 2024-05-05 04:40:57

0001 /*
0002     SPDX-FileCopyrightText: 2008 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_PLUGIN_TOOLVIEWDATA_H
0008 #define KDEVPLATFORM_PLUGIN_TOOLVIEWDATA_H
0009 
0010 #include <outputview/ioutputview.h>
0011 
0012 #include <QObject>
0013 #include <QMap>
0014 
0015 namespace Sublime
0016 {
0017 class View;
0018 }
0019 
0020 class QAbstractItemModel;
0021 class StandardOutputView;
0022 class ToolViewData;
0023 
0024 class OutputData : public QObject
0025 {
0026 Q_OBJECT
0027 public:
0028     explicit OutputData( ToolViewData* tv );
0029     QAbstractItemDelegate* delegate;
0030     QAbstractItemModel* model;
0031     ToolViewData* toolView;
0032     KDevelop::IOutputView::Behaviours behaviour;
0033     QString title;
0034     int id;
0035     void setModel( QAbstractItemModel* model );
0036     void setDelegate( QAbstractItemDelegate* delegate );
0037 Q_SIGNALS:
0038     void modelChanged( int );
0039     void delegateChanged( int );
0040 };
0041 
0042 class ToolViewData : public QObject
0043 {
0044 Q_OBJECT
0045 public:
0046     explicit ToolViewData( QObject* parent );
0047     ~ToolViewData() override;
0048     OutputData* addOutput( int id, const QString& title, KDevelop::IOutputView::Behaviours behave );
0049     // If we would adhere to model-view-separation strictly, then this member would move into standardoutputview, but it is more convenient this way.
0050     // TODO: move into standardoutputview
0051     mutable QList<Sublime::View*> views;
0052     StandardOutputView* plugin;
0053     QMap<int, OutputData*> outputdata;
0054     KDevelop::IOutputView::ViewType type;
0055     QByteArray configSubgroupName;
0056     QString title;
0057     QIcon icon;
0058     int toolViewId;
0059     KDevelop::IOutputView::Options option;
0060     QList<QAction*> actionList;
0061 Q_SIGNALS:
0062     void outputAdded( int );
0063 };
0064 
0065 #endif