Pimcommon

activitiesbasemanager.h
1/*
2 SPDX-FileCopyrightText: 2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "pimcommonactivities_export.h"
10#include <QObject>
11namespace KActivities
12{
13class Consumer;
14}
15namespace PimCommonActivities
16{
17class PIMCOMMONACTIVITIES_EXPORT ActivitiesBaseManager : public QObject
18{
19 Q_OBJECT
20public:
21 struct ActivitySettings {
22 QStringList activities;
23 bool enabled = false;
24 [[nodiscard]] bool contains(const QString &str) const;
25
26 void changeActivities(bool added, const QString &currentActivity);
27 };
28
29 explicit ActivitiesBaseManager(QObject *parent = nullptr);
30 ~ActivitiesBaseManager() override;
31 [[nodiscard]] virtual bool enabled() const = 0;
32
33 [[nodiscard]] bool isInCurrentActivity(const QStringList &lst) const;
34
35 [[nodiscard]] QString currentActivity() const;
36Q_SIGNALS:
37 void activitiesChanged();
38
39private:
40 KActivities::Consumer *const mActivitiesConsumer;
41};
42}
43PIMCOMMONACTIVITIES_EXPORT QDebug operator<<(QDebug d, const PimCommonActivities::ActivitiesBaseManager::ActivitySettings &t);
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.