2008-03-04 16:31:11 -05:00
|
|
|
#ifndef RETROSHARE_PHOTO_GUI_INTERFACE_H
|
|
|
|
#define RETROSHARE_PHOTO_GUI_INTERFACE_H
|
|
|
|
|
|
|
|
/*
|
2012-02-04 09:16:39 -05:00
|
|
|
* libretroshare/src/retroshare: rsphoto.h
|
2008-03-04 16:31:11 -05:00
|
|
|
*
|
|
|
|
* RetroShare C++ Interface.
|
|
|
|
*
|
2012-02-04 09:16:39 -05:00
|
|
|
* Copyright 2008-2012 by Robert Fernie.
|
2008-03-04 16:31:11 -05:00
|
|
|
*
|
|
|
|
* 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".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
2012-06-08 09:52:32 -04:00
|
|
|
#include <retroshare/rsidentity.h>
|
2008-03-04 16:31:11 -05:00
|
|
|
|
|
|
|
/* The Main Interface Class - for information about your Peers */
|
|
|
|
class RsPhoto;
|
|
|
|
extern RsPhoto *rsPhoto;
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
/******************* NEW STUFF FOR NEW CACHE SYSTEM *********/
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
#define RSPHOTO_MODE_NEW 1
|
|
|
|
#define RSPHOTO_MODE_OWN 2
|
|
|
|
#define RSPHOTO_MODE_REMOTE 3
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-08 09:52:32 -04:00
|
|
|
class RsPhotoThumbnail
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RsPhotoThumbnail()
|
|
|
|
:data(NULL), size(0), type("N/A") { return; }
|
|
|
|
|
2012-06-21 11:50:27 -04:00
|
|
|
bool deleteImage();
|
2012-06-08 09:52:32 -04:00
|
|
|
bool copyFrom(const RsPhotoThumbnail &nail);
|
|
|
|
|
|
|
|
// Holds Thumbnail image.
|
|
|
|
uint8_t *data;
|
|
|
|
int size;
|
|
|
|
std::string type;
|
|
|
|
};
|
|
|
|
|
2012-06-21 11:50:27 -04:00
|
|
|
|
|
|
|
/* If these flags are no set - the Photo inherits values from the Album
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_TITLE 0x0001
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_CAPTION 0x0002
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_DESC 0x0004
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER 0x0008
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_WHERE 0x0010
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_WHEN 0x0020
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_OTHER 0x0040
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_CATEGORY 0x0080
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_HASHTAGS 0x0100
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_ORDER 0x0200
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_THUMBNAIL 0x0400
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_MODE 0x0800
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_AUTHOR 0x1000 // PUSH UP ORDER
|
|
|
|
#define RSPHOTO_FLAGS_ATTRIB_PHOTO 0x2000 // PUSH UP ORDER.
|
|
|
|
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
class RsPhotoPhoto
|
2008-03-04 16:31:11 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
RsMsgMetaData mMeta;
|
|
|
|
|
2012-06-21 11:50:27 -04:00
|
|
|
RsPhotoPhoto();
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
// THESE ARE IN THE META DATA.
|
|
|
|
//std::string mAlbumId;
|
|
|
|
//std::string mId;
|
|
|
|
//std::string mTitle; // only used by Album.
|
2012-02-04 09:16:39 -05:00
|
|
|
std::string mCaption;
|
|
|
|
std::string mDescription;
|
|
|
|
std::string mPhotographer;
|
|
|
|
std::string mWhere;
|
|
|
|
std::string mWhen;
|
|
|
|
std::string mOther;
|
|
|
|
std::string mCategory;
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
std::string mHashTags;
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-21 11:50:27 -04:00
|
|
|
uint32_t mSetFlags;
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
int mOrder;
|
|
|
|
|
2012-06-08 09:52:32 -04:00
|
|
|
RsPhotoThumbnail mThumbnail;
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
int mMode;
|
2012-06-21 11:50:27 -04:00
|
|
|
|
|
|
|
// These are not saved.
|
2012-02-04 09:16:39 -05:00
|
|
|
std::string path; // if in Mode NEW.
|
2012-06-21 11:50:27 -04:00
|
|
|
uint32_t mModFlags;
|
2008-03-04 16:31:11 -05:00
|
|
|
};
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
class RsPhotoAlbumShare
|
2008-03-04 16:31:11 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
uint32_t mShareType;
|
|
|
|
std::string mShareGroupId;
|
|
|
|
std::string mPublishKey;
|
|
|
|
uint32_t mCommentMode;
|
|
|
|
uint32_t mResizeMode;
|
|
|
|
};
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
class RsPhotoAlbum
|
2012-02-04 09:16:39 -05:00
|
|
|
{
|
|
|
|
public:
|
2012-06-21 11:50:27 -04:00
|
|
|
RsPhotoAlbum();
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
RsGroupMetaData mMeta;
|
|
|
|
|
|
|
|
// THESE ARE IN THE META DATA.
|
|
|
|
//std::string mAlbumId;
|
|
|
|
//std::string mTitle; // only used by Album.
|
|
|
|
|
|
|
|
std::string mCaption;
|
|
|
|
std::string mDescription;
|
|
|
|
std::string mPhotographer;
|
|
|
|
std::string mWhere;
|
|
|
|
std::string mWhen;
|
|
|
|
std::string mOther;
|
|
|
|
std::string mCategory;
|
|
|
|
|
|
|
|
std::string mHashTags;
|
|
|
|
|
|
|
|
RsPhotoThumbnail mThumbnail;
|
|
|
|
|
|
|
|
int mMode;
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
std::string mPhotoPath;
|
|
|
|
RsPhotoAlbumShare mShareOptions;
|
2012-06-21 11:50:27 -04:00
|
|
|
|
|
|
|
// These aren't saved.
|
|
|
|
uint32_t mSetFlags;
|
|
|
|
uint32_t mModFlags;
|
2012-02-04 09:16:39 -05:00
|
|
|
};
|
2008-03-17 09:51:04 -04:00
|
|
|
|
2012-06-21 11:50:27 -04:00
|
|
|
std::ostream &operator<<(std::ostream &out, const RsPhotoPhoto &photo);
|
|
|
|
std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album);
|
|
|
|
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-08 09:52:32 -04:00
|
|
|
class RsPhoto: public RsTokenService
|
2008-03-04 16:31:11 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
RsPhoto() { return; }
|
|
|
|
virtual ~RsPhoto() { return; }
|
|
|
|
|
2008-03-17 09:51:04 -04:00
|
|
|
/* changed? */
|
|
|
|
virtual bool updated() = 0;
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Data Requests */
|
|
|
|
//virtual bool requestGroupInfo( uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &groupIds) = 0;
|
|
|
|
//virtual bool requestMsgInfo( uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &groupIds) = 0;
|
|
|
|
//virtual bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &msgIds) = 0;
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Generic Lists */
|
|
|
|
//virtual bool getGroupList( const uint32_t &token, std::list<std::string> &groupIds) = 0;
|
|
|
|
//virtual bool getMsgList( const uint32_t &token, std::list<std::string> &msgIds) = 0;
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Generic Summary */
|
|
|
|
//virtual bool getGroupSummary( const uint32_t &token, std::list<RsGroupMetaData> &groupInfo) = 0;
|
|
|
|
//virtual bool getMsgSummary( const uint32_t &token, std::list<RsMsgMetaData> &msgInfo) = 0;
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Actual Data -> specific to Interface */
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2008-03-04 16:31:11 -05:00
|
|
|
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Poll */
|
|
|
|
//virtual uint32_t requestStatus(const uint32_t token) = 0;
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Cancel Request */
|
|
|
|
//virtual bool cancelRequest(const uint32_t &token) = 0;
|
2012-06-08 18:03:09 -04:00
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
/* Functions from Forums -> need to be implemented generically */
|
|
|
|
//virtual bool groupsChanged(std::list<std::string> &groupIds) = 0;
|
2012-06-08 18:03:09 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
// Get Message Status - is retrived via MessageSummary.
|
|
|
|
//virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask) = 0;
|
2012-06-08 18:03:09 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//
|
|
|
|
//virtual bool groupSubscribe(const std::string &groupId, bool subscribe) = 0;
|
|
|
|
|
|
|
|
//virtual bool groupRestoreKeys(const std::string &groupId) = 0;
|
|
|
|
//virtual bool groupShareKeys(const std::string &groupId, std::list<std::string>& peers) = 0;
|
2012-06-08 18:03:09 -04:00
|
|
|
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Specific Service Data */
|
|
|
|
virtual bool getAlbum(const uint32_t &token, RsPhotoAlbum &album) = 0;
|
|
|
|
virtual bool getPhoto(const uint32_t &token, RsPhotoPhoto &photo) = 0;
|
2012-06-08 09:52:32 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* details are updated in album - to choose Album ID, and storage path */
|
2012-06-21 11:50:27 -04:00
|
|
|
virtual bool submitAlbumDetails(RsPhotoAlbum &album, bool isNew) = 0;
|
|
|
|
virtual bool submitPhoto(RsPhotoPhoto &photo, bool isNew) = 0;
|
2008-03-04 16:31:11 -05:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-02-04 09:16:39 -05:00
|
|
|
|
2008-03-04 16:31:11 -05:00
|
|
|
#endif
|