example/clientapi/smf/inc/smfplugins/smfpictures/smfgalleryplugin.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     1 /**
       
     2  * @file	smfgalleryplugin.h
       
     3  * @author  Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution
       
     4  * @version 1.0
       
     5  *
       
     6  * @section LICENSE
       
     7  *
       
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
       
     9  * All rights reserved.
       
    10  * This component and the accompanying materials are made available 
       
    11  * under the terms of the "Eclipse Public License v1.0"
       
    12  * which accompanies  this distribution, and is available 
       
    13  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
    14  * 
       
    15  * @section DESCRIPTION
       
    16  *
       
    17  * Interface specification for plugins that implement gallery related services
       
    18  */
       
    19 
       
    20 #ifndef SMFGALLERYPLUGIN_H_
       
    21 #define SMFGALLERYPLUGIN_H_
       
    22 
       
    23 #include <smfpluginbase.h>
       
    24 #include <smfpicture.h>
       
    25 #include <smfcomment.h>
       
    26 
       
    27 /**
       
    28  * @ingroup smf_plugin_group
       
    29  * Interface specification for plugins that implement gallery related services
       
    30  * like getting pictures, their description, uploading, posting comments 
       
    31  * on pictures etc
       
    32  *
       
    33  * All of the functionality described here should be implemented by a service
       
    34  * specific plug-in.
       
    35  *
       
    36  * A sample call flow between SmfPluginMgr and  SmfGalleryPlugin is shown here
       
    37  * 
       
    38  * @msc
       
    39    hscale = "2";  
       
    40   SmfServer,SmfTransportMgr,SmfPluginMgr,SmfGalleryPlugin;
       
    41   ...;
       
    42   SmfPluginMgr=>SmfTransportMgr [ label = "connect(SIGNAL(finished()), SLOT(replyFinished()))" ] ;
       
    43   ...;
       
    44   SmfServer=> SmfPluginMgr[ label = "loadAndCheckPlugin()" ] ;
       
    45   SmfPluginMgr=>SmfPluginMgr [ label = "SmfGalleryPlugin smfglpl= load()" ] ;
       
    46   SmfPluginMgr=>SmfGalleryPlugin [ label = "QNetworkRequest  req = smfglpl.pictures()" ] ;
       
    47   SmfPluginMgr=>SmfTransportMgr [ label = "nwmgr.get( req )" ] ;
       
    48   ...;
       
    49   SmfTransportMgr=>SmfPluginMgr [ label = "replyFinished( reply )" ] ;
       
    50   SmfPluginMgr=>SmfGalleryPlugin [ label = "status = responseAvailable( reply, &data )" ] ;
       
    51   SmfPluginMgr=>SmfServer [ label = "if(status ==complete) dataStream <<  data;" ] ;
       
    52   @endmsc
       
    53  * 
       
    54  */
       
    55 class SmfGalleryPlugin : public SmfPluginBase
       
    56 	{
       
    57 	Q_OBJECT
       
    58 public:
       
    59 	/**
       
    60 	 * Constructor with default argument
       
    61 	 * @param aParent The parent object
       
    62 	 */
       
    63 	SmfGalleryPlugin( QObject* aParent = 0 );
       
    64 	
       
    65 	/**
       
    66 	 * Destructor
       
    67 	 */
       
    68 	~SmfGalleryPlugin( );
       
    69 	
       
    70 	/**
       
    71 	 * Method to get a list of pictures
       
    72 	 * @param aRequest [out] The request data to be sent to network
       
    73 	 * @param aPageNum The page to be extracted
       
    74 	 * @param aItemsPerPage Number of items per page
       
    75 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    76 	 */
       
    77 	virtual SmfPluginError pictures( SmfPluginRequestData *aRequest, 
       
    78 			const int aPageNum = SMF_FIRST_PAGE, 
       
    79 			const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
       
    80 	
       
    81 	/**
       
    82 	 * Method to get a description
       
    83 	 * @param aRequest [out] The request data to be sent to network
       
    84 	 * @param aImage The image abot which the description is required
       
    85 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    86 	 */
       
    87 	virtual SmfPluginError description( SmfPluginRequestData *aRequest,
       
    88 			const SmfPicture &aImage ) = 0;
       
    89 	
       
    90 	/**
       
    91 	 * Method to upload a picture
       
    92 	 * @param aRequest [out] The request data to be sent to network
       
    93 	 * @param aImage The image to be uploaded
       
    94 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
    95 	 */
       
    96 	virtual SmfPluginError upload( SmfPluginRequestData *aRequest,
       
    97 			const SmfPicture &aImage ) = 0;
       
    98 	
       
    99 	/**
       
   100 	 * Method to upload a list of pictures
       
   101 	 * @param aRequest [out] The request data to be sent to network
       
   102 	 * @param aImages The list of images to be uploaded
       
   103 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   104 	 */
       
   105 	virtual SmfPluginError upload( SmfPluginRequestData *aRequest,
       
   106 			const QList<SmfPicture> &aImages ) = 0;
       
   107 	
       
   108 	/**
       
   109 	 * Method to post comment on a picture is available
       
   110 	 * @param aRequest [out] The request data to be sent to network
       
   111 	 * @param aImage The image on which comment is to be posted
       
   112 	 * @param aComment The comment to be posted
       
   113 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   114 	 */
       
   115 	virtual SmfPluginError postComment( SmfPluginRequestData *aRequest,
       
   116 			const SmfPicture &aImage, 
       
   117 			const SmfComment &aComment ) = 0;
       
   118 		
       
   119 	};
       
   120 
       
   121 Q_DECLARE_INTERFACE( SmfGalleryPlugin, "org.symbian.smf.plugin.gallery/v1.0" );
       
   122 
       
   123 #endif /* SMFGALLERYPLUGIN_H_ */