#ifndef P3PHOTOSERVICEV2_H #define P3PHOTOSERVICEV2_H /* * libretroshare/src/retroshare: rsphoto.h * * RetroShare C++ Interface. * * Copyright 2008-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 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 "gxs/rsgenexchange.h" #include "retroshare/rsphotoV2.h" class p3PhotoServiceV2 : public RsPhotoV2, public RsGenExchange { public: p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes); public: /*! * @return */ bool updated(); protected: void notifyChanges(std::vector& changes); public: /** Requests **/ void groupsChanged(std::list& grpIds); void msgsChanged(std::map >& msgs); RsTokenServiceV2* getTokenService(); bool getGroupList(const uint32_t &token, std::list &groupIds); bool getMsgList(const uint32_t &token, GxsMsgIdResult& msgIds); /* Generic Summary */ bool getGroupSummary(const uint32_t &token, std::list &groupInfo); bool getMsgSummary(const uint32_t &token, MsgMetaResult &msgInfo); /* Specific Service Data */ bool getAlbum(const uint32_t &token, std::vector &albums); bool getPhoto(const uint32_t &token, PhotoResult &photos); public: /** Modifications **/ bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album); bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo); /*! * This allows the client service to acknowledge that their msgs has * been created/modified and retrieve the create/modified msg ids * @param token the token related to modification/create request * @param msgIds map of grpid->msgIds of message created/modified * @return true if token exists false otherwise */ bool acknowledgeMsg(const uint32_t& token, std::pair& msgId); /*! * This allows the client service to acknowledge that their grps has * been created/modified and retrieve the create/modified grp ids * @param token the token related to modification/create request * @param msgIds vector of ids of groups created/modified * @return true if token exists false otherwise */ bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId); private: std::vector mGroupChange; std::vector mMsgChange; }; #endif // P3PHOTOSERVICEV2_H