2012-09-13 18:58:42 -04:00
|
|
|
#ifndef PHOTOSHARE_H
|
|
|
|
#define PHOTOSHARE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2012-09-17 18:08:23 -04:00
|
|
|
#include <map>
|
|
|
|
#include "ui_PhotoShare.h"
|
|
|
|
|
|
|
|
#include "retroshare/rsphotoV2.h"
|
|
|
|
#include "retroshare-gui/mainpage.h"
|
|
|
|
|
|
|
|
#include "AlbumCreateDialog.h"
|
|
|
|
#include "AlbumDialog.h"
|
|
|
|
#include "PhotoDialog.h"
|
|
|
|
|
|
|
|
#include "AlbumItem.h"
|
|
|
|
#include "PhotoItem.h"
|
|
|
|
#include "PhotoSlideShow.h"
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
#include "util/TokenQueue.h"
|
2012-09-17 18:08:23 -04:00
|
|
|
#include "PhotoShareItemHolder.h"
|
2012-09-13 18:58:42 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class PhotoShare;
|
|
|
|
}
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
class PhotoShare : public MainPage, public TokenResponse, public PhotoShareItemHolder
|
2012-09-13 18:58:42 -04:00
|
|
|
{
|
2012-09-17 18:08:23 -04:00
|
|
|
Q_OBJECT
|
2012-09-13 18:58:42 -04:00
|
|
|
|
|
|
|
public:
|
2012-09-17 18:08:23 -04:00
|
|
|
PhotoShare(QWidget *parent = 0);
|
|
|
|
|
|
|
|
void notifySelection(PhotoShareItem* selection);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void checkUpdate();
|
|
|
|
void createAlbum();
|
|
|
|
void OpenAlbumDialog();
|
|
|
|
void OpenPhotoDialog();
|
|
|
|
void OpenSlideShow();
|
|
|
|
void SetAlbumDialogClosed();
|
|
|
|
void SetPhotoDialogClosed();
|
|
|
|
void updateAlbums();
|
|
|
|
void subscribeToAlbum();
|
2012-09-30 10:21:17 -04:00
|
|
|
void deleteAlbum(const RsGxsGroupId&);
|
2012-09-17 18:08:23 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
/* Request Response Functions for loading data */
|
|
|
|
void requestAlbumList(std::list<std::string>& ids);
|
|
|
|
void requestAlbumData(std::list<RsGxsGroupId> &ids);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* request data for all groups
|
|
|
|
*/
|
|
|
|
void requestAlbumData();
|
|
|
|
void requestPhotoList(GxsMsgReq &albumIds);
|
|
|
|
void requestPhotoList(const std::string &albumId);
|
|
|
|
void requestPhotoData(GxsMsgReq &photoIds);
|
2012-09-30 10:21:17 -04:00
|
|
|
void requestPhotoData(const std::list<RsGxsGroupId> &grpIds);
|
2012-09-17 18:08:23 -04:00
|
|
|
|
|
|
|
void loadAlbumList(const uint32_t &token);
|
|
|
|
bool loadAlbumData(const uint32_t &token);
|
|
|
|
void loadPhotoList(const uint32_t &token);
|
|
|
|
void loadPhotoData(const uint32_t &token);
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2012-09-17 18:08:23 -04:00
|
|
|
|
|
|
|
void acknowledgeGroup(const uint32_t &token);
|
|
|
|
void acknowledgeMessage(const uint32_t &token);
|
|
|
|
|
|
|
|
/* Grunt work of setting up the GUI */
|
|
|
|
|
|
|
|
void addAlbum(const RsPhotoAlbum &album);
|
|
|
|
void addPhoto(const RsPhotoPhoto &photo);
|
|
|
|
|
|
|
|
void clearAlbums();
|
|
|
|
void clearPhotos();
|
|
|
|
void deleteAlbums();
|
2012-09-30 10:21:17 -04:00
|
|
|
/*!
|
|
|
|
* Fills up photo ui with photos held in mPhotoItems (current groups photos)
|
|
|
|
*/
|
2012-09-17 18:08:23 -04:00
|
|
|
void updatePhotos();
|
2012-09-13 18:58:42 -04:00
|
|
|
|
|
|
|
private:
|
2012-09-17 18:08:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
AlbumItem* mAlbumSelected;
|
|
|
|
PhotoItem* mPhotoSelected;
|
|
|
|
PhotoSlideShow* mSlideShow;
|
|
|
|
AlbumDialog* mAlbumDialog;
|
|
|
|
PhotoDialog* mPhotoDialog;
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
TokenQueue *mPhotoQueue;
|
2012-09-17 18:08:23 -04:00
|
|
|
|
|
|
|
/* UI - from Designer */
|
|
|
|
Ui::PhotoShare ui;
|
|
|
|
|
|
|
|
QSet<AlbumItem*> mAlbumItems;
|
2012-09-30 10:21:17 -04:00
|
|
|
QSet<PhotoItem*> mPhotoItems; // the current album selected
|
2012-09-17 18:08:23 -04:00
|
|
|
|
2012-09-13 18:58:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PHOTOSHARE_H
|