example/clientapi/smf/inc/smfplugins/smfcontacts/smfpostproviderplugin.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     1 /**
       
     2  * @file	smfpostproviderplugin.h
       
     3  * @author  Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution
       
     4  * @version 1.0
       
     5  *
       
     6  * @section LICENSE
       
     7  *
       
     8  * Copyright (c) 2010 Sasken Communication Technologies Ltd. 
       
     9  * All rights reserved.
       
    10  * This component and the accompanying materials are made available 
       
    11  * under the terms of the "Eclipse Public License v1.0"
       
    12  * which accompanies  this distribution, and is available 
       
    13  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
    14  * 
       
    15  * @section DESCRIPTION
       
    16  *
       
    17  * Interface specification for getting/posting updates to a social site
       
    18  */
       
    19 
       
    20 #ifndef SMFPOSTPROVIDERPLUGIN_H_
       
    21 #define SMFPOSTPROVIDERPLUGIN_H_
       
    22 
       
    23 #include <smfpluginbase.h>
       
    24 #include <smfcontact.h>
       
    25 #include <smfpost.h>
       
    26 #include <smfplace.h>
       
    27 
       
    28 /**
       
    29  * SmfPresenceInfo.
       
    30  * Indicates the presence information of user like Online, Offline, Busy, 
       
    31  * Do no disturb, Appear Offline etc.
       
    32  */
       
    33 enum SmfPresenceInfo
       
    34 	{
       
    35 	  ENotSupported,
       
    36 	  EOnline,
       
    37 	  EOffline,
       
    38 	  EBusy,
       
    39 	  EDoNotDisturb,
       
    40 	  EAppearOffline,
       
    41 	  EOther
       
    42 	};
       
    43 
       
    44 /**
       
    45  * @ingroup smf_plugin_group
       
    46  * Interface to get/update the posts to a service provider. This class
       
    47  * provides basic functionality to allow applications to obtain list of
       
    48  * posts, updates posts or change the presence information to a social 
       
    49  * networking service.
       
    50  *
       
    51  * All of the functionality described here should be implemented by a service
       
    52  * specific plug-in.
       
    53  */
       
    54 class SmfPostProviderPlugin : public SmfPluginBase
       
    55 	{
       
    56 	Q_OBJECT
       
    57 public:
       
    58 	/**
       
    59 	 * Constructor with default argument
       
    60 	 * @param aParent The parent object
       
    61 	 */
       
    62 	SmfPostProviderPlugin( QObject* aParent = 0 );
       
    63 	
       
    64 	/**
       
    65 	 * Destructor
       
    66 	 */
       
    67 	~SmfPostProviderPlugin( );
       
    68 	
       
    69 	/**
       
    70 	 * Method that returns maximum no of chars (unicode) that service 
       
    71 	 * provider can post without truncation. Negative value means 
       
    72 	 * no limit
       
    73 	 * @return Max characters that can be posted without truncation
       
    74 	 */
       
    75 	virtual qint32 maxCharsInPost( ) const = 0;
       
    76 	/**
       
    77 	 * Method that returns maximum no of items that can be returned 
       
    78 	 * in a single query to getPosts. Negative value means feature 
       
    79 	 * not supported.
       
    80 	 * @return Max items that can be returned in a single query
       
    81 	 */
       
    82 	virtual qint32 maxItems( ) const = 0;
       
    83 
       
    84 	/**
       
    85 	 * <Method that returns all the formatting of posts that this 
       
    86 	 * service provider supports. May return 0 items to mean 
       
    87 	 * only QString is supported.
       
    88 	 * @return Supported formats of posts
       
    89 	 */
       
    90 	virtual QVector<QTextFormat> supportedFormats ( ) const = 0;
       
    91 	
       
    92 	/**
       
    93 	 * Method that returns whether this SP supports Appearence
       
    94 	 * @return Returns true if Appearance is supported, else false. 
       
    95 	 * @see SmfAppearenceInfo
       
    96 	 */
       
    97 	virtual bool supportsAppearence ( ) const = 0;
       
    98 	
       
    99 	/**
       
   100 	 * Method to get the latest posts
       
   101 	 * @param aRequest [out] The request data to be sent to network
       
   102 	 * @param aUser The user's contact in this SP, omit for self contact
       
   103 	 * @param aPageNum The page to be extracted
       
   104 	 * @param aItemsPerPage Number of items per page
       
   105 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   106 	 */
       
   107 	virtual SmfPluginError retrieve( SmfPluginRequestData *aRequest,
       
   108 			const SmfContact* aUser = 0,
       
   109 			const int aPageNum = SMF_FIRST_PAGE, 
       
   110 			const int aItemsPerPage = SMF_ITEMS_PER_PAGE ) = 0;
       
   111 
       
   112 	
       
   113 	/**
       
   114 	 * Method to update a post to own area.
       
   115 	 * @param aRequest [out] The request data to be sent to network
       
   116 	 * @param aPostData The post data to be posted
       
   117 	 * @param aLocation The location
       
   118 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   119 	 */
       
   120 	virtual SmfPluginError post( SmfPluginRequestData *aRequest,
       
   121 			const SmfPost aPostData, 
       
   122 			const SmfPlace aLocation ) = 0;
       
   123 	
       
   124 	/**
       
   125 	 * Method to update the last post to own area with new data
       
   126 	 * @param aRequest [out] The request data to be sent to network
       
   127 	 * @param aPostData The edited/new data to be posted
       
   128 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   129 	 */
       
   130 	virtual SmfPluginError updatePost( SmfPluginRequestData *aRequest,
       
   131 			const SmfPost aPostData ) = 0;
       
   132 	
       
   133 	/**
       
   134 	 * Method to update a post to a particular contact
       
   135 	 * @param aRequest [out] The request data to be sent to network
       
   136 	 * @param aPostData The post data to be posted
       
   137 	 * @param aContact The contact where the data has to be posted
       
   138 	 * @param aLocation The location
       
   139 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   140 	 */
       
   141 	virtual SmfPluginError postDirected( SmfPluginRequestData *aRequest,
       
   142 			const SmfPost aPostData, 
       
   143 			const SmfContact aContact, 
       
   144 			const SmfPlace aLocation = NULL ) = 0;
       
   145 	
       
   146 	
       
   147 	/**
       
   148 	 * Method to post a comment on a post.
       
   149 	 * @param aRequest [out] The request data to be sent to network
       
   150 	 * @param aTarget Post on which comment has to be posted
       
   151 	 * @param aComment comment to be posted
       
   152 	 * @param aLocation location data
       
   153 	 */
       
   154 	virtual SmfPluginError commentOnAPost(SmfPluginRequestData *aRequest,
       
   155 			const SmfPost& aTarget,
       
   156 			const SmfPost& aComment, 
       
   157 			const SmfPlace* aLocation = NULL);
       
   158 	
       
   159 	/**
       
   160 	 * Method to update the presence information of the user
       
   161 	 * @param aRequest [out] The request data to be sent to network
       
   162 	 * @param aAppearence The appearence information
       
   163 	 * @param aStatus The status string
       
   164 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   165 	 */
       
   166 	virtual SmfPluginError postAppearence( SmfPluginRequestData *aRequest,  
       
   167 			const SmfPresenceInfo aAppearence,
       
   168 			const QString aStatus ) = 0;
       
   169 	
       
   170 	/**
       
   171 	 * Share /a contact's post to user's friends and followers
       
   172 	 * (e.g. retweet in twitter, share on facebook)
       
   173 	 * @param aRequest [out] The request data to be sent to network
       
   174 	 * @param aPostData data to be posted
       
   175 	 * @param aContact contact to which the post belonged
       
   176 	 * @param aEdited whether user changed items within the post
       
   177 	 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
       
   178 	 */
       
   179 	virtual SmfPluginError sharePost( SmfPluginRequestData *aRequest, 
       
   180 			const SmfPost& aPostData, 
       
   181 			const SmfContact& aContact, 
       
   182 			const bool aEdited);
       
   183 
       
   184 	
       
   185 	};
       
   186 
       
   187 Q_DECLARE_INTERFACE( SmfPostProviderPlugin, "org.symbian.smf.plugin.contact.posts/v1.0" );
       
   188 
       
   189 #endif /* SMFPOSTPROVIDERPLUGIN_H_ */