File indexing completed on 2024-04-28 04:36:30

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_ISESSION_H
0008 #define KDEVPLATFORM_ISESSION_H
0009 
0010 #include "interfacesexport.h"
0011 
0012 #include <KSharedConfig>
0013 
0014 #include <QObject>
0015 #include <QUrl>
0016 
0017 class QUuid;
0018 class QString;
0019 
0020 namespace KDevelop
0021 {
0022 
0023 class IPlugin;
0024 
0025 /**
0026  * @class ISession
0027  */
0028 class KDEVPLATFORMINTERFACES_EXPORT ISession : public QObject
0029 {
0030     Q_OBJECT
0031 public:
0032     explicit ISession( QObject* parent = nullptr );
0033     ~ISession() override;
0034 
0035     /**
0036      * A short string nicely identifying the session, including contained projects
0037      * 
0038      * The string is empty if the session is empty and has no name.
0039      */
0040     virtual QString description() const = 0;
0041     virtual QString name() const = 0;
0042     virtual QList<QUrl> containedProjects() const = 0;
0043     virtual void setContainedProjects( const QList<QUrl>& projects ) = 0;
0044     virtual QUrl pluginDataArea( const IPlugin* ) = 0;
0045     virtual KSharedConfigPtr config() = 0;
0046     virtual QUuid id() const = 0;
0047 
0048     /**
0049      * Mark session as temporary. It will then be deleted on close.
0050      *
0051      * This is mainly useful for unit tests etc.
0052      */
0053     virtual void setTemporary(bool temp) = 0;
0054     virtual bool isTemporary() const = 0;
0055 
0056 Q_SIGNALS:
0057     void sessionUpdated( KDevelop::ISession* session );
0058 };
0059 
0060 }
0061 
0062 #endif
0063