smf/smfservermodule/smfclient/client/smfgallery_p.h
changeset 10 1d94eb8df9c2
parent 9 b85b0c039c14
equal deleted inserted replaced
9:b85b0c039c14 10:1d94eb8df9c2
     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  * Private implementation for SmfGallery class 
       
    17  *
       
    18  */
       
    19 /**
       
    20  * Private Qt wrapper
       
    21  * Provided to accomodate diff facilities in diff platforms.
       
    22  * Uses Symbian client-server for Symbian
       
    23  * QDbus for linux
       
    24  * QLocalserver for rest of the platforms
       
    25  * Note:- only symbian client-server impl is provided at the moment
       
    26  **/
       
    27 
       
    28 #include "smfprovider.h"
       
    29 #include "SmfClientGlobal.h"
       
    30 #include "smfGlobal.h"
       
    31 #include "SmfObserver.h"
       
    32 
       
    33 class SmfProvider;
       
    34 
       
    35 
       
    36 #include <QObject>
       
    37 #include <QDateTime>
       
    38 #include <QStringList>
       
    39 
       
    40 #include "SmfObserver.h"
       
    41 #include "smfgallery.h"
       
    42 #ifdef Q_OS_SYMBIAN
       
    43 class CSmfClientSymbian;
       
    44 #else
       
    45 class SmfClientQt;
       
    46 #endif
       
    47 class SmfGalleryPrivate : public smfObserver
       
    48 {
       
    49   Q_OBJECT
       
    50 
       
    51 public:
       
    52 
       
    53   SmfGalleryPrivate(SmfGallery* gallery=0);
       
    54   ~SmfGalleryPrivate();
       
    55   
       
    56   /**
       
    57    * Get the picture listing asynchronously.
       
    58    * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived.
       
    59    * When the list is big user can specify the page number and per page item data.
       
    60    * If not supplied by the user default values are used.
       
    61    * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
       
    62    * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
       
    63    */
       
    64   void pictures(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE);
       
    65 
       
    66   /**
       
    67    * Returns a user title/caption for the picture
       
    68    */
       
    69   QString description(SmfPicture& picture); // A user title or caption, maybe?
       
    70 
       
    71   /**
       
    72 	 * Upload an image.Implemented as slot to connect to UI controls more easily
       
    73 	 * uploadFinished() signal is emitted with the success value of the upload
       
    74 	 * @param image the image to be uploaded
       
    75 	 */
       
    76    void upload(SmfPicture* image) ;
       
    77 
       
    78 	/**
       
    79 	 * Upload an list image.Implemented as slot to connect to UI controls more easily
       
    80 	 * uploadFinished() signal is emitted with the success value of the upload
       
    81 	 * @param images the list image to be uploaded
       
    82 	 */
       
    83    void upload(SmfPictureList* images) ;
       
    84 
       
    85   /**
       
    86    * Posts a comment for an image. uploadFinished() signal is emitted
       
    87    * with success of the post once comment is posted.
       
    88    * @param image Image to comment on
       
    89    * @param comment Comment to post
       
    90    */
       
    91    void postComment(SmfPicture image, SmfComment comment) ;
       
    92    //from smfobserver
       
    93    void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
    94 private:
       
    95 	  SmfProvider* m_baseProvider;
       
    96 	  //serialized byte array of provider+other info to be sent to the server
       
    97 	  //The order:- SmfProvider then params in order of their appearance in fn
       
    98 	  QByteArray m_serializedDataToServer;
       
    99 	#ifdef Q_OS_SYMBIAN
       
   100 	  CSmfClientSymbian* m_SmfClientPrivate;
       
   101 	  friend class CSmfClientSymbian;
       
   102 	#else
       
   103 	  SmfClientQt* m_SmfClientPrivate;
       
   104 	  friend class SmfClientQt;
       
   105 	#endif
       
   106 	  bool m_connected;
       
   107 	  SmfGallery* m_gallery;
       
   108 	  SmfPictureList* m_picList;
       
   109 	 void writeLog(QString log) const{};
       
   110 
       
   111 };
       
   112 
       
   113 
       
   114 
       
   115 
       
   116 
       
   117 
       
   118