example/clientapi/smf/inc/smfplugins/base/smfpluginbase.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     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 SmfPluginBase class is the base class for all plugins.
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFPLUGINBASE_H_
       
    21 #define SMFPLUGINBASE_H_
       
    22 
       
    23 #include <smfproviderbase.h>
       
    24 #include <QNetworkReply>
       
    25 #include <smfglobal.h>
       
    26 
       
    27 /**
       
    28  * @ingroup smf_plugin_group
       
    29  * The SmfPluginBase class is the base class for all plugins 
       
    30  */
       
    31 class SmfPluginBase : public QObject
       
    32 	{
       
    33 	Q_OBJECT
       
    34 
       
    35 public:
       
    36 	/**
       
    37 	 * Constructor with default argument
       
    38 	 * @param aParent The parent object
       
    39 	 */
       
    40 	SmfPluginBase( QObject* aParent = 0 );
       
    41 	
       
    42 	/**
       
    43 	 * Destructor
       
    44 	 */
       
    45 	~SmfPluginBase( );
       
    46 
       
    47 	/**
       
    48 	 * Method to get the provider information
       
    49 	 * @return Instance of SmfProviderBase
       
    50 	 */
       
    51 	virtual SmfProviderBase* getProviderInfo( ) = 0;
       
    52 	
       
    53 	/**
       
    54 	 * Method to get the result for a network request.
       
    55 	 * @param aTransportResult The result of transport operation
       
    56 	 * @param aReply The QNetworkReply instance for the request
       
    57 	 * @param aResult [out] An output parameter to the plugin manager.If the 
       
    58 	 * return value is SmfSendRequestAgain, QVariant will be of type 
       
    59 	 * SmfPluginRequestData.
       
    60 	 * 
       
    61 	 * For SmfContactFetcherPlugin: If last operation was friends() or followers() 
       
    62 	 * or search() or searchInGroup() or searchNear(), aResult will be of type 
       
    63 	 * QList<SmfContact>. If last operation was groups(), aResult will be of 
       
    64 	 * type QList<SmfGroup>
       
    65 	 * For SmfPostProviderPlugin: If last operation was retrieve(), aResult will be 
       
    66 	 * of type QList<SmfPost>. If last operation was post() or updatePost() or 
       
    67 	 * postDirected() or commentOnAPost() or postAppearence(), aResult will be 
       
    68 	 * of type bool
       
    69 	 * For SmfLyricsServicePlugin: If last operation was lyrics(), aResult will 
       
    70 	 * be of type SmfLyrics. If last operation was subtitles(), aResult will 
       
    71 	 * be of type SmfSubtitle.
       
    72 	 * For SmfMusicEventsPlugin: If last operation was events(), aResult will 
       
    73 	 * be of type QList<SmfEvent>. If last operation was venues(), aResult 
       
    74 	 * will be of type QList<SmfPlace>. If last operation was postEvents(), 
       
    75 	 * aResult will be of type bool
       
    76 	 * For SmfMusicSearchPlugin: If last operation was recommendations() or 
       
    77 	 * tracks() or trackInfo(), aResult will be of type QList<SmfTrackInfo>. 
       
    78 	 * If last operation was stores(), aResult will be of type 
       
    79 	 * QList<SmfProvider>. If last operation was postCurrentPlaying(), 
       
    80 	 * aResult will be of type bool.
       
    81 	 * For SmfMusicServicePlugin: If last operation was userInfo(), aResult 
       
    82 	 * will be of type SmfMusicProfile. If last operation was searchUser(), 
       
    83 	 * aResult will be of type QList<SmfMusicProfile>.
       
    84 	 * For SmfPlaylistServicePlugin: If last operation was playlists() or 
       
    85 	 * playlistsOf(), aResult will be of type QList<SmfPlaylist>. If last 
       
    86 	 * operation was addToPlaylist() or postCurrentPlayingPlaylist(), 
       
    87 	 * aResult will be of type bool.
       
    88 	 * For SmfGalleryPlugin: If last operation was pictures(), aResult will 
       
    89 	 * be of type QList<SmfPicture>. If last operation was description(), 
       
    90 	 * aResult will be of type QString. If last operation was upload() or 
       
    91 	 * postComment(), aResult will be of type bool.
       
    92 	 * 
       
    93 	 * @param aRetType [out] SmfPluginRetType
       
    94 	 * @param aPageResult [out] The SmfResultPage structure variable
       
    95 	 */
       
    96 	virtual SmfPluginError responseAvailable( 
       
    97 			const SmfTransportResult aTransportResult, 
       
    98 			QNetworkReply *aReply, 
       
    99 			QVariant* aResult, 
       
   100 			SmfPluginRetType aRetType,
       
   101 			SmfResultPage &aPageResult ) = 0;
       
   102 	
       
   103 	};
       
   104 
       
   105 
       
   106 #endif /* SMFPLUGINBASE_H_ */