File indexing completed on 2024-05-12 04:37:31

0001 /*
0002     SPDX-FileCopyrightText: 2020 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVELOPSESSIONSOBSERVER_H
0008 #define KDEVELOPSESSIONSOBSERVER_H
0009 
0010 // library
0011 #include <kdevelopsessionswatch_export.h>
0012 #include "kdevelopsessiondata.h"
0013 // Qt
0014 #include <QObject>
0015 #include <QVector>
0016 
0017 // The interface observers of list of existing KDevelop sessions should implement
0018 class KDEVELOPSESSIONSWATCH_EXPORT KDevelopSessionsObserver
0019 {
0020 public:
0021     virtual ~KDevelopSessionsObserver();
0022 
0023 public:
0024     /// Implement as a slot, as it will be called via QMetaObject::invokeMethod by a queued connection
0025     /// which ensures the update arrives in the event loop of the thread the object belongs to
0026     /// so the data update of the working copy is not e.g. happening during a paint operation
0027     /// @param sessionDataList sorted by id
0028     virtual void setSessionDataList(const QVector<KDevelopSessionData>& sessionDataList) = 0;
0029 };
0030 
0031 Q_DECLARE_INTERFACE(KDevelopSessionsObserver, "org.kdevelop.KDevelopSessionsObserver")
0032 
0033 #endif