smf/smfservermodule/smfclient/smfactivityfetcher.h
changeset 18 013a02bf2bb0
child 25 a180113055cb
equal deleted inserted replaced
17:106a4bfcb866 18:013a02bf2bb0
       
     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  * Represents activity in terms similar to standard activity stream http://activitystrea.ms/
       
    17  * 
       
    18  */
       
    19 
       
    20 #ifndef SMFACTIVITYFETCHER_H_
       
    21 #define SMFACTIVITYFETCHER_H_
       
    22 
       
    23 #include <QList>
       
    24 #include <smfglobal.h>
       
    25 #include <smfactions.h>
       
    26 
       
    27 // Forward declaration
       
    28 class SmfActivityFetcherPrivate;
       
    29 class SmfProvider;
       
    30 class SmfContact;
       
    31 
       
    32 
       
    33 /**
       
    34  * @ingroup smf_client_group
       
    35  * Basic activity service ("org.symbian.smf.client.activity.fetcher")
       
    36  */
       
    37 class SMFCLIENT_EXPORT SmfActivityFetcher : public QObject
       
    38 	{
       
    39 	Q_OBJECT
       
    40 
       
    41 public:
       
    42 	/**
       
    43 	 * Constructs SmfActivity.
       
    44 	 * @param baseProvider The base provider info
       
    45 	 */
       
    46 	SmfActivityFetcher(SmfProvider* baseprovider = 0);
       
    47 
       
    48 	/**
       
    49 	 * Destructor
       
    50 	 */
       
    51 	~SmfActivityFetcher();
       
    52 
       
    53 public slots:
       
    54 	/**
       
    55 	 * Emits signal resultsAvailable() when list of activities for the user is available 
       
    56 	 */
       
    57 	void selfActivities(int pageNum = SMF_FIRST_PAGE,int perPage = SMF_ITEMS_PER_PAGE);
       
    58 
       
    59 	/**
       
    60 	 * Emits signal resultsAvailable() when list of activities for other contact  is available 
       
    61 	 */
       
    62 	void friendsActivities(const SmfContact& aFriend, int pageNum = SMF_FIRST_PAGE,
       
    63 			int perPage = SMF_ITEMS_PER_PAGE);
       
    64 	
       
    65 	/**
       
    66 	 * returns only those activities (self) which are from @arg filters
       
    67 	 */
       
    68 	void filtered(QList<SmfActivityObjectType> filters, int pageNum = SMF_FIRST_PAGE,
       
    69 			int perPage = SMF_ITEMS_PER_PAGE);
       
    70 	
       
    71 	/**
       
    72 	 * Request for a custom operation. The signal customDataAvailable() is emitted 
       
    73 	 * when the result is available.
       
    74 	 * @param operationId OperationId
       
    75 	 * @param customData Custom data to be sent
       
    76 	 * Note:-Interpretation of operationId and customData is upto the concerned
       
    77 	 * plugin and client application. service provider should provide some
       
    78 	 * serializing-deserializing utilities for these custom data
       
    79 	 */
       
    80 	void customRequest ( const int& operationId, QByteArray* customData );
       
    81 
       
    82 signals:
       
    83 	/**
       
    84 	 * Signals availability of the result of the previous query
       
    85 	 */
       
    86 	void resultsAvailable(SmfActivityEntryList* entries, SmfError error, SmfResultPage resultPage);
       
    87 	
       
    88 	/**
       
    89 	 * Signals availability of the result of the customRequest
       
    90 	 */
       
    91 	void customDataAvailable( const int& operationId, QByteArray* customData );
       
    92 
       
    93 private:
       
    94 	/**
       
    95 	 * Gets the base provider info
       
    96 	 */
       
    97 	SmfProvider* getProvider() const;
       
    98 	  
       
    99 // Friend Class
       
   100 	friend class SmfActivityFetcherPrivate;
       
   101 	  
       
   102 private:
       
   103 	SmfActivityFetcherPrivate* m_private;
       
   104 	SmfProvider* m_baseProvider;
       
   105 
       
   106 	};
       
   107 
       
   108 SMF_SERVICE_NAME(SmfActivityFetcher, "org.symbian.smf.client.activity.fetcher\0.2")
       
   109 
       
   110 #endif /* SMFACTIVITYFETCHER_H_ */