jce-manager/src/jceData/CSV/csv_exporter.h
2014-10-13 18:22:31 +03:00

41 lines
1.2 KiB
C++

/**
* 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.
*
*/
#ifndef CSV_EXPORTER_H
#define CSV_EXPORTER_H
#include <QFileDialog>
#include <QFile>
#include <QTextStream>
#include <QString>
#include <QDebug>
#include <QMessageBox>
#include "../Calendar/coursesSchedule/calendarSchedule.h"
#include "../Calendar/coursesSchedule/calendarDialog.h"
#include "../Calendar/Exams/calendarExam.h"
#define CSV_CALENDAR_HEADER "Subject,Start Date,Start Time,End Date,End Time,Description,Location"
class CSV_Exporter
{
public:
CSV_Exporter();
static bool exportCalendar(calendarSchedule* calSched, CalendarDialog *cal, calendarExam* exams);
private:
static QString getFileFath();
static QString makeLine(QString name,QDate *date,int startH,int startM,int endH,int endM,QString lecturer,QString room,QString type);
static void changeDayNumberFromQtToNormal(int *);
enum DAYS{SUNDAY=1, MONDAY=2, TUESDAY=3, WENDSDAY=4, THURSDAY=5, FRIDAY=6};
};
#endif // CSV_EXPORTER_H