Mercurial > trustbridge
annotate ui/taskscheduler.h @ 1260:82792b3a16bd
Add inactive debug code for update installation
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 26 Sep 2014 13:28:47 +0200 |
parents | 2a1aa9df8f11 |
children |
rev | line source |
---|---|
827
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 * |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=2) |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * See LICENSE.txt for details. |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 #ifndef TASKSCHEDULER_H |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 #define TASKSCHEDULER_H |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 /** |
1053
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
827
diff
changeset
|
12 * @file taskscheduler.h |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
827
diff
changeset
|
13 * @brief Interface to the Task Scheduler API |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
827
diff
changeset
|
14 * |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
827
diff
changeset
|
15 * Provides a Qt / C++ API to work with the windows task scheduler. |
827
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 #include <QString> |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 #include <QTime> |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 #ifndef INITGUID |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 #define INITGUID |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 #include <mstask.h> |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 #undef INITGUID |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 #endif |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 //struct ITaskScheduler; |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 |
1255
2a1aa9df8f11
(issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
28 /** @brief Interface to the Task Scheduler API |
2a1aa9df8f11
(issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
29 * |
2a1aa9df8f11
(issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
30 * Provides a Qt / C++ API to work with the windows task scheduler. |
2a1aa9df8f11
(issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
31 */ |
827
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 class TaskScheduler |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 { |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 public: |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 /** @brief Initializes the COM objects */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 TaskScheduler(); |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 /**@brief Uninitializes the COM objects */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 ~TaskScheduler(); |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 /** @brief create a task that is executed daily if the user is logged in. |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 * |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 * @param[in] executable Absolute path to the executable to run. |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 * @param[in] args the arguements to pass to the executable. |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 * @param[in] startTime the preferred time to start the task. |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 * |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 * @returns True on success, false on error */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 bool createDailyTask(const QString &executable, const QString &args, const QTime &startTime); |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
49 /** @brief check if the Initialization was successful */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 bool isInitialized() {return mInitialized;} |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
51 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 private: |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 bool mInitialized; |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
54 ITaskScheduler *mTaskScheduler; |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 }; |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
56 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
57 #endif // TASKSCHEDULER_H |