example/flickrgalleryplugin/flickrgalleryplugin.h
author cgandhi
Thu, 05 Aug 2010 16:46:37 +0530
changeset 17 106a4bfcb866
child 26 83d6a149c755
permissions -rw-r--r--
pushing the flickr auth app and gallery plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     1
/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     3
 * All rights reserved.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     8
 *
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     9
 * Initial Contributors:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    11
 *
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    12
 * Contributors:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    13
 * Sangeetha Prasad, Nalina Hariharan
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    14
 * 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    15
 * Description:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    16
 * The Plugin that fetches gallery related items from the logged in user's flickr account
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    17
 *
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    18
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    19
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    20
#ifndef FLICKRGALLERYPLUGIN_H_
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    21
#define FLICKRGALLERYPLUGIN_H_
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    22
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    23
// Include files
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    24
#include <QDateTime>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    25
#include <smfgalleryplugin.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    26
#include <smfcontact.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    27
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    28
// Forward declarations
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    29
class FlickrProviderBase;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    30
class QVariant;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    31
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    32
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    33
/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    34
 * The Plugin that fetches gallery related items from the logged 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    35
 * in user's flickr account
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    36
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    37
class FlickrGalleryPlugin : public QObject, public SmfGalleryPlugin
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    38
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    39
	Q_OBJECT
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    40
	Q_INTERFACES( SmfGalleryPlugin SmfPluginBase )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    41
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    42
public:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    43
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    44
	 * Destructor
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    45
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    46
	virtual ~FlickrGalleryPlugin();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    47
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    48
public: // From FlickrGalleryPlugin
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    49
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    50
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    51
	 * Method to get a list of albums
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    52
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    53
	 * @param aNames The subject or any keywords to be used to filter albums with that name
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    54
	 * @param aUser The user whose albums are requested
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    55
	 * @param aPageNum The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    56
	 * @param aItemsPerPage Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    57
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    58
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    59
	SmfPluginError albums( SmfPluginRequestData &aRequest, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    60
			const QStringList &aNames, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    61
			const SmfContact *aUser, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    62
			const int aPageNum = SMF_FIRST_PAGE,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    63
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    64
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    65
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    66
	 * Method to get a list of pictures
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    67
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    68
	 * @param aAlbums The album(s) whose pictures are being requested
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    69
	 * @param aPageNum The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    70
	 * @param aItemsPerPage Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    71
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    72
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    73
	SmfPluginError pictures( SmfPluginRequestData &aRequest, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    74
			const SmfPictureAlbumList &aAlbums, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    75
			const int aPageNum = SMF_FIRST_PAGE, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    76
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    77
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    78
	 /**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    79
	 * Method to get a description
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    80
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    81
	 * @param aImage The image abot which the description is required
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    82
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    83
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    84
	SmfPluginError description( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    85
			const SmfPicture &aImage );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    86
		 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    87
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    88
	 * Method to upload a picture
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    89
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    90
	 * @param aImage The image to be uploaded
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    91
	 * @param aAlbum the optional destination album name
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    92
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    93
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    94
	SmfPluginError upload( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    95
			const SmfPicture &aImage,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    96
			const SmfPictureAlbum* aAlbum = NULL );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    97
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    98
			
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    99
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   100
	 * Method to upload a list of pictures
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   101
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   102
	 * @param aImages The list of images to be uploaded
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   103
	 * @param aAlbum the optional destination album name
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   104
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   105
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   106
	SmfPluginError upload( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   107
			const QList<SmfPicture> &aImages, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   108
			const SmfPictureAlbum* aAlbum = NULL );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   109
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   110
  /**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   111
	* Method to post comment on a picture is available
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   112
	* @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   113
	* @param aImage The image on which comment is to be posted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   114
	* @param aComment The comment to be posted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   115
	* @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   116
	*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   117
	SmfPluginError postComment( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   118
			 const SmfPicture &aImage, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   119
			 const SmfComment &aComment );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   120
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   121
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   122
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   123
	 * Customised method for SMFGalleryPlugin interface
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   124
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   125
	 * @param aOperation The operation type (should be known between 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   126
	 * the client interface and the plugin)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   127
	 * @param aData The data required to form the request (The type 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   128
	 * of data should be known between client and the plugin)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   129
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   130
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   131
	SmfPluginError customRequest( SmfPluginRequestData &aRequest, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   132
			const int &aOperation, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   133
			QByteArray *aData );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   134
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   135
public: // From SmfPluginBase
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   136
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   137
	 * The first method to be called in the plugin that implements this interface.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   138
	 * If this method is not called, plugin may not behave as expected.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   139
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   140
	void initialize( );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   141
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   142
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   143
	 * Method to get the provider information
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   144
	 * @return Instance of SmfProviderBase
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   145
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   146
	SmfProviderBase* getProviderInfo( );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   147
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   148
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   149
	 * Method to get the result for a network request.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   150
	 * @param aOperation The type of operation to be requested
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   151
	 * @param aTransportResult The result of transport operation
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   152
	 * @param aResponse The QByteArray instance containing the network response.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   153
	 * The plugins should delete this instance once they have read the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   154
	 * data from it.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   155
	 * @param aResult [out] An output parameter to the plugin manager.If the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   156
	 * return value is SmfSendRequestAgain, QVariant will be of type 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   157
	 * SmfPluginRequestData.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   158
	 * For SmfGalleryPlugin: If last operation was albums, aResult will be of 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   159
	 * type QList<SmfPictureAlbum>. If the last operation was pictures(), aResult 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   160
	 * will be of type QList<SmfPicture>. If last operation was description(), 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   161
	 * aResult will be of type QString. If last operation was upload() or 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   162
	 * postComment(), aResult will be of type bool.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   163
	 * @param aRetType [out] SmfPluginRetType
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   164
	 * @param aPageResult [out] The SmfResultPage structure variable
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   165
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   166
	SmfPluginError responseAvailable( 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   167
			const SmfRequestTypeID aOperation,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   168
			const SmfTransportResult &aTransportResult, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   169
			QByteArray *aResponse, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   170
			QVariant* aResult, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   171
			SmfPluginRetType &aRetType,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   172
			SmfResultPage &aPageResult );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   173
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   174
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   175
	 * Method to construct individual fields for photo upload
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   176
	 * @param aName The name argument
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   177
	 * @param aContent The content of this field
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   178
	 * @param aBoundary The boundary string (need to be unique in the payload data)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   179
	 * @param aFilename The filename if for photo field 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   180
	 * @return The field data constructed by this method
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   181
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   182
	QByteArray constructField( const QString &aName, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   183
			const QString &aContent, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   184
			const QByteArray &aBoundary, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   185
			const QString &aFilename = QString() );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   186
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   187
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   188
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   189
	 * Method called by plugins to generate a signature string from a base string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   190
	 * @param aBaseString The base string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   191
	 * @return The md5 hash of the base string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   192
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   193
	QString generateSignature( const QString aBaseString );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   194
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   195
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   196
	 * Method to interpret the key sets obtained from credential manager 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   197
	 * @param aApiKey [out] The api key
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   198
	 * @param aApiSecret [out] The api secret
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   199
	 * @param aAuthToken [out] The auth token provided by Flickr
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   200
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   201
	void fetchKeys(	QString &aApiKey, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   202
			QString &aApiSecret, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   203
			QString &aAuthToken );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   204
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   205
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   206
	FlickrProviderBase *m_provider;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   207
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   208
	};
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   209
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   210
/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   211
 * The Plugin class that implements SmfProviderBase for this flickr plugin
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   212
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   213
class FlickrProviderBase : public QObject, public SmfProviderBase
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   214
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   215
	Q_OBJECT
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   216
	Q_INTERFACES( SmfProviderBase )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   217
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   218
public:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   219
	virtual ~FlickrProviderBase( );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   220
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   221
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   222
	 * Method to get the Localisable name of the service.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   223
	 * @return The Localisable name of the service.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   224
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   225
	QString serviceName( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   226
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   227
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   228
	 * Method to get the Logo of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   229
	 * @return The Logo of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   230
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   231
	QImage serviceIcon( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   232
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   233
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   234
	 * Method to get the Readable service description
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   235
	 * @return The Readable service description
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   236
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   237
	QString description( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   238
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   239
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   240
	 * Method to get the Website of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   241
	 * @return The Website of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   242
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   243
	QUrl serviceUrl( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   244
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   245
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   246
	 * Method to get the URL of the Application providing this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   247
	 * @return The URL of the Application providing this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   248
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   249
	QUrl applicationUrl( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   250
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   251
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   252
	 * Method to get the Icon of the application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   253
	 * @return The Icon of the application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   254
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   255
	QImage applicationIcon( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   256
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   257
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   258
	* Method to get the list of interfaces that this provider support
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   259
	* @return List of supported Interafces
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   260
	*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   261
	QList<QString> supportedInterfaces( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   262
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   263
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   264
	* Method to get the list of languages supported by this service provider
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   265
	* @return a QStringList of languages supported by this service 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   266
	* provider in 2 letter ISO 639-1 format.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   267
	*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   268
	QStringList supportedLanguages( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   269
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   270
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   271
	 * Method to get the Plugin specific ID
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   272
	 * @return The Plugin specific ID
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   273
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   274
	QString pluginId( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   275
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   276
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   277
	 * Method to get the ID of the authentication application 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   278
	 * for this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   279
	 * @param aProgram The authentication application name
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   280
	 * @param aArguments List of arguments required for authentication app
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   281
	 * @param aMode Strting mode for authentication application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   282
	 * @return The ID of the authentication application 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   283
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   284
	QString authenticationApp( QString &aProgram, QStringList & aArguments, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   285
			QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   286
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   287
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   288
	 * Method to get the unique registration ID provided by the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   289
	 * Smf for authorised plugins
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   290
	 * @return The unique registration ID/token provided by the Smf for 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   291
	 * authorised plugins
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   292
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   293
	QString smfRegistrationId( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   294
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   295
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   296
	friend class FlickrGalleryPlugin;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   297
	void initialize();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   298
	QString m_serviceName;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   299
	QImage m_serviceIcon;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   300
	QString m_description;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   301
	QUrl m_serviceUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   302
	QUrl m_applicationUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   303
	QImage m_applicationIcon;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   304
	QString m_pluginId;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   305
	QString m_authAppId;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   306
	QString m_smfRegToken;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   307
	QList<QString> m_supportedInterfaces;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   308
	QStringList m_supportedLangs;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   309
	QDateTime m_validity;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   310
	};
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   311
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   312
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   313
#endif /* FLICKRGALLERYPLUGIN_H_ */