Go to the documentation of this file.00001
00004 #ifndef BPSMDESESSION_H
00005 #define BPSMDESESSION_H
00006
00007 #include "bpscore_global.h"
00008 #include <QObject>
00009 #include <QVariantMap>
00010
00011 class BpsBarcode;
00012 class BpsDatastore;
00013 class BpsLicenseToken;
00014 class BpsMdeApplication;
00015 class QHostAddress;
00016 class QDateTime;
00017
00022 class BPSCORE_EXPORT BpsMdeSession : public QObject
00023 {
00024 Q_OBJECT
00025 BPS_PRIVATE(BpsMdeSession)
00026
00027 public:
00033 enum SaveMode {
00034 S_DontSave,
00035 S_LocalServer,
00036 S_CentralUser
00037 };
00038
00045 BpsMdeSession(const QHostAddress& aAddress, QObject* aParent);
00046
00047 virtual ~BpsMdeSession();
00048
00057 void login(const QString& aConnection, int aUserId, int aPinCode);
00058
00065 void logout();
00066
00073 void addLicenseToken(BpsMdeApplication* aApplication, BpsLicenseToken* aLicenseToken);
00074
00089 bool isLicensedFor(BpsMdeApplication* aApplication);
00090
00096 void validateLicense(BpsMdeApplication* aApplication);
00097
00102 void clearLicense(BpsMdeApplication* aApplication);
00103
00107 QList<BpsMdeApplication*> licenseApplications() const;
00108
00112 void touch();
00113
00117 QString myName() const;
00118
00122 QString connName() const;
00123
00127 QHostAddress address() const;
00128
00132 QDateTime lastAccess() const;
00133
00137 qlonglong sessionId() const;
00138
00142 BpsDatastore* datastore() const;
00143
00147 BpsBarcode* barcode() const;
00148
00154 void setUid(const QString& aUid);
00155
00159 QString uid() const;
00160
00167 QVariant value(const QString& aKey) const;
00168
00176 QVariant value(const QString& aKey, const QVariant& aDefValue) const;
00177
00184 QVariant value(const QString& aGroup, const QString& aKey) const;
00185
00193 QVariant value(const QString& aGroup, const QString& aKey, const QVariant& aDefValue) const;
00194
00202 void setValue(const QString& aKey, const QVariant& aValue, SaveMode aSaveMode = S_DontSave);
00203
00211 void setValue(const QString& aGroup, const QString& aKey, const QVariant& aValue, SaveMode aSaveMode = S_DontSave);
00212
00216 QString formToken() const;
00217
00227 QString nextFormToken();
00228
00229 signals:
00230
00235 void logError(const QString& aText);
00236
00241 void logWarning(const QString& aText);
00242
00247 void logInformation(const QString& aText);
00248
00253 void logSuccess(const QString& aText);
00254 };
00255
00256 #endif // BPSMDESESSION_H