summaryrefslogtreecommitdiff
path: root/client/netcom.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/netcom.h')
-rw-r--r--client/netcom.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/client/netcom.h b/client/netcom.h
index 35db221..88b604e 100644
--- a/client/netcom.h
+++ b/client/netcom.h
@@ -31,6 +31,10 @@
#include <QString>
#include <QTcpSocket>
#include <QDomDocument>
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+
+//#define USE_SSL
//#include "widgets/widget.h"
class Widget;
@@ -38,24 +42,33 @@ class Widget;
class NetCom : public QObject {
Q_OBJECT
public:
- NetCom(QString host, quint16 port, QString user, QString cpr);
+ NetCom(QString host, quint16 port);
~NetCom();
QDomDocument send(QString templ, QString macro = "", bool lockgui = true);
- void send(QVector< Widget* > widgets, QString templ, QString macro, QString version);
+ QDomDocument send(QVector< Widget* > widgets, QString templ, QString macro,
+ QString version);
+ QDomDocument initConnection();
+ QDomDocument commit();
+ QDomDocument discard();
+
+ QString sessionid;
+ QString user;
+ QString patientid;
public slots:
- void readyRead();
+ void replyFinished(QNetworkReply*);
private:
- volatile bool transmitting;
- QTcpSocket socket;
+ QNetworkAccessManager *manager;
+ QNetworkRequest request;
- QByteArray buffer;
- QDomDocument res_doc;
+ // QString sessionid;
- QString user;
- QString cpr;
+ QMap<QNetworkReply *, bool> finished;
+
+ QDomDocument makeTransfer(QDomDocument &dom,
+ bool commit, bool lockgui, bool discard = false);
};
#endif/*__PRACRO_NETCOM_H__*/