mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 22:40:36 -04:00
Removed references to postedVEG from GxsGroupDialog and associated classes and PostedDialog (GUI does not work now but does not crash)
Removed V2 references: TokenQueueV2 and RsTokReqOptionsV2 are now TokenQueue and RsTokReqOptions and renamed file Added initialisation of Posted back end service successfully Added new msg status flags GXS_SERV::MSG_STATUS_UNPROCESSED and ::MSG_STATUS_UNREAD git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5707 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dcb64f6631
commit
c518bd2f19
44 changed files with 2379 additions and 3761 deletions
122
retroshare-gui/src/util/TokenQueue.h
Normal file
122
retroshare-gui/src/util/TokenQueue.h
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* Token Queue.
|
||||
*
|
||||
* Copyright 2012-2012 by Robert Fernie, Christopher Evi-Parker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MRK_TOKEN_QUEUE_V2_H
|
||||
#define MRK_TOKEN_QUEUE_V2_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <gxs/rstokenservice.h>
|
||||
|
||||
|
||||
|
||||
#define COMPLETED_REQUEST 4
|
||||
|
||||
#define TOKENREQ_GROUPINFO 1
|
||||
#define TOKENREQ_MSGINFO 2
|
||||
#define TOKENREQ_MSGRELATEDINFO 3
|
||||
|
||||
|
||||
class TokenQueue;
|
||||
|
||||
class TokenRequest
|
||||
{
|
||||
public:
|
||||
uint32_t mToken;
|
||||
uint32_t mType;
|
||||
uint32_t mAnsType;
|
||||
uint32_t mUserType;
|
||||
struct timeval mRequestTs;
|
||||
struct timeval mPollTs;
|
||||
};
|
||||
|
||||
class TokenResponse
|
||||
{
|
||||
public:
|
||||
//virtual ~TokenResponse() { return; }
|
||||
// These Functions are overloaded to get results out.
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req) = 0;
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
* An important thing to note is that all requests are stacked (so FIFO)
|
||||
* This is to prevent overlapped loads on GXS UIs
|
||||
*/
|
||||
class TokenQueue: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TokenQueue(RsTokenService *service, TokenResponse *resp);
|
||||
|
||||
/* generic handling of token / response update behaviour */
|
||||
|
||||
/*!
|
||||
*
|
||||
* @token the token to be redeem is assigned here
|
||||
*
|
||||
*/
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
std::list<RsGxsGroupId>& ids, uint32_t usertype);
|
||||
|
||||
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, uint32_t usertype);
|
||||
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const std::list<RsGxsGroupId>& grpIds, uint32_t usertype);
|
||||
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const GxsMsgReq& grpIds, uint32_t usertype);
|
||||
|
||||
bool requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptions &opts, const RsGxsGrpMsgIdPair& msgId, uint32_t usertype);
|
||||
|
||||
bool cancelRequest(const uint32_t token);
|
||||
|
||||
void queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype);
|
||||
bool checkForRequest(uint32_t token);
|
||||
void loadRequest(const TokenRequest &req);
|
||||
|
||||
protected:
|
||||
void doPoll(float dt);
|
||||
|
||||
private slots:
|
||||
void pollRequests();
|
||||
|
||||
private:
|
||||
/* Info for Data Requests */
|
||||
std::list<TokenRequest> mRequests;
|
||||
|
||||
RsTokenService *mService;
|
||||
TokenResponse *mResponder;
|
||||
|
||||
QTimer *mTrigger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue