Mercurial > trustbridge
annotate ui/taskscheduler.h @ 1117:5b6203f78b4e
(auto) Update translations
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 16 Sep 2014 11:45:32 +0200 |
parents | 78798d3af8f0 |
children | 2a1aa9df8f11 |
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 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 class TaskScheduler |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 { |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 public: |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 /** @brief Initializes the COM objects */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 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 /**@brief Uninitializes the COM objects */ |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 ~TaskScheduler(); |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 /** @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
|
37 * |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 * @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
|
39 * @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
|
40 * @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
|
41 * |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 * @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
|
43 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
|
44 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 /** @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
|
46 bool isInitialized() {return mInitialized;} |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 private: |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
49 bool mInitialized; |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 ITaskScheduler *mTaskScheduler; |
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 |
8de162b91a22
(Issue49) Create a Scheduled daily task to run trustbridge
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 #endif // TASKSCHEDULER_H |