andre@827: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
andre@827:  * Software engineering by Intevation GmbH
andre@827:  *
andre@827:  * This file is Free Software under the GNU GPL (v>=2)
andre@827:  * and comes with ABSOLUTELY NO WARRANTY!
andre@827:  * See LICENSE.txt for details.
andre@827:  */
andre@827: #ifndef TASKSCHEDULER_H
andre@827: #define TASKSCHEDULER_H
andre@827: 
andre@827: /**
emanuel@1053:  * @file taskscheduler.h
emanuel@1053:  * @brief Interface to the Task Scheduler API
emanuel@1053:  * 
emanuel@1053:  * Provides a Qt / C++ API to work with the windows task scheduler.
andre@827:  */
andre@827: 
andre@827: #include <QString>
andre@827: #include <QTime>
andre@827: #ifndef INITGUID
andre@827: #define INITGUID
andre@827: #include <mstask.h>
andre@827: #undef INITGUID
andre@827: #endif
andre@827: 
andre@827: //struct ITaskScheduler;
andre@827: 
andre@827: class TaskScheduler
andre@827: {
andre@827: public:
andre@827:     /** @brief Initializes the COM objects */
andre@827:     TaskScheduler();
andre@827: 
andre@827:     /**@brief Uninitializes the COM objects */
andre@827:     ~TaskScheduler();
andre@827:     /** @brief create a task that is executed daily if the user is logged in.
andre@827:      *
andre@827:      * @param[in] executable Absolute path to the executable to run.
andre@827:      * @param[in] args the arguements to pass to the executable.
andre@827:      * @param[in] startTime the preferred time to start the task.
andre@827:      *
andre@827:      * @returns True on success, false on error */
andre@827:     bool createDailyTask(const QString &executable, const QString &args, const QTime &startTime);
andre@827: 
andre@827:     /** @brief check if the Initialization was successful */
andre@827:     bool isInitialized() {return mInitialized;}
andre@827: 
andre@827: private:
andre@827:     bool mInitialized;
andre@827:     ITaskScheduler *mTaskScheduler;
andre@827: };
andre@827: 
andre@827: #endif // TASKSCHEDULER_H