comparison ui/taskscheduler.h @ 827:8de162b91a22

(Issue49) Create a Scheduled daily task to run trustbridge
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 23 Jul 2014 19:47:59 +0200
parents
children 78798d3af8f0
comparison
equal deleted inserted replaced
826:4aa33c408776 827:8de162b91a22
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details.
7 */
8 #ifndef TASKSCHEDULER_H
9 #define TASKSCHEDULER_H
10
11 /**
12 * @file Interface to the Task Scheduler API
13 * @brief Provides a Qt / C++ API to work with the windows task scheduler
14 */
15
16 #include <QString>
17 #include <QTime>
18 #ifndef INITGUID
19 #define INITGUID
20 #include <mstask.h>
21 #undef INITGUID
22 #endif
23
24 //struct ITaskScheduler;
25
26 class TaskScheduler
27 {
28 public:
29 /** @brief Initializes the COM objects */
30 TaskScheduler();
31
32 /**@brief Uninitializes the COM objects */
33 ~TaskScheduler();
34 /** @brief create a task that is executed daily if the user is logged in.
35 *
36 * @param[in] executable Absolute path to the executable to run.
37 * @param[in] args the arguements to pass to the executable.
38 * @param[in] startTime the preferred time to start the task.
39 *
40 * @returns True on success, false on error */
41 bool createDailyTask(const QString &executable, const QString &args, const QTime &startTime);
42
43 /** @brief check if the Initialization was successful */
44 bool isInitialized() {return mInitialized;}
45
46 private:
47 bool mInitialized;
48 ITaskScheduler *mTaskScheduler;
49 };
50
51 #endif // TASKSCHEDULER_H

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