smf/smfservermodule/smfclient/client/smfgallery.h
changeset 14 a469c0e6e7fb
parent 7 be09cf1f39dd
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    22 
    22 
    23 #include "smfglobal.h"
    23 #include "smfglobal.h"
    24 #include "smfprovider.h"
    24 #include "smfprovider.h"
    25 #include "smfclientglobal.h"
    25 #include "smfclientglobal.h"
    26 #include "smfpicture.h"
    26 #include "smfpicture.h"
       
    27 #include "smfpicturealbum.h"
    27 #include "smfcomment.h"
    28 #include "smfcomment.h"
       
    29 #include "smfcontact.h"
    28 
    30 
    29 #include <QObject>
    31 #include <QObject>
    30 #include <QDateTime>
    32 #include <QDateTime>
    31 #include <QStringList>
    33 #include <QStringList>
    32 
    34 
    62    */
    64    */
    63 
    65 
    64   SmfGallery(SmfProvider* baseprovider);
    66   SmfGallery(SmfProvider* baseprovider);
    65   ~SmfGallery();
    67   ~SmfGallery();
    66 
    68 
    67 public:
    69 	public slots:
       
    70 	/**
       
    71 	 * Get the album listing asynchronously.
       
    72 	 * The albumsAvailable() signal is emitted with SmfPictureAlbumList once the albums have arrived.
       
    73 	 * When the list is big user can specify the page number and per page item data.
       
    74 	 * If not supplied by the user default values are used.
       
    75 	 * @param names the subject or any keywords to be used to filter albums with that name
       
    76 	 * @param user the user whose albums are requested 
       
    77 	 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
    78 	 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
    79 	 */
       
    80 	void albums(QStringList names, SmfContact* user, int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
       
    81 	
       
    82 	
    68   /**
    83   /**
    69    * Get the picture listing asynchronously.
    84    * Get the picture listing asynchronously.
    70    * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived.
    85    * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived.
    71    * When the list is big user can specify the page number and per page item data.
    86    * When the list is big user can specify the page number and per page item data.
    72    * If not supplied by the user default values are used.
    87    * If not supplied by the user default values are used.
       
    88 	 * @param albums album(s) whose pictures are being requested
    73    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    89    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
    74    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    90    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
    75    */
    91    */
    76   void pictures(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
    92 	void pictures(SmfPictureAlbumList &albums, int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
    77 
    93 
    78   /**
    94   /**
    79    * Returns a user title/caption for the picture
    95    * Returns a user title/caption for the picture
    80    */
    96    */
    81   QString description(SmfPicture& picture);
    97   QString description(SmfPicture& picture);
    88 public slots:
   104 public slots:
    89 	/**
   105 	/**
    90 	 * Upload an image.Implemented as slot to connect to UI controls more easily
   106 	 * Upload an image.Implemented as slot to connect to UI controls more easily
    91 	 * uploadFinished() signal is emitted with the success value of the upload
   107 	 * uploadFinished() signal is emitted with the success value of the upload
    92 	 * @param image the image to be uploaded
   108 	 * @param image the image to be uploaded
       
   109 	 * @param album the optional destination album name 
    93 	 */
   110 	 */
    94    void upload(SmfPicture* image) ;
   111 	void upload(SmfPicture* image, SmfPictureAlbum* album=NULL) ;
    95 
   112 
    96 	/**
   113 	/**
    97 	 * Upload an list image.Implemented as slot to connect to UI controls more easily
   114 	 * Upload an list image.Implemented as slot to connect to UI controls more easily
    98 	 * uploadFinished() signal is emitted with the success value of the upload
   115 	 * uploadFinished() signal is emitted with the success value of the upload
    99 	 * @param images the list image to be uploaded
   116 	 * @param images the list image to be uploaded
       
   117 	 * @param album the optional destination album name 
   100 	 */
   118 	 */
   101    void upload(SmfPictureList* images) ;
   119 	void upload(SmfPictureList* images, SmfPictureAlbum* album=NULL) ;
   102 
   120 
   103   /**
   121   /**
   104    * Posts a comment for an image. uploadFinished() signal is emitted
   122    * Posts a comment for an image. uploadFinished() signal is emitted
   105    * with success of the post once comment is posted.
   123    * with success of the post once comment is posted.
   106    * @param image Image to comment on
   124    * @param image Image to comment on
   113 	* @param customData Custom data to be sent
   131 	* @param customData Custom data to be sent
   114 	* Note:-Interpretation of operationId and customData is upto the concerned
   132 	* Note:-Interpretation of operationId and customData is upto the concerned
   115 	* plugin and client application. service provider should provide some
   133 	* plugin and client application. service provider should provide some
   116 	* serializing-deserializing utilities for these custom data
   134 	* serializing-deserializing utilities for these custom data
   117 	*/
   135 	*/
   118    void customRequest(const int& operationId,QByteArray* customData){/*to be implemented*/};
   136    void customRequest(const int& operationId,QByteArray* customData);
   119 signals:
   137 signals:
       
   138 	
       
   139 	/*
       
   140 	 * Notification on arrival of list of SmfPictureAlbum as a result of call to @ref albums().
       
   141 	 * @param pics Picture list
       
   142 	 * @param error Error string
       
   143 	 * @param resultPage Page number info
       
   144 	 */
       
   145 	void albumsAvailable(SmfPictureAlbumList* albums, SmfError error, SmfResultPage resultPage);
       
   146 	
   120 	/*
   147 	/*
   121 	 * Notification on arrival of list of SmfPicture as a result of request.
   148 	 * Notification on arrival of list of SmfPicture as a result of request.
   122 	 * Note if number of friends is large, then it can download the list page by page.
   149 	 * Note if number of friends is large, then it can download the list page by page.
   123 	 * In that case this signal is emitted multiple times.
   150 	 * In that case this signal is emitted multiple times.
   124 	 * through pictures().
   151 	 * through pictures().
   130 
   157 
   131   /**
   158   /**
   132    * Notification of the success of the uploading of image/comment
   159    * Notification of the success of the uploading of image/comment
   133    * @param error The upload success result of each individual pictures
   160    * @param error The upload success result of each individual pictures
   134    */
   161    */
   135   void uploadFinished(QList<bool> error);
   162   void uploadFinished(QList<SmfError> error);
   136 	/**
   163 	/**
   137 	 * Emitted when custom data is available
   164 	 * Emitted when custom data is available
   138 	 * @param operationId Requested operation id
   165 	 * @param operationId Requested operation id
   139 	 * @param customData Custom data received, interpretation is not the responsibility of Smf
   166 	 * @param customData Custom data received, interpretation is not the responsibility of Smf
   140 	 */
   167 	 */
   141 	void customDataAvailable(int operationId, QByteArray* customData);
   168 	void customDataAvailable(int operationId, QByteArray* customData);
       
   169 
       
   170 	/** friend so that it can directly emit SmfGallery's signal*/
       
   171 	friend class SmfGalleryPrivate;
       
   172 
       
   173 
   142 private:
   174 private:
   143 	SmfProvider* m_baseProvider;
   175 	SmfProvider* m_baseProvider;
   144 	//private impl wrapper
   176 	//private impl wrapper
   145 	SmfGalleryPrivate* m_private;
   177 	SmfGalleryPrivate* m_private;
   146 
   178