add more spacing
[personal-kdebase.git] / apps / dolphin / src / panels / information / nepomukmassupdatejob.h
bloba19fa5ff95f4ddcf54c226e18dfd15d4bf668383
1 /***************************************************************************
2 * Copyright (C) 2008 by Sebastian Trueg <trueg@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef _NEPOMUK_MASS_UPDATE_JOB_H_
21 #define _NEPOMUK_MASS_UPDATE_JOB_H_
23 #include <kjob.h>
24 #include <kurl.h>
26 #include <QtCore/QList>
27 #include <QtCore/QPair>
28 #include <QtCore/QTimer>
30 #include <nepomuk/resource.h>
31 #include <nepomuk/variant.h>
34 namespace Nepomuk {
35 class MassUpdateJob : public KJob
37 Q_OBJECT
39 public:
40 MassUpdateJob( QObject* parent = 0 );
41 ~MassUpdateJob();
43 /**
44 * Set a list of files to change
45 * This has the same effect as using setResources
46 * with a list of manually created resources.
48 void setFiles( const KUrl::List& urls );
50 /**
51 * Set a list of resources to change.
53 void setResources( const QList<Nepomuk::Resource>& );
55 /**
56 * Set the properties to change in the mass update.
58 void setProperties( const QList<QPair<QUrl,Nepomuk::Variant> >& props );
60 /**
61 * Actually start the job.
63 void start();
65 static MassUpdateJob* tagResources( const QList<Nepomuk::Resource>&, const QList<Nepomuk::Tag>& tags );
66 static MassUpdateJob* commentResources( const QList<Nepomuk::Resource>&, const QString& comment );
67 static MassUpdateJob* rateResources( const QList<Nepomuk::Resource>&, int rating );
69 protected:
70 bool doKill();
71 bool doSuspend();
72 bool doResume();
74 private Q_SLOTS:
75 void slotNext();
77 private:
78 QList<Nepomuk::Resource> m_resources;
79 QList<QPair<QUrl,Nepomuk::Variant> > m_properties;
80 int m_index;
81 QTimer m_processTimer;
85 #endif