1 /* This file is part of KDevelop
2 Copyright 2007-2008 Hamish Rodda <rodda@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 IRUNCONTROLLER_H
21 #define IRUNCONTROLLER_H
23 #include <QtCore/QObject>
25 #include <kjobtrackerinterface.h>
27 #include "interfacesexport.h"
35 * The main controller for running processes.
37 class KDEVPLATFORMINTERFACES_EXPORT IRunController
: public KJobTrackerInterface
43 IRunController(QObject
*parent
);
46 * Request the provided \a run object to be executed.
48 * \return the serial number for the run job, or -1 if \a run could not be executed.
50 Q_SCRIPTABLE
virtual KJob
* execute(const IRun
& run
) = 0;
53 * Provide the default run object.
55 virtual IRun
defaultRun() const = 0;
58 * Interrogate the current managed jobs
60 Q_SCRIPTABLE
virtual QList
<KJob
*> currentJobs() const = 0;
63 * An enumeration of the possible states for the run controller.
66 Idle
/**< No processes are currently running */,
67 Running
/**< processes are currently running */
72 * Request for all running processes to be killed.
74 virtual void stopAllProcesses() = 0;
78 * Notify that the state of the run controller has changed to \a {state}.
80 void runStateChanged(State state
);
83 * Notify that a new job has been registered.
85 void jobRegistered(KJob
* job
);
88 * Notify that a job has been unregistered.
90 void jobUnregistered(KJob
* job
);
95 #endif // IRUNCONTROLLER_H