2012-07-05 21:26:14 +00:00
|
|
|
#ifndef RSGXSSERVICE_H
|
|
|
|
#define RSGXSSERVICE_H
|
|
|
|
|
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
#include "retroshare/rsgxsifacetypes.h"
|
2013-03-06 23:33:23 +00:00
|
|
|
#include "retroshare/rstokenservice.h"
|
2012-07-05 21:26:14 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
class RsMsgMetaData ;
|
|
|
|
|
2013-02-28 21:58:38 +00:00
|
|
|
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
|
|
|
|
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap;
|
2012-07-05 21:26:14 +00:00
|
|
|
|
|
|
|
/*!
|
2017-01-12 22:28:58 +01:00
|
|
|
* The aim of this class is to abstract how changes are represented so they can
|
|
|
|
* be determined outside the client API without explcitly enumerating all
|
|
|
|
* possible changes at the interface
|
2012-07-05 21:26:14 +00:00
|
|
|
*/
|
2017-01-12 22:28:58 +01:00
|
|
|
struct RsGxsNotify
|
2012-07-05 21:26:14 +00:00
|
|
|
{
|
2017-01-12 22:28:58 +01:00
|
|
|
enum NotifyType
|
|
|
|
{ TYPE_PUBLISH, TYPE_RECEIVE, TYPE_PROCESSED, TYPE_PUBLISHKEY };
|
2012-07-05 21:26:14 +00:00
|
|
|
|
2017-01-12 22:28:58 +01:00
|
|
|
virtual ~RsGxsNotify() {}
|
|
|
|
virtual NotifyType getType() = 0;
|
2012-07-05 21:26:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Relevant to group changes
|
|
|
|
*/
|
2012-07-28 20:01:30 +00:00
|
|
|
class RsGxsGroupChange : public RsGxsNotify
|
2012-07-05 21:26:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-07-04 21:51:17 +00:00
|
|
|
RsGxsGroupChange(NotifyType type, bool metaChange) : NOTIFY_TYPE(type), mMetaChange(metaChange) {}
|
2013-02-28 21:58:38 +00:00
|
|
|
std::list<RsGxsGroupId> mGrpIdList;
|
2013-06-04 21:00:43 +00:00
|
|
|
NotifyType getType(){ return NOTIFY_TYPE;}
|
2014-07-04 21:51:17 +00:00
|
|
|
bool metaChange() { return mMetaChange; }
|
2013-06-04 21:00:43 +00:00
|
|
|
private:
|
|
|
|
const NotifyType NOTIFY_TYPE;
|
2014-07-04 21:51:17 +00:00
|
|
|
bool mMetaChange;
|
2012-07-05 21:26:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Relevant to message changes
|
|
|
|
*/
|
2012-07-28 20:01:30 +00:00
|
|
|
class RsGxsMsgChange : public RsGxsNotify
|
2012-07-05 21:26:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-07-04 21:51:17 +00:00
|
|
|
RsGxsMsgChange(NotifyType type, bool metaChange) : NOTIFY_TYPE(type), mMetaChange(metaChange) {}
|
2012-07-22 21:38:15 +00:00
|
|
|
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
|
2013-06-04 21:00:43 +00:00
|
|
|
NotifyType getType(){ return NOTIFY_TYPE;}
|
2014-07-04 21:51:17 +00:00
|
|
|
bool metaChange() { return mMetaChange; }
|
2013-06-04 21:00:43 +00:00
|
|
|
private:
|
|
|
|
const NotifyType NOTIFY_TYPE;
|
2014-07-04 21:51:17 +00:00
|
|
|
bool mMetaChange;
|
2012-07-05 21:26:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RSGXSSERVICE_H
|