sAlarm 0.5
salarm/scheduler/scheduledialog.h
00001 /*
00002  * sAlarm - Scheduler
00003  * http://salarm.seberm.com
00004  *
00005  * Copyright (C) 2009-2010 Otto Sabart <seberm[at]gmail[dot]com>
00006  * 
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * version 3 as published by the Free Software Foundation.
00010  * 
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 
00022 #ifndef SCHEDULEDIALOG_H
00023 #define SCHEDULEDIALOG_H
00024 
00025 
00026 #include <QDialog>
00027 #include <QDateTime>
00028 #include <QModelIndex>
00029 
00030 
00031 namespace Ui {
00032         
00033     class ScheduleDialog;
00034 }
00035 
00036 class Database;
00037 class Scheduler;
00038 
00040 class ScheduleDialog : public QDialog {
00041     
00042         Q_OBJECT
00043         
00044         Q_ENUMS(ScheduleActions)
00045                 
00046                         
00047 public:
00048         
00050 
00053         explicit ScheduleDialog(Database *sqlDb, Scheduler *scheduler, QWidget *parent = 0);
00054         
00056 
00062         ScheduleDialog(Database *sqlDb, Scheduler *scheduler, const QModelIndex &, QWidget *parent = 0);
00063         
00065     ~ScheduleDialog();
00066         
00068         enum ScheduleActions { Add, Edit };
00069 
00070         
00071 protected:
00072         
00074 
00077     void changeEvent(QEvent *event);
00078 
00079         
00080 private:
00081         
00083         void initialize();
00084         
00086         void doSchedule();
00087         
00089         void makeConnections();
00090         
00092         Ui::ScheduleDialog *ui;
00093         
00095 
00098         ScheduleDialog::ScheduleActions dialogAction;
00099         
00101         int m_scheduleID;
00102         
00104         Database *m_sqlDb;
00105         
00107         Scheduler *m_scheduler;
00108         
00109         
00110 private slots:
00111         
00113         void scheduleAccepted();
00114         
00116         void addCategory();
00117         
00119         void removeCategory();
00120         
00121 };
00122 
00123 #endif // SCHEDULEDIALOG_H
 All Classes Functions Enumerations