2014-09-26 20:00:40 +00:00
|
|
|
/**
|
|
|
|
* This simple static class will generate a csv file of a given semester.
|
|
|
|
*
|
|
|
|
* the class wat written for the JCE Manager and exporting a calendar to Goolgle Calendar.
|
|
|
|
*
|
|
|
|
* this CSV file should also work for iCal and Outlook. but have not been tested.
|
|
|
|
*
|
|
|
|
*/
|
2014-09-08 15:54:52 +00:00
|
|
|
#ifndef CSV_EXPORTER_H
|
|
|
|
#define CSV_EXPORTER_H
|
|
|
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QTextStream>
|
|
|
|
#include <QString>
|
|
|
|
#include <QDebug>
|
2014-09-17 02:55:28 +00:00
|
|
|
#include <QMessageBox>
|
2014-09-08 15:54:52 +00:00
|
|
|
|
2014-10-08 04:14:50 +00:00
|
|
|
#include "../Calendar/coursesSchedule/calendarSchedule.h"
|
|
|
|
#include "../Calendar/coursesSchedule/calendarDialog.h"
|
2014-09-09 20:31:48 +00:00
|
|
|
|
2014-09-08 15:54:52 +00:00
|
|
|
|
|
|
|
#define CSV_CALENDAR_HEADER "Subject,Start Date,Start Time,End Date,End Time,Description,Location"
|
|
|
|
|
|
|
|
class CSV_Exporter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSV_Exporter();
|
2014-09-09 20:31:48 +00:00
|
|
|
static bool exportCalendar(calendarSchedule* calSched, CalendarDialog *cal);
|
2014-09-08 15:54:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
static QString getFileFath();
|
2014-09-09 20:31:48 +00:00
|
|
|
static QString makeLine(QString name,QDate *date,int startH,int startM,int endH,int endM,QString lecturer,QString room,QString type);
|
2014-09-22 18:54:38 +00:00
|
|
|
static void changeDayNumberFromQtToNormal(int *);
|
|
|
|
enum DAYS{SUNDAY=1, MONDAY=2, TUESDAY=3, WENDSDAY=4, THURSDAY=5, FRIDAY=6};
|
2014-09-08 15:54:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CSV_EXPORTER_H
|