2
This file is part of Akonadi.
4
Copyright (c) 2009 Till Adam <adam@kde.org>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25
#include <QtCore/QObject>
26
#include <QtCore/QDateTime>
33
bool operator==( const JobInfo& other )
36
&& parent == other.parent
38
&& timestamp == other.timestamp
39
&& state == other.state;
55
QString stateAsString() const;
58
class JobTracker : public QObject
61
Q_CLASSINFO( "D-Bus Interface", "org.freedesktop.Akonadi.JobTracker" )
63
JobTracker( const char *name, QObject* parent = 0 );
65
QStringList sessions() const;
67
/** Returns the list of (sub)jobs of a session or another job. */
68
QList<JobInfo> jobs( const QString& parent ) const;
69
QList<JobInfo> jobs( int id ) const;
71
int idForJob( const QString& job ) const;
72
QString jobForId( int id ) const;
73
int idForSession( const QString& session ) const;
74
QString sessionForId( int id ) const;
75
int parentId( int id ) const;
77
JobInfo info( const QString& job ) const;
78
JobInfo info( int ) const;
80
bool isEnabled() const;
85
Q_SCRIPTABLE void jobCreated( const QString & session, const QString & job, const QString& parentJob, const QString & jobType );
86
Q_SCRIPTABLE void jobStarted( const QString & job );
87
Q_SCRIPTABLE void jobEnded( const QString & job, const QString &error );
88
Q_SCRIPTABLE void reset();
89
Q_SCRIPTABLE void setEnabled( bool on );
96
#endif /* JOBTRACKER_H_ */