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

GUIPref.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 #ifndef __GUI_PREF_H
00021 #define __GUI_PREF_H
00022 
00023 #include <iostream>
00024 #include <QVariant>
00025 #include <QList>
00026 #include <QColor>
00027 #include <QSettings>
00028 
00029 class GUIPref
00030 {
00031 public:
00032         enum ColourType {CT_DEFAULT_TEXT, CT_DEFAULT_BG
00033                         ,CT_INSTITUTE_TEXT, CT_INSTITUTE_BG
00034                         ,CT_PROGRAMME_TEXT, CT_PROGRAMME_BG
00035                         ,CT_MODULE_TEXT, CT_MODULE_BG
00036                         ,CT_FACULTY_TEXT, CT_FACULTY_BG
00037                         ,CT_DEPARTMENT_TEXT, CT_DEPARTMENT_BG
00038                         ,CT_STAFF_TEXT, CT_STAFF_BG
00039                         ,CT_ROOM_TEXT, CT_ROOM_BG
00040                         ,CT_MOD_LEC_ALLOC_TEXT, CT_MOD_LEC_ALLOC_BG
00041                         ,CT_TIMESLOT_TEXT, CT_TIMESLOT_BG
00042                         };
00043 public:
00044         static GUIPref * Instance();
00045         void readColours();
00046         void writeColours();
00047         QColor * getColour(ColourType ct,int i);
00048 private: // Properties
00049         // Singleton Instance
00050         static GUIPref * _instance;
00051         // List of colour preferences
00052         QList<QColor> DefaultTextColour;
00053         QList<QColor> DefaultBgColour;
00054         QList<QColor> InstituteTextColour;
00055         QList<QColor> InstituteBgColour;
00056         QList<QColor> ProgrammeTextColour;
00057         QList<QColor> ProgrammeBgColour;
00058         QList<QColor> ModuleTextColour;
00059         QList<QColor> ModuleBgColour;
00060         QList<QColor> FacultyTextColour;
00061         QList<QColor> FacultyBgColour;
00062         QList<QColor> DepartmentTextColour;
00063         QList<QColor> DepartmentBgColour;
00064         QList<QColor> StaffTextColour;
00065         QList<QColor> StaffBgColour;
00066         QList<QColor> RoomTextColour;
00067         QList<QColor> RoomBgColour;
00068         QList<QColor> ModLecAllocTextColour;
00069         QList<QColor> ModLecAllocBgColour;
00070         QList<QColor> TimeSlotTextColour;
00071         QList<QColor> TimeSlotBgColour;
00072 private: // Methods
00073         // Private constructor for singleton instance
00074         GUIPref();
00075         // preference file manipulation
00076         void readColourArray(QSettings &settings, QList<QColor> &SettingList, QString ArrayName, QString SettingName);
00077 };
00078 #endif

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