Don't offer to restart a Running (=busy) agent, it won't work.
[kdepim.git] / libkdepim / openemailaddressjob.h
blob3b5352a83cbb9b44e05128465187ec792336d3ca
1 /*
2 Copyright 2010 Tobias Koenig <tokoe@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library 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 GNU
12 Library General Public 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
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef OPENEMAILADDRESSJOB_H
21 #define OPENEMAILADDRESSJOB_H
23 #include "kdepim_export.h"
25 #include <kjob.h>
27 namespace Akonadi {
28 class Item;
31 namespace KPIM {
33 /**
34 * @short A job to open the contact editor for a contact with a given email address.
36 * The job will check whether a contact with the given email address already
37 * exists in Akonadi. If not, it will add a new contact with the email address
38 * to Akonadi and then opens the contact editor.
40 class KDEPIM_EXPORT OpenEmailAddressJob : public KJob
42 Q_OBJECT
44 public:
45 /**
46 * Creates a new open email address job.
48 * @param email The email address to open.
49 * @param parentWidget The widget that will be used as parent for dialog.
50 * @param parent The parent object.
52 OpenEmailAddressJob( const QString &email, QWidget *parentWidget, QObject *parent = 0 );
54 /**
55 * Destroys the open email address job.
57 ~OpenEmailAddressJob();
59 /**
60 * Starts the job.
62 virtual void start();
64 private:
65 //@cond PRIVATE
66 class Private;
67 Private* const d;
69 Q_PRIVATE_SLOT( d, void slotSearchDone( KJob* ) )
70 Q_PRIVATE_SLOT( d, void slotAddContactDone( KJob* ) )
71 //@endcond
76 #endif