2011-07-02 23:03:18 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
2012-12-25 15:06:23 +01:00
|
|
|
* Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May *
|
2011-07-02 23:03:18 +00:00
|
|
|
* *
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2012-12-25 15:06:23 +01:00
|
|
|
* *
|
|
|
|
|
* *
|
|
|
|
|
* Additional permission under GNU AGPL version 3 section 7 *
|
|
|
|
|
* *
|
|
|
|
|
* If you modify this program, or any covered work, by linking or *
|
|
|
|
|
* combining it with the OpenSSL project's OpenSSL library (or a *
|
|
|
|
|
* modified version of that library), containing parts covered by the *
|
|
|
|
|
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
|
|
|
|
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
|
|
|
|
* permission to convey the resulting work. *
|
|
|
|
|
* Corresponding Source for a non-source form of such a combination *
|
|
|
|
|
* shall include the source code for the parts of OpenSSL used as well *
|
|
|
|
|
* as that of the covered work. *
|
2011-07-03 19:45:08 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
#ifndef CARDDECKSTYLEREADER_H
|
2009-03-30 13:12:44 +00:00
|
|
|
#define CARDDECKSTYLEREADER_H
|
|
|
|
|
|
2011-02-08 16:00:43 +00:00
|
|
|
#include <tinyxml.h>
|
2009-03-30 13:12:44 +00:00
|
|
|
#include "configfile.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
#include <QtGui>
|
|
|
|
|
|
2012-11-10 02:02:25 +01:00
|
|
|
#define POKERTH_CD_STYLE_FILE_VERSION 2
|
2010-07-10 13:25:23 +00:00
|
|
|
|
|
|
|
|
enum CdStyleState {
|
2011-02-11 20:02:08 +00:00
|
|
|
CD_STYLE_OK = 0,
|
|
|
|
|
CD_STYLE_OUTDATED,
|
|
|
|
|
CD_STYLE_FIELDS_EMPTY,
|
|
|
|
|
CD_STYLE_PICTURES_MISSING,
|
2012-12-21 01:01:01 +01:00
|
|
|
CD_STYLE_UNDEFINED
|
2010-07-10 13:25:23 +00:00
|
|
|
};
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
class CardDeckStyleReader : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2009-03-30 13:12:44 +00:00
|
|
|
public:
|
2011-02-11 20:02:08 +00:00
|
|
|
CardDeckStyleReader(ConfigFile *c, QWidget *w );
|
2009-03-30 13:12:44 +00:00
|
|
|
~CardDeckStyleReader();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2009-03-30 13:12:44 +00:00
|
|
|
void readStyleFile(QString);
|
|
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getStyleDescription() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return StyleDescription;
|
|
|
|
|
}
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getStyleMaintainerName() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return StyleMaintainerName;
|
|
|
|
|
}
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getStyleMaintainerEMail() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return StyleMaintainerEMail;
|
|
|
|
|
}
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getStyleCreateDate() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return StyleCreateDate;
|
|
|
|
|
}
|
2009-04-10 18:31:31 +00:00
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getCurrentFileName() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return currentFileName;
|
|
|
|
|
}
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getCurrentDir() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return currentDir;
|
|
|
|
|
}
|
2009-03-30 13:12:44 +00:00
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getPreview() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return Preview;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
QString getBigIndexesActionBottom() const
|
|
|
|
|
{
|
2012-12-21 01:01:01 +01:00
|
|
|
return BigIndexesActionBottom;
|
|
|
|
|
}
|
2012-11-10 02:02:25 +01:00
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
bool getFallBack() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return fallBack;
|
|
|
|
|
}
|
2017-08-16 13:55:18 +02:00
|
|
|
bool getLoadedSuccessfull() const
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
return loadedSuccessfull;
|
2012-12-21 01:01:01 +01:00
|
|
|
}
|
2009-04-14 21:00:22 +00:00
|
|
|
|
2017-08-16 13:55:18 +02:00
|
|
|
CdStyleState getState() const
|
|
|
|
|
{
|
2012-12-21 01:01:01 +01:00
|
|
|
return myState;
|
|
|
|
|
}
|
2012-11-10 02:02:25 +01:00
|
|
|
|
2012-12-21 01:01:01 +01:00
|
|
|
QString getMyStateToolTipInfo();
|
|
|
|
|
void showErrorMessage();
|
|
|
|
|
void showLeftItemsErrorMessage();
|
|
|
|
|
void showCardsLeftErrorMessage();
|
|
|
|
|
void showOutdatedErrorMessage();
|
2009-03-31 20:31:28 +00:00
|
|
|
|
2009-03-30 13:12:44 +00:00
|
|
|
private:
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
QString StyleDescription;
|
2009-04-10 18:31:31 +00:00
|
|
|
QString StyleMaintainerName;
|
2009-04-03 09:03:31 +00:00
|
|
|
QString StyleMaintainerEMail;
|
2009-04-10 18:31:31 +00:00
|
|
|
QString StyleCreateDate;
|
|
|
|
|
QString PokerTHStyleFileVersion;
|
2009-03-30 13:12:44 +00:00
|
|
|
QString Preview;
|
2012-12-21 01:01:01 +01:00
|
|
|
QString BigIndexesActionBottom;
|
2009-03-30 13:12:44 +00:00
|
|
|
|
|
|
|
|
QString currentFileName;
|
2009-03-30 19:01:54 +00:00
|
|
|
QString currentDir;
|
2009-04-18 23:17:10 +00:00
|
|
|
QByteArray fileContent;
|
2009-03-30 13:12:44 +00:00
|
|
|
|
2009-04-03 09:03:31 +00:00
|
|
|
QStringList cardsLeft;
|
2009-04-10 18:31:31 +00:00
|
|
|
QStringList leftItems;
|
2009-04-03 09:03:31 +00:00
|
|
|
|
2009-03-30 13:12:44 +00:00
|
|
|
ConfigFile *myConfig;
|
2011-02-11 20:02:08 +00:00
|
|
|
QWidget *myW;
|
2009-03-30 13:12:44 +00:00
|
|
|
|
|
|
|
|
bool fallBack;
|
2012-12-21 01:01:01 +01:00
|
|
|
bool loadedSuccessfull;
|
2012-11-10 02:02:25 +01:00
|
|
|
|
2012-12-21 01:01:01 +01:00
|
|
|
CdStyleState myState;
|
2009-03-30 13:12:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|