smf/smfservermodule/smfclient/client/smfgallery.cpp
changeset 18 013a02bf2bb0
parent 17 106a4bfcb866
child 19 c412f0526c34
equal deleted inserted replaced
17:106a4bfcb866 18:013a02bf2bb0
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "Eclipse Public License v1.0"
       
     6  * which accompanies  this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  *
       
    15  * Description:
       
    16  * The SmfGallery class 
       
    17  *
       
    18  */
       
    19 
       
    20 #include "smfgallery.h"
       
    21 #include "smfgallery_p.h"
       
    22 
       
    23 
       
    24   SmfGallery::SmfGallery(SmfProvider* baseprovider):m_baseProvider(baseprovider)
       
    25 	  {
       
    26 	  //creating private impl wrapper
       
    27 	  m_private = new SmfGalleryPrivate(this);
       
    28 	  }
       
    29   SmfGallery::~SmfGallery()
       
    30 	  {
       
    31 	  if(m_private)
       
    32 		  {
       
    33 		  delete m_private;
       
    34 		  m_private = NULL;
       
    35 		  }
       
    36 	  }
       
    37 
       
    38   /**
       
    39  * Get the album listing asynchronously.
       
    40  * The albumsAvailable() signal is emitted with SmfPictureAlbumList once the albums have arrived.
       
    41    * When the list is big user can specify the page number and per page item data.
       
    42    * If not supplied by the user default values are used.
       
    43  * @param names the subject or any keywords to be used to filter albums with that name
       
    44  * @param user the user whose albums are requested 
       
    45    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
    46    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
    47    */
       
    48 void SmfGallery::albums(QStringList names, SmfContact* user, int pageNum,int perPage)
       
    49 	  {
       
    50 		m_private->albums(names,user, pageNum, perPage);	
       
    51 	  }
       
    52 
       
    53   /**
       
    54  * Get the picture listing asynchronously.
       
    55  * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived.
       
    56  * When the list is big user can specify the page number and per page item data.
       
    57  * If not supplied by the user default values are used.
       
    58  * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
    59  * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
    60    */
       
    61 void SmfGallery::pictures(SmfPictureAlbumList &albums, int pageNum,int perPage)
       
    62 	  {
       
    63 	m_private->pictures( albums, pageNum, perPage);
       
    64 	  }
       
    65 
       
    66   //APIs to get/set base provider info (SmfProvider)
       
    67 
       
    68   /**
       
    69    * Gets the base provider info
       
    70    */
       
    71    SmfProvider* SmfGallery::getProvider() 
       
    72 	   {
       
    73 	   return m_baseProvider;
       
    74 	   }
       
    75 
       
    76 	/**
       
    77 	 * Upload an image.Implemented as slot to connect to UI controls more easily
       
    78 	 * uploadFinished() signal is emitted with the success value of the upload
       
    79 	 * @param image the image to be uploaded
       
    80 	 */
       
    81 void SmfGallery::upload(SmfPicture* image, SmfPictureAlbum* album)
       
    82 	   {
       
    83 	m_private->upload(image,album);
       
    84 	   }
       
    85 
       
    86 	/**
       
    87 	 * Upload an list image.Implemented as slot to connect to UI controls more easily
       
    88 	 * uploadFinished() signal is emitted with the success value of the upload
       
    89 	 * @param images the list image to be uploaded
       
    90 	 */
       
    91 
       
    92 void SmfGallery::upload(SmfPictureList* images, SmfPictureAlbum* album) 
       
    93 	   {
       
    94 	m_private->upload(images,album);
       
    95 	   }
       
    96 
       
    97   /**
       
    98    * Posts a comment for an image. uploadFinished() signal is emitted
       
    99    * with success of the post once comment is posted.
       
   100    * @param image Image to comment on
       
   101    * @param comment Comment to post
       
   102    */
       
   103    void SmfGallery::postComment(SmfPicture image, SmfComment comment) 
       
   104 	   {
       
   105 	   m_private->postComment(image,comment);
       
   106 	   }
       
   107    
       
   108 QString SmfGallery::description(SmfPicture& picture)
       
   109    {
       
   110 		Q_UNUSED(picture);
       
   111    }
       
   112 /**
       
   113  * Request for a custom operation.
       
   114  * @param operationId OperationId
       
   115  * @param customData Custom data to be sent
       
   116  * Note:-Interpretation of operationId and customData is upto the concerned
       
   117  * plugin and client application. service provider should provide some
       
   118  * serializing-deserializing utilities for these custom data
       
   119  */
       
   120 void SmfGallery::customRequest(const int& operationId,QByteArray* customData)
       
   121 	{
       
   122 	/*to be implemented*/
       
   123 	Q_UNUSED(operationId);
       
   124 	Q_UNUSED(customData);
       
   125 	}