example/fbactivityfetcherplugin/fbactivityfetcherplugin.h
author cgandhi
Thu, 16 Sep 2010 11:15:30 +0530
changeset 22 b2eb79881f9d
parent 17 106a4bfcb866
child 26 83d6a149c755
permissions -rw-r--r--
removing redundant armcc options
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
 * 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 activities from the logged in user's facebook 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 _FBACTIVITYFETCHERPLUGIN_H
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    21
#define _FBACTIVITYFETCHERPLUGIN_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 <smfactivityfetcherplugin.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    26
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    27
// Forward declarations
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    28
class FBActivityProviderBase;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    29
class QVariant;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    30
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
 * The Plugin class that fetches activities from the logged in user's 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    33
 * facebook account
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    34
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    35
class FBActivityFetcherPlugin : public QObject, public SmfActivityFetcherPlugin
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
	Q_OBJECT
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    38
	Q_INTERFACES( SmfActivityFetcherPlugin SmfPluginBase )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    39
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    40
public:
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
	 * Destructor
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
	virtual ~FBActivityFetcherPlugin( );
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
public: // From SmfActivityFetcherPlugin interface
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    49
	 * Method to get the list of self activities, e.g. shown in own wall
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    50
	 * @param aRequest [out] The request data that plugin generates (to be sent to network)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    51
	 * @param aPageNum[in] The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    52
	 * @param aItemsPerPage[in] Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    53
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    54
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    55
	SmfPluginError selfActivities( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    56
			const int aPageNum = SMF_FIRST_PAGE, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    57
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    60
	 * Method to get the list of activities for other, e.g. shown in a friends wall
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    61
	 * @param aRequest [out] The request data plugin generated (to be sent to network)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    62
	 * @param aContact [in] The contact containing the URI, name or id of the user 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    63
	 * @param aPageNum[in] The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    64
	 * @param aItemsPerPage[in] Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    65
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    66
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    67
	SmfPluginError friendsActivities( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    68
			const SmfContact &aContact,			
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    69
			const int aPageNum = SMF_FIRST_PAGE, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    70
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    71
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
	 * Method to get list of self activities filtered by activity type, e.g. only photo updates in own wall
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    74
	 * @param aRequest [out] The request data plugin generated (to be sent to network)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    75
	 * @param aFilters [in] The list of activity types to be included in result
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    76
	 * @param aPageNum[in] The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    77
	 * @param aItemsPerPage[in] Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    78
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    79
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    80
	SmfPluginError filtered( SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    81
			QList<SmfActivityObjectType> &aFilters,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    82
			const int aPageNum = SMF_FIRST_PAGE, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    83
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    84
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    85
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    86
	 * Customised method for SmfActivityFetcherPlugin interface
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    87
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    88
	 * @param aOperation The operation type (should be known between 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    89
	 * the client interface and the plugin)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    90
	 * @param aData The data required to form the request (The type 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    91
	 * of data should be known between client and the plugin)
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 customRequest( SmfPluginRequestData &aRequest, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    95
			const int &aOperation, QByteArray *aData );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    96
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    97
public: // From SmfPluginBase interface
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
	 * 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
   100
	 * 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
   101
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   102
	void initialize( );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   103
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   104
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   105
	 * Method to get the provider information
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   106
	 * @return Instance of SmfProviderBase
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   107
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   108
	SmfProviderBase* getProviderInfo( );
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 get the result for a network request.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   112
	 * @param aOperation The type of operation to be requested
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   113
	 * @param aTransportResult The result of transport operation
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   114
	 * @param aResponse The QByteArray instance containing the network response.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   115
	 * The plugins should delete this instance once they have read the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   116
	 * data from it.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   117
	 * @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
   118
	 * return value is SmfSendRequestAgain, QVariant will be of type 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   119
	 * SmfPluginRequestData.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   120
	 * For SmfActivityFetcherPlugin: If last operation was selfActivities() or 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   121
	 * friendsActivities() or filtered(), aResult will be of type 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   122
	 * QList<SmfActivityEntry>. 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   123
	 * @param aRetType [out] SmfPluginRetType
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   124
	 * @param aPageResult [out] The SmfResultPage structure variable
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   125
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   126
	SmfPluginError responseAvailable( 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   127
			const SmfRequestTypeID aOperation,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   128
			const SmfTransportResult &aTransportResult, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   129
			QByteArray *aResponse, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   130
			QVariant* aResult, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   131
			SmfPluginRetType &aRetType,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   132
			SmfResultPage &aPageResult );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   133
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   134
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   135
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   136
	 * 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
   137
	 * @param aBaseString The base string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   138
	 * @return The md5 hash of the base string
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
	QString generateSignature(const QString aBaseString);
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 user's facebook ID
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   144
	 * @param aRequest [out] The request data to be sent to network
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   145
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   146
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   147
	SmfPluginError getFacebookUserId( SmfPluginRequestData &aRequest );
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   150
	 * Method to get the list of self activities, e.g. shown in own wall
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   151
	 * @param aRequest [out] The request data that plugin generates (to be sent to network)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   152
	 * @param aPageNum[in] The page to be extracted
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   153
	 * @param aItemsPerPage[in] Number of items per page
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   154
	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   155
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   156
	SmfPluginError getSelfActivities(  SmfPluginRequestData &aRequest,
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   157
			const int aPageNum = SMF_FIRST_PAGE, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   158
			const int aItemsPerPage = SMF_ITEMS_PER_PAGE );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   159
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   160
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   161
	 * Method to convert the Activity verb string obtained from facebook to the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   162
	 * enum SmfActivityVerb
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   163
	 * @param verbStr The activity verb as a string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   164
	 * @return The corresponding enum SmfActivityVerb
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
	SmfActivityVerb convertActivityverb( const QString& verbStr );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   167
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   168
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   169
	 * Method to convert the Activity object type string obtained from 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   170
	 * facebook to the enum SmfActivityObjectType
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   171
	 * @param objType The activity object type as a string
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   172
	 * @return The corresponding enum SmfActivityObjectType
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
	SmfActivityObjectType convertActivityObjectType( const QString& verbStr );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   175
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   176
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   177
	 * Method to interpret the key sets obtained from credential manager 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   178
	 * @param aApiKey [out] The api key
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   179
	 * @param aApiSecret [out] The api secret
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   180
	 * @param aSessionKey [out] The session key
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   181
	 * @param aSessionSecret [out] The session secret
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   182
	 * @param aAppId [out] The application ID
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   183
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   184
	void fetchKeys(	QString &aApiKey, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   185
			QString &aApiSecret, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   186
			QString &aSessionKey, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   187
			QString &aSessionSecret, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   188
			QString &aAppId);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   189
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   190
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   191
	FBActivityProviderBase *m_provider;
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
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
/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   197
 * The Plugin class that implements SmfProviderBase for this facebook plugin
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   198
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   199
class FBActivityProviderBase : public QObject, public SmfProviderBase
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
	Q_OBJECT
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   202
	Q_INTERFACES( SmfProviderBase )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   203
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   204
public:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   205
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   206
	 * Destructor
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
	virtual ~FBActivityProviderBase( );
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
	 * Method to get the Localisable name of the service.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   212
	 * @return The Localisable name of the service.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   213
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   214
	QString serviceName( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   215
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   216
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   217
	 * Method to get the Logo of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   218
	 * @return The Logo of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   219
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   220
	QImage serviceIcon( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   223
	 * Method to get the Readable service description
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   224
	 * @return The Readable service description
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   225
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   226
	QString description( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   229
	 * Method to get the Website of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   230
	 * @return The Website of the service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   231
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   232
	QUrl serviceUrl( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   235
	 * Method to get the URL of the Application providing this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   236
	 * @return The URL of the Application providing this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   237
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   238
	QUrl applicationUrl( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   241
	 * Method to get the Icon of the application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   242
	 * @return The Icon of the application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   243
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   244
	QImage applicationIcon( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   247
	* Method to get the list of interfaces that this provider support
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   248
	* @return List of supported Interafces
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   249
	*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   250
	QList<QString> supportedInterfaces( ) const;
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
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   253
	* 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
   254
	* @return a QStringList of languages supported by this service 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   255
	* provider in 2 letter ISO 639-1 format.
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
	QStringList supportedLanguages( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   258
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   259
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   260
	 * Method to get the Plugin specific ID
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   261
	 * @return The Plugin specific ID
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
	QString pluginId( ) const;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   264
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   265
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   266
	 * Method to get the ID of the authentication application 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   267
	 * for this service
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   268
	 * @param aProgram The authentication application name
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   269
	 * @param aArguments List of arguments required for authentication app
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   270
	 * @param aMode Strting mode for authentication application
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   271
	 * @return The ID of the authentication application 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   272
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   273
	QString authenticationApp( QString &aProgram, QStringList & aArguments, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   274
			QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) 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 unique registration ID provided by the 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   278
	 * Smf for authorised plugins
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   279
	 * @return The unique registration ID/token provided by the Smf for 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   280
	 * authorised plugins
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   281
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   282
	QString smfRegistrationId( ) const;
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
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   285
	/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   286
	 * Method that initializes this class. This method should be called 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   287
	 * from the initialize() method of the FBActivityFetcherPlugin class
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   288
	 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   289
	void initialize();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   290
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   291
private:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   292
	friend class FBActivityFetcherPlugin;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   293
	QString m_serviceName;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   294
	QImage m_serviceIcon;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   295
	QString m_description;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   296
	QUrl m_serviceUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   297
	QUrl m_applicationUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   298
	QImage m_applicationIcon;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   299
	QString m_pluginId;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   300
	QString m_authAppId;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   301
	QString m_smfRegToken;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   302
	QList<QString> m_supportedInterfaces;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   303
	QStringList m_supportedLangs;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   304
	QDateTime m_validity;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   305
	};
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   306
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   307
#endif /*_FBACTIVITYFETCHERPLUGIN_H*/