84 lines
1.5 KiB
C++
84 lines
1.5 KiB
C++
#ifndef JSONOBJECT_H
|
|
#define JSONOBJECT_H
|
|
|
|
//#include <QObject>
|
|
#include <QString>
|
|
class QStringList;
|
|
class QTranslator;
|
|
|
|
#include <QString>
|
|
struct host {
|
|
QString name;
|
|
QString ae;
|
|
QString ip;
|
|
QString port;
|
|
//QString isDefault;
|
|
};
|
|
struct localhost {
|
|
QString ip;
|
|
QString mask;
|
|
QString gateway;
|
|
};
|
|
|
|
class JsonObject
|
|
{
|
|
public:
|
|
|
|
static JsonObject* Instance()
|
|
{
|
|
static JsonObject obj;
|
|
return &obj;
|
|
}
|
|
enum ServerType
|
|
{
|
|
WORKLIST, PACS, DAQ, RECON
|
|
};
|
|
|
|
QStringList language();
|
|
void setDefaultLanguage(QString str);
|
|
QString defaultLanguage();
|
|
|
|
QString institutionName();
|
|
void setInstitutionName(QString str);
|
|
|
|
QString institutionAddr();
|
|
void setInstitutionAddr(QString str);
|
|
|
|
int lockerCount();
|
|
QString lockScreenTimeout();
|
|
void setLockScreenTimeout(QString str);
|
|
|
|
|
|
QStringList protocals();
|
|
QString defaultProtocal();
|
|
void setDefaultProtocal(QString str);
|
|
|
|
|
|
QStringList worklistFilters();
|
|
QString defaultFilter();
|
|
void setDefaultFilter(QString str);
|
|
|
|
host getServer(ServerType type);
|
|
void setServer(ServerType type, const host& list);
|
|
|
|
localhost getLocalHost();
|
|
void setLocalHost(const localhost& lh);
|
|
|
|
private:
|
|
void setJsonString(const char* catergory, const char* stringName, const char* stringValue, bool save = true);
|
|
char* getJsonString(const char* catergory, const char* stringName);
|
|
|
|
bool loadcfg();
|
|
bool savecfg();
|
|
|
|
JsonObject();
|
|
~JsonObject();
|
|
void* json_root = nullptr;
|
|
bool m_bLoaded = false;
|
|
|
|
int counter;
|
|
|
|
};
|
|
|
|
#endif // JSONOBJECT_H
|