french -> French
[kdepim.git] / pimactivity / activitymanager.h
blobab6dff468582124efbb77e116c89e77d05578370
1 /*
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
17 02110-1301, USA.
21 #ifndef ACTIVITYMANAGER_H
22 #define ACTIVITYMANAGER_H
24 #include "pimactivity_export.h"
25 #include <kactivities/consumer.h>
27 #include <KSharedConfig>
29 #include <QObject>
31 namespace PimActivity {
32 class ActivityManagerPrivate;
33 class PIMACTIVITY_EXPORT ActivityManager : public QObject
35 Q_OBJECT
36 public:
37 explicit ActivityManager(QObject *parent = 0);
38 ~ActivityManager();
40 enum SelectComponent {
41 None = 0,
42 Identity = 1,
43 MailTransport = 2,
44 Collection = 4
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);
62 Q_SIGNALS:
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);
69 private:
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