annotate ui/processhelp.h @ 603:cfef809b890d

Add Process Management functions and ther implementation for windows.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 17 Jun 2014 17:26:10 +0200
parents
children 91dd38a71783
rev   line source
603
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 * See LICENSE.txt for details.
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 * Parts of this code (especially windows) are based on kpimutils processes.cpp
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 * available under LGPL 2.1 or later.
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 */
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 #ifndef PROCESSHELP_H
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 #define PROCESSHELP_H
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 #include <QList>
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 #include <QString>
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 /**
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18 * @file Static helper functions for process handling
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 * @brief process handling functions
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20 */
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 namespace ProcessHelp {
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 /**
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 * @brief look up process id's for a processName
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 * Looks up processes run by the current user.
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 * @param[in] processName the name of the process to look for
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 * @returns a list of pids that match this process. May be empty
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 */
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 const QList<int> getProcessesIdForName(const QString &processName);
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 /**
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 * @brief check if another process with the same name exists
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 * @param[in] processName name of the process to look for.
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 *
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 * @returns true if one or more processes (other than the current process) exist
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 */
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 bool otherProcessesExist(const QString &processName);
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 /**
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 * @brief Activates the window for first found process
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 * @param [in] executableName executableName (without path and .exe extension)
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45 */
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 void activateWindowForProcess(const QString &executableName);
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47 }
cfef809b890d Add Process Management functions and ther implementation for windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 #endif // PROCESSHELP_H

http://wald.intevation.org/projects/trustbridge/