Back to index

fet  5.18.0
import.h
Go to the documentation of this file.
00001 /*
00002 File import.h
00003 */
00004 
00005 /***************************************************************************
00006                                 FET
00007                           -------------------
00008    copyright            : (C) by Lalescu Liviu
00009     email                : Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)
00010  ***************************************************************************
00011                           import.h  -  description
00012                              -------------------
00013     begin                : Mar 2008
00014     copyright            : (C) by Volker Dirr
00015                          : http://www.timetabling.de/
00016  ***************************************************************************
00017  *                                                                         *
00018  *   This program is free software; you can redistribute it and/or modify  *
00019  *   it under the terms of the GNU General Public License as published by  *
00020  *   the Free Software Foundation; either version 2 of the License, or     *
00021  *   (at your option) any later version.                                   *
00022  *                                                                         *
00023  ***************************************************************************/
00024 
00025 #ifndef IMPORT_H
00026 #define IMPORT_H
00027 
00028 #include <QDialog>
00029 
00030 #include "timetable.h"
00031 #include "timetable_defs.h"
00032 
00033 class QGroupBox;
00034 class QLineEdit;
00035 class QRadioButton;
00036 class QComboBox;
00037 class QPushButton;
00038 class QSpinBox;
00039 class QHBoxLayout;
00040 
00041 static const int DO_NOT_IMPORT=-2;
00042 static const int IMPORT_DEFAULT_ITEM=-1;
00043 
00044 static const int FIELD_LINE_NUMBER=0;
00045 
00046 static const int FIELD_YEAR_NAME=1;
00047 static const int FIELD_YEAR_NUMBER_OF_STUDENTS=2;
00048 static const int FIELD_GROUP_NAME=3;
00049 static const int FIELD_GROUP_NUMBER_OF_STUDENTS=4;
00050 static const int FIELD_SUBGROUP_NAME=5;
00051 static const int FIELD_SUBGROUP_NUMBER_OF_STUDENTS=6;
00052 
00053 static const int FIELD_SUBJECT_NAME=7;
00054 
00055 static const int FIELD_ACTIVITY_TAG_NAME=8;
00056 
00057 static const int FIELD_TEACHER_NAME=9;
00058 
00059 static const int FIELD_BUILDING_NAME=10;
00060 static const int FIELD_ROOM_NAME=11;
00061 static const int FIELD_ROOM_CAPACITY=12;
00062 
00063 static const int FIELD_ACTIVITY_TAGS_SET=13;
00064 
00065 static const int FIELD_STUDENTS_SET=14;
00066 static const int FIELD_TEACHERS_SET=15;
00067 
00068 static const int FIELD_TOTAL_DURATION=16;
00069 static const int FIELD_SPLIT_DURATION=17;
00070 static const int FIELD_MIN_DAYS=18;
00071 static const int FIELD_MIN_DAYS_WEIGHT=19;
00072 static const int FIELD_MIN_DAYS_CONSECUTIVE=20;
00073 
00074 static const int NUMBER_OF_FIELDS=21;
00075 
00076 class Import: public QObject{
00077        Q_OBJECT
00078 
00079        static int chooseWidth(int w);
00080        static int chooseHeight(int h);
00081 
00082 public:
00083        Import();
00084        ~Import();
00085 
00086        static void importCSVActivities(QWidget* parent);
00087        static void importCSVActivityTags(QWidget* parent);
00088        static void importCSVRoomsAndBuildings(QWidget* parent);
00089        static void importCSVSubjects(QWidget* parent);
00090        static void importCSVTeachers(QWidget* parent);
00091        static void importCSVStudents(QWidget* parent);
00092 
00093 private:
00094        static void prearrangement();
00095        static int getFileSeparatorFieldsAndHead(QWidget* parent, QDialog* &newParent);
00096        static int readFields(QWidget* parent);
00097        static int showFieldsAndWarnings(QWidget* parent, QDialog* &newParent);
00098 };
00099 
00100 class ChooseFieldsDialog: public QDialog{
00101        Q_OBJECT
00102        
00103 public:                                                 //can be this done privat, too?
00104        ChooseFieldsDialog(QWidget *parent);
00105        ~ChooseFieldsDialog();
00106 
00107 private:
00108        QGroupBox* fieldGroupBox[NUMBER_OF_FIELDS];
00109        QRadioButton* fieldRadio1[NUMBER_OF_FIELDS];
00110        QRadioButton* fieldRadio2[NUMBER_OF_FIELDS];
00111        QRadioButton* fieldRadio3[NUMBER_OF_FIELDS];
00112        QRadioButton* fieldRadio3b[NUMBER_OF_FIELDS];
00113        QComboBox* fieldLine2CB[NUMBER_OF_FIELDS];
00114        QLineEdit* fieldLine3Text[NUMBER_OF_FIELDS];
00115        QSpinBox* fieldLine3bSpinBox[NUMBER_OF_FIELDS];
00116        QPushButton* pb;
00117        QPushButton* cancelpb;
00118        QHBoxLayout* buttonsLayout;
00119        
00120        QString _settingsName;
00121        
00122 private slots:
00123        void chooseFieldsDialogClose();
00124        void chooseFieldsDialogUpdateRadio1();
00125        void chooseFieldsDialogUpdateRadio2();
00126        void chooseFieldsDialogUpdateRadio3();
00127        void chooseFieldsDialogUpdateRadio3b();
00128        void chooseFieldsDialogUpdateLine3Text();
00129 };
00130 
00131 class LastWarningsDialog: public QDialog{
00132        Q_OBJECT
00133        
00134 public:                                                 //can be this done privat, too?
00135        LastWarningsDialog(QWidget *parent);
00136        ~LastWarningsDialog();
00137 };
00138 
00139 #endif