2014-05-03 08:50:40 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <QGraphicsView>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <retroshare/rstypes.h>
|
|
|
|
|
|
|
|
#include "util/TokenQueue.h"
|
|
|
|
|
|
|
|
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
|
|
|
|
|
|
|
class UIStateHelper;
|
|
|
|
class IdentityItem ;
|
2014-05-05 17:12:23 -04:00
|
|
|
class CircleItem ;
|
2014-05-03 08:50:40 -04:00
|
|
|
|
|
|
|
class GroupListView : public QGraphicsView, public TokenResponse
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static const uint32_t GLVIEW_IDLIST ;
|
|
|
|
static const uint32_t GLVIEW_IDDETAILS ;
|
2014-05-05 17:12:23 -04:00
|
|
|
static const uint32_t GLVIEW_CIRCLES ;
|
2014-05-03 08:50:40 -04:00
|
|
|
static const uint32_t GLVIEW_REFRESH ;
|
|
|
|
|
|
|
|
GroupListView(QWidget * = NULL);
|
|
|
|
|
|
|
|
void clearGraph() ;
|
|
|
|
|
|
|
|
// Derives from RsGxsUpdateBroadcastPage
|
|
|
|
virtual void updateDisplay(bool) ;
|
|
|
|
|
|
|
|
virtual void itemMoved();
|
|
|
|
|
|
|
|
void setEdgeLength(uint32_t l) ;
|
|
|
|
uint32_t edgeLength() const { return _edge_length ; }
|
|
|
|
|
|
|
|
void loadRequest(const TokenQueue * /*queue*/, const TokenRequest &req) ;
|
2014-05-05 17:12:23 -04:00
|
|
|
|
2014-05-03 08:50:40 -04:00
|
|
|
void requestIdList() ;
|
2014-05-05 17:12:23 -04:00
|
|
|
void requestCirclesList() ;
|
|
|
|
|
2014-05-03 08:50:40 -04:00
|
|
|
void insertIdList(uint32_t token) ;
|
2014-05-05 17:12:23 -04:00
|
|
|
void insertCircles(uint32_t token) ;
|
2014-05-03 08:50:40 -04:00
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void forceRedraw() ;
|
|
|
|
protected:
|
|
|
|
void timerEvent(QTimerEvent *event);
|
|
|
|
void wheelEvent(QWheelEvent *event);
|
|
|
|
void drawBackground(QPainter *painter, const QRectF &rect);
|
|
|
|
|
|
|
|
void scaleView(qreal scaleFactor);
|
|
|
|
|
|
|
|
virtual void keyPressEvent(QKeyEvent *event);
|
|
|
|
virtual void resizeEvent(QResizeEvent *e) ;
|
|
|
|
|
|
|
|
static QImage makeDefaultIcon(const RsGxsId& id) ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
int timerId;
|
|
|
|
//Node *centerNode;
|
|
|
|
bool mDeterminedBB ;
|
|
|
|
bool mIsFrozen;
|
|
|
|
|
|
|
|
//std::vector<Node *> _groups ;
|
|
|
|
//std::map<std::pair<NodeId,NodeId>,Edge *> _edges ;
|
|
|
|
//std::map<std::string,QPointF> _node_cached_positions ;
|
|
|
|
|
|
|
|
uint32_t _edge_length ;
|
|
|
|
float _friction_factor ;
|
|
|
|
//NodeId _current_node ;
|
|
|
|
|
2014-05-25 17:43:05 -04:00
|
|
|
TokenQueue *mIdentityQueue;
|
|
|
|
TokenQueue *mCirclesQueue;
|
|
|
|
|
2014-05-03 08:50:40 -04:00
|
|
|
UIStateHelper *mStateHelper;
|
|
|
|
|
|
|
|
std::map<RsGxsGroupId,IdentityItem *> _identity_items ;
|
2014-05-05 17:12:23 -04:00
|
|
|
std::map<RsGxsGroupId,CircleItem *> _circles_items ;
|
2014-05-03 08:50:40 -04:00
|
|
|
};
|
|
|
|
|