PACK Qt Binding  $VERSION$
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
transaction_p.h
Go to the documentation of this file.
1 // Copyright (C) 2009-2011 by Konrad Rosenbaum <konrad@silmor.de>
2 // protected under the GNU LGPL version 3 or at your option any newer.
3 // See COPYING.LGPL file that comes with this distribution.
4 //
5 
6 #ifndef WOLF_TRANSACTION_PH
7 #define WOLF_TRANSACTION_PH
8 
9 #include <QByteArray>
10 #include <QString>
11 #include <QPointer>
12 
13 #include "WTransaction"
14 
15 class QTimer;
16 class QNetworkReply;
17 
20  public:
28  Log(WTransaction*parent,const QString&request,const QString&interface=QString());
30  ~Log();
31 
33  void setRequ(const QString&,const QString&);
35  void setResp(const QString&,const QString&);
37  void setError(const QString&);
39  void setInfo(const QString&);
40  private:
41  QString req,rsp;
42  QString trn,ifc;
43  WTransaction*parent;
44  int lvl,cnt;
45 
46  void outStr(const QString&);
47 };
48 
50 class WTransaction_Private:public QObject {
51  Q_OBJECT
52  public:
54  virtual ~WTransaction_Private();
56  virtual QByteArray executeQuery(QString,QByteArray);
57 
59  virtual void startQuery(QString,QByteArray);
60 
61  public slots:
63  virtual void webTimeout();
65  virtual void webReady();
67  virtual void webError();
69  virtual void endQuery();
70  signals:
72  void webFinished();
74  void dataAvailable();
75 
76  public:
80  QPointer<QNetworkReply>m_rsp;
81  QByteArray m_rspdata;
82  QPointer<QTimer>m_qtimeout;
83 
84  public slots:
88  void detach(QObject*);
89  private:
91  int m_refctr;
92 };
93 
95 class WOLF_BASE_EXPORT WTransaction::LogWrap{
96  public:
98  LogWrap(WTransaction*parent,const QString&request,const QString&interface=QString());
99 
101  void setRequ(const QString&,const QString&);
103  void setResp(const QString&,const QString&);
105  void setError(const QString&);
107  void setInfo(const QString&);
108  private:
109  WTransaction*parent;
110 };
111 
113  private:
114  int refctr;
115  protected:
117  virtual ~WTransaction_PrivateBase();
118  public:
119  virtual void attach(){refctr++;}
120  virtual void detach(){refctr--;if(refctr==0)delete this;}
121 };
122 
123 #endif
QPointer< QTimer > m_qtimeout
Definition: transaction_p.h:82
QPointer< QNetworkReply > m_rsp
Definition: transaction_p.h:80
QString m_errtype
Definition: transaction_p.h:78
Stage
Definition: transaction.h:37
virtual ~WTransaction_Private()
Definition: transaction.cpp:418
WTransaction::Stage m_stage
Definition: transaction_p.h:77
QString m_errstr
Definition: transaction_p.h:78
QByteArray m_rspdata
Definition: transaction_p.h:81
virtual void webTimeout()
Definition: transaction.cpp:229
virtual void webError()
Definition: transaction.cpp:248
virtual void detach()
Definition: transaction_p.h:120
WTransaction_Private * attach(WTransaction *)
attach this private object to a master
Definition: transaction.cpp:423
virtual void startQuery(QString, QByteArray)
Definition: transaction.cpp:79
void detach(QObject *)
detach this object from a master, delete it if there are no more masters
Definition: transaction.cpp:431
virtual void endQuery()
Definition: transaction.cpp:140
virtual void attach()
Definition: transaction_p.h:119
virtual QByteArray executeQuery(QString, QByteArray)
Definition: transaction.cpp:190
Definition: transaction.h:20
WTransaction_Private(WTransaction *)
Definition: transaction.cpp:408
Definition: transaction_p.h:50
QString m_iface
Definition: transaction_p.h:78
Log(WTransaction *parent, const QString &request, const QString &interface=QString())
WTransaction::Log * m_log
Definition: transaction_p.h:79
#define WOLF_BASE_EXPORT
Definition: exception.h:13
virtual void webReady()
Definition: transaction.cpp:239
Definition: transaction_p.h:112
QString m_wobstatus
Definition: transaction_p.h:78