Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

StaffModel.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Graeme Foster                                   *
00003  *   email    foster.graeme@gmail.com                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef __STAFF_MODEL_H
00022 #define __STAFF_MODEL_H
00023 
00024 #include <QModelIndex>
00025 #include <QVariant>
00026 
00027 #include "sql.h"
00028 
00029 #include "RootModel.h"
00030 #include "RootItem.h"
00031 #include "InstItem.h"
00032 #include "FacItem.h"
00033 #include "DeptItem.h"
00034 #include "StaffItem.h"
00035 
00036 #include "DataClass.h"
00037 
00038 class InstItem;
00039 
00040 class StaffModel : public RootModel
00041 {
00042         Q_OBJECT
00043 
00044         public: // Methods
00045                 // Constructor destructor
00046                 StaffModel(dbListManager * dataLists
00047                           ,DataClass::ClassName cn=DataClass::DATA_CLASS
00048                           ,RootItem * root=0
00049                           ,QObject *parent = 0
00050                           );
00051                 ~StaffModel(){};
00052 
00053                 // Inherited from QAbstractItemModel
00054                 int columnCount(const QModelIndex &parent) const;
00055                 QVariant headerData(int section, Qt::Orientation orientation,
00056                                                                   int role = Qt::DisplayRole) const;
00057                 
00058         private: // Methods
00059                 inline virtual void setupData(dbListManager &dataLists,RootItem * parent)
00060                    {setupData(dataLists, DataClass::DATA_CLASS, parent);}
00061                 void setupData(dbListManager &dataLists
00062                               ,DataClass::ClassName cn
00063                               ,RootItem * parent
00064                               );
00065                 void setupInstData(dbListManager &dataLists, RootItem * parent);
00066                 void setupFacultyData(dbListManager &dataLists, InstItem * parent);
00067                 void setupDeptData(dbListManager &dataLists, FacItem * parent);
00068                 void setupStaffData(dbListManager &dataLists, DeptItem * parent);
00069                 void setupInstStaffData(dbListManager &dataLists, InstItem * parent);
00070 };
00071 
00072 #endif

Generated on Thu Apr 6 16:27:17 2006 for time-table by  doxygen 1.4.4