File indexing completed on 2024-12-08 10:56:34

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 */
0006 
0007 #ifndef ACTIVITYDATA_H
0008 #define ACTIVITYDATA_H
0009 
0010 //! local
0011 #include "genericdata.h"
0012 #include "generictable.h"
0013 
0014 //! Qt
0015 #include <QMetaType>
0016 #include <QIcon>
0017 #include <QString>
0018 
0019 //! KActivities
0020 #include <KActivities/Info>
0021 
0022 namespace Latte {
0023 namespace Data {
0024 
0025 class Activity : public Generic
0026 {
0027 public:
0028     Activity();
0029     Activity(Activity &&o);
0030     Activity(const Activity &o);
0031 
0032     //! Layout data
0033     bool isCurrent{false};
0034     QString icon;
0035     KActivities::Info::State state;
0036 
0037     bool isValid() const;
0038     bool isRunning() const;
0039 
0040     //! Operators
0041     Activity &operator=(const Activity &rhs);
0042     Activity &operator=(Activity &&rhs);
0043 };
0044 
0045 //! This is an Activities map in the following structure:
0046 //! #activityId -> activite_information
0047 typedef GenericTable<Data::Activity> ActivitiesTable;
0048 
0049 }
0050 }
0051 
0052 Q_DECLARE_METATYPE(Latte::Data::Activity)
0053 Q_DECLARE_METATYPE(Latte::Data::ActivitiesTable)
0054 
0055 #endif