00001 #ifndef ROMINFO_H_
00002 #define ROMINFO_H_
00003
00004 #include <QMetaType>
00005 #include <QString>
00006 #include <QList>
00007
00008 int romInDB(QString rom, QString gametype);
00009
00010 class RomInfo
00011 {
00012 public:
00013 static QList<RomInfo*> GetAllRomInfo();
00014 static RomInfo *GetRomInfoById(int id);
00015
00016 RomInfo(int lid = 0, QString lromname = "", QString lsystem = "", QString lgamename ="",
00017 QString lgenre = "", QString lyear = "", bool lfavorite = false,
00018 QString lrompath = "", QString lcountry ="", QString lcrc_value = "",
00019 int ldiskcount = 0, QString lgametype = "", int lromcount = 0,
00020 QString lallsystems = "", QString lplot = "", QString lpublisher = "",
00021 QString lversion = "", QString lscreenshot = "", QString lfanart = "",
00022 QString lboxart = "", QString linetref = "")
00023 {
00024 id = lid;
00025 romname = lromname;
00026 system = lsystem;
00027 gamename = lgamename;
00028 genre = lgenre;
00029 year = lyear;
00030 favorite = lfavorite;
00031 rompath = lrompath;
00032 screenshot = lscreenshot;
00033 fanart = lfanart;
00034 boxart = lboxart;
00035 country = lcountry;
00036 crc_value = lcrc_value;
00037 diskcount = ldiskcount;
00038 gametype = lgametype;
00039 romcount = lromcount;
00040 allsystems = lallsystems;
00041 plot = lplot;
00042 publisher = lpublisher;
00043 version = lversion;
00044 inetref = linetref;
00045 }
00046
00047 RomInfo(const RomInfo &lhs)
00048 {
00049 id = lhs.id;
00050 romname = lhs.romname;
00051 system = lhs.system;
00052 gamename = lhs.gamename;
00053 genre = lhs.genre;
00054 year = lhs.year;
00055 favorite = lhs.favorite;
00056 rompath = lhs.rompath;
00057 screenshot = lhs.screenshot;
00058 fanart = lhs.fanart;
00059 boxart = lhs.boxart;
00060 country = lhs.country;
00061 crc_value = lhs.crc_value;
00062 diskcount = lhs.diskcount;
00063 gametype = lhs.gametype;
00064 romcount = lhs.romcount;
00065 allsystems = lhs.allsystems;
00066 plot = lhs.plot;
00067 publisher = lhs.publisher;
00068 version = lhs.version;
00069 inetref = lhs.inetref;
00070 }
00071
00072 ~RomInfo() {}
00073
00074 bool FindImage(QString BaseFileName, QString *result);
00075
00076 int Id() const { return id; }
00077 void setId(const int &lid) { id = lid; }
00078
00079 QString Rompath() const { return rompath; }
00080 void setRompath(const QString &lrompath) { rompath = lrompath; }
00081
00082 QString Screenshot() const { return screenshot; }
00083 void setScreenshot(const QString &lscreenshot) { screenshot = lscreenshot; }
00084
00085 QString Fanart() const { return fanart; }
00086 void setFanart(const QString &lfanart) { fanart = lfanart; }
00087
00088 QString Boxart() const { return boxart; }
00089 void setBoxart(const QString &lboxart) { boxart = lboxart; }
00090
00091 QString Romname() const { return romname; }
00092 void setRomname(const QString &lromname) { romname = lromname; }
00093
00094 QString System() const { return system; }
00095 void setSystem(const QString &lsystem) { system = lsystem; }
00096
00097 QString Gamename() const { return gamename; }
00098 void setGamename(const QString &lgamename) { gamename = lgamename; }
00099
00100 QString Genre() const { return genre; }
00101 void setGenre(const QString &lgenre) { genre = lgenre; }
00102
00103 QString Country() const { return country; }
00104 void setCountry(const QString &lcountry) { country = lcountry; }
00105
00106 QString GameType() const { return gametype; }
00107 void setGameType(const QString &lgametype) { gametype = lgametype; }
00108
00109 int RomCount() const { return romcount; }
00110 void setRomCount(const int &lromcount) { romcount = lromcount; }
00111
00112 QString AllSystems() const { return allsystems; }
00113 void setAllSystems(const QString &lallsystems) { allsystems = lallsystems; }
00114
00115 int DiskCount() const { return diskcount; }
00116 void setDiskCount(const int &ldiskcount) { diskcount = ldiskcount; }
00117
00118 QString CRC_VALUE() const { return crc_value; }
00119 void setCRC_VALUE(const QString &lcrc_value) { crc_value = lcrc_value; }
00120
00121 QString Plot() const { return plot; }
00122 void setPlot(const QString &lplot) { plot = lplot; }
00123
00124 QString Publisher() const { return publisher; }
00125 void setPublisher(const QString &lpublisher) { publisher = lpublisher; }
00126
00127 QString Version() const { return version; }
00128 void setVersion(const QString &lversion) { version = lversion; }
00129
00130 QString Year() const { return year; }
00131 void setYear(const QString &lyear) { year = lyear; }
00132
00133 QString Inetref() const { return inetref; }
00134 void setInetref(const QString &linetref) { inetref = linetref; }
00135
00136 int Favorite() const { return favorite; }
00137 void setFavorite(bool updateDatabase = false);
00138
00139 QString getExtension();
00140 QString toString();
00141
00142 void setField(QString field, QString data);
00143 void fillData();
00144
00145 void SaveToDatabase();
00146 void DeleteFromDatabase();
00147
00148 protected:
00149 int id;
00150 QString romname;
00151 QString system;
00152 QString gamename;
00153 QString genre;
00154 QString country;
00155 QString crc_value;
00156 QString gametype;
00157 QString allsystems;
00158 QString plot;
00159 QString publisher;
00160 QString version;
00161 int romcount;
00162 int diskcount;
00163 QString year;
00164 bool favorite;
00165 QString rompath;
00166 QString screenshot;
00167 QString fanart;
00168 QString boxart;
00169 QString inetref;
00170 };
00171
00172 bool operator==(const RomInfo& a, const RomInfo& b);
00173
00174 Q_DECLARE_METATYPE(RomInfo *)
00175
00176 #endif