2 Copyright (c) 2013 Montel Laurent <montel@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef ACTIVITYMANAGER_H
22 #define ACTIVITYMANAGER_H
24 #include "pimactivity_export.h"
25 #include <kactivities/consumer.h>
27 #include <KSharedConfig>
31 namespace PimActivity
{
32 class ActivityManagerPrivate
;
33 class PIMACTIVITY_EXPORT ActivityManager
: public QObject
37 explicit ActivityManager(QObject
*parent
= 0);
40 enum SelectComponent
{
46 Q_DECLARE_FLAGS( SelectComponents
, SelectComponent
)
48 void setSelectComponents(ActivityManager::SelectComponents selection
);
49 ActivityManager::SelectComponents
selectComponents() const;
51 bool isActive() const;
53 QStringList
listActivities() const;
54 QHash
<QString
, QString
> listActivitiesWithRealName() const;
55 QString
currentActivity() const;
57 void setEnabledActivity(bool enabled
);
58 bool isEnabledActivity() const;
60 static KSharedConfigPtr
configFromActivity(const QString
&id
);
63 void serviceStatusChanged(KActivities::Consumer::ServiceStatus
);
64 void activityAdded(const QString
&);
65 void activityRemoved(const QString
&);
66 void currentActivityChanged(const QString
&);
67 void enabledActivityChanged(bool enabled
);
70 friend class ActivityManagerPrivate
;
71 ActivityManagerPrivate
* const d
;
72 Q_PRIVATE_SLOT( d
, void slotActivityAdded(const QString
&))
73 Q_PRIVATE_SLOT( d
, void slotActivityRemoved(const QString
&))
77 #endif // ACTIVITYMANAGER_H