2012-07-22 21:38:15 +00:00
|
|
|
/*
|
|
|
|
* libretroshare/src/retroshare: rsphoto.h
|
|
|
|
*
|
|
|
|
* RetroShare C++ Interface.
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie
|
|
|
|
*
|
|
|
|
* 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 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 RSPHOTOV2ITEMS_H_
|
|
|
|
#define RSPHOTOV2ITEMS_H_
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "serialiser/rsserviceids.h"
|
|
|
|
#include "serialiser/rsserial.h"
|
|
|
|
|
|
|
|
#include "rsgxsitems.h"
|
2012-11-24 19:49:23 +00:00
|
|
|
#include "retroshare/rsphoto.h"
|
2012-07-22 21:38:15 +00:00
|
|
|
|
2012-09-15 00:16:06 +00:00
|
|
|
const uint8_t RS_PKT_SUBTYPE_PHOTO_ITEM = 0x02;
|
|
|
|
const uint8_t RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM = 0x03;
|
|
|
|
const uint8_t RS_PKT_SUBTYPE_PHOTO_COMMENT_ITEM = 0x04;
|
2012-07-22 21:38:15 +00:00
|
|
|
|
|
|
|
class RsGxsPhotoAlbumItem : public RsGxsGrpItem
|
|
|
|
{
|
|
|
|
|
2012-07-26 21:48:54 +00:00
|
|
|
public:
|
2012-07-22 21:38:15 +00:00
|
|
|
|
2014-03-29 15:34:37 +00:00
|
|
|
RsGxsPhotoAlbumItem(): RsGxsGrpItem(RS_SERVICE_GXS_TYPE_PHOTO,
|
2012-07-31 21:27:34 +00:00
|
|
|
RS_PKT_SUBTYPE_PHOTO_ITEM) { return;}
|
2012-08-18 10:01:35 +00:00
|
|
|
virtual ~RsGxsPhotoAlbumItem() { return;}
|
2012-07-31 21:27:34 +00:00
|
|
|
|
2012-08-18 10:01:35 +00:00
|
|
|
void clear();
|
2012-07-31 21:27:34 +00:00
|
|
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
|
|
|
|
|
|
|
|
2012-07-22 21:38:15 +00:00
|
|
|
RsPhotoAlbum album;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RsGxsPhotoPhotoItem : public RsGxsMsgItem
|
|
|
|
{
|
2012-07-26 21:48:54 +00:00
|
|
|
public:
|
2012-07-22 21:38:15 +00:00
|
|
|
|
2014-03-29 15:34:37 +00:00
|
|
|
RsGxsPhotoPhotoItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_PHOTO,
|
2012-07-31 21:27:34 +00:00
|
|
|
RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM) {return; }
|
2012-08-18 10:01:35 +00:00
|
|
|
virtual ~RsGxsPhotoPhotoItem() { return;}
|
|
|
|
void clear();
|
2012-07-31 21:27:34 +00:00
|
|
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
2012-07-22 21:38:15 +00:00
|
|
|
RsPhotoPhoto photo;
|
|
|
|
};
|
|
|
|
|
2012-09-17 22:08:23 +00:00
|
|
|
class RsGxsPhotoCommentItem : public RsGxsMsgItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-03-29 15:34:37 +00:00
|
|
|
RsGxsPhotoCommentItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_PHOTO,
|
2012-09-17 22:08:23 +00:00
|
|
|
RS_PKT_SUBTYPE_PHOTO_COMMENT_ITEM) { return; }
|
|
|
|
virtual ~RsGxsPhotoCommentItem() { return; }
|
|
|
|
void clear();
|
|
|
|
std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
|
|
|
RsPhotoComment comment;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-07-22 21:38:15 +00:00
|
|
|
class RsGxsPhotoSerialiser : public RsSerialType
|
|
|
|
{
|
2012-07-28 20:01:30 +00:00
|
|
|
public:
|
|
|
|
|
2012-07-22 21:38:15 +00:00
|
|
|
RsGxsPhotoSerialiser()
|
2014-03-29 15:34:37 +00:00
|
|
|
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_GXS_TYPE_PHOTO)
|
2012-07-22 21:38:15 +00:00
|
|
|
{ return; }
|
|
|
|
virtual ~RsGxsPhotoSerialiser() { return; }
|
|
|
|
|
|
|
|
uint32_t size(RsItem *item);
|
|
|
|
bool serialise (RsItem *item, void *data, uint32_t *size);
|
|
|
|
RsItem * deserialise(void *data, uint32_t *size);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
uint32_t sizeGxsPhotoAlbumItem(RsGxsPhotoAlbumItem *item);
|
|
|
|
bool serialiseGxsPhotoAlbumItem (RsGxsPhotoAlbumItem *item, void *data, uint32_t *size);
|
|
|
|
RsGxsPhotoAlbumItem * deserialiseGxsPhotoAlbumItem(void *data, uint32_t *size);
|
|
|
|
|
|
|
|
uint32_t sizeGxsPhotoPhotoItem(RsGxsPhotoPhotoItem *item);
|
|
|
|
bool serialiseGxsPhotoPhotoItem (RsGxsPhotoPhotoItem *item, void *data, uint32_t *size);
|
|
|
|
RsGxsPhotoPhotoItem * deserialiseGxsPhotoPhotoItem(void *data, uint32_t *size);
|
|
|
|
|
2012-09-17 22:08:23 +00:00
|
|
|
uint32_t sizeGxsPhotoCommentItem(RsGxsPhotoCommentItem *item);
|
|
|
|
bool serialiseGxsPhotoCommentItem (RsGxsPhotoCommentItem *item, void *data, uint32_t *size);
|
|
|
|
RsGxsPhotoCommentItem * deserialiseGxsPhotoCommentItem(void *data, uint32_t *size);
|
2012-07-22 21:38:15 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* RSPHOTOV2ITEMS_H_ */
|