Back to index

fet  5.18.0
activity.h
Go to the documentation of this file.
00001 /*
00002 File activity.h
00003 */
00004 
00005 /*
00006 Copyright 2002, 2003 Lalescu Liviu.
00007 
00008 This file is part of FET.
00009 
00010 FET is free software; you can redistribute it and/or modify
00011 it under the terms of the GNU General Public License as published by
00012 the Free Software Foundation; either version 2 of the License, or
00013 (at your option) any later version.
00014 
00015 FET is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with FET; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 */
00024 
00025 #ifndef ACTIVITY_H
00026 #define ACTIVITY_H
00027 
00028 #include <QCoreApplication>
00029 
00030 #include "timetable_defs.h"
00031 
00032 #include <QString>
00033 #include <QList>
00034 #include <QSet>
00035 #include <QStringList>
00036 
00037 class Rules;
00038 class Activity;
00039 
00040 typedef QList<Activity*> ActivitiesList;
00041 
00042 
00050 class Activity{
00051        Q_DECLARE_TR_FUNCTIONS(Activity)
00052 
00053 public:
00054        QString comments;
00055 
00059        QStringList teachersNames;
00060 
00064        QString subjectName;
00065 
00069        //QString activityTagName;
00070        QStringList activityTagsNames;
00071 
00075        QStringList studentsNames;
00076 
00080        int duration;
00081 
00085        //int parity;
00086 
00092        int totalDuration;
00093 
00098        int id;
00099 
00104        int activityGroupId;
00105 
00112        int nTotalStudents;
00113        
00119        bool computeNTotalStudents;
00120        
00125        bool active;
00126        
00132        bool operator==(Activity &a);
00133 
00134        //internal structure
00135        
00139        //int nTeachers;
00140        
00144        //int teachers[MAX_TEACHERS_PER_ACTIVITY];
00145        QList<int> iTeachersList;
00146 
00150        int subjectIndex;
00151 
00155        QSet<int> iActivityTagsSet;
00156        //int activityTagIndex;
00157 
00161        //int nSubgroups;
00162 
00166        //int subgroups[MAX_SUBGROUPS_PER_ACTIVITY];
00167        QList<int> iSubgroupsList;
00168        
00174        Activity();
00175 
00184        Activity(
00185               Rules& r,
00186               int _id,
00187               int _activityGroupId,
00188               const QStringList& _teachersNames,
00189               const QString& _subjectName,
00190               const QStringList& _activityTagsNames,
00191               const QStringList& _studentsNames,
00192               int _duration,
00193               int _totalDuration,
00194               //int _parity,
00195               bool _active,
00196               bool _computeNTotalStudents,
00197               int _nTotalStudents);
00198               
00199        //this is used only when reading a file (Rules), so that the computed number of students is known faster
00200        Activity(
00201               Rules& r,
00202               int _id,
00203               int _activityGroupId,
00204               const QStringList& _teachersNames,
00205               const QString& _subjectName,
00206               const QStringList& _activityTagsNames,
00207               const QStringList& _studentsNames,
00208               int _duration,
00209               int _totalDuration,
00210               //int _parity,
00211               bool _active,
00212               bool _computeNTotalStudents,
00213               int _nTotalStudents,
00214               int _computedNumberOfStudents);
00215               
00216        bool searchTeacher(const QString& teacherName);
00217 
00221        bool removeTeacher(const QString& teacherName);
00222 
00226        void renameTeacher(const QString& initialTeacherName, const QString& finalTeacherName);
00227        
00228        bool searchStudents(const QString& studentsName);
00229 
00233        bool removeStudents(Rules& r, const QString& studentsName, int nStudents);
00234 
00238        void renameStudents(Rules& r, const QString& initialStudentsName, const QString& finalStudentsName, int initialNumberOfStudents, int finalNumberOfStudents);
00239 
00243        void computeInternalStructure(Rules& r);
00244 
00248        QString getXmlDescription(Rules& r);
00249 
00253        QString getDescription(Rules& r);
00254 
00258        QString getDetailedDescription(Rules& r);
00259 
00264        QString getDetailedDescriptionWithConstraints(Rules& r);
00265 
00269        bool isSplit();
00270        
00271        bool representsComponentNumber(int compNumber);
00272 };
00273 
00274 #endif