uiservicetab/vimpstengine/inc/mvimpstenginepresencesubservice.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  M-Class that capsulates presence sub service API's
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MVIMPSTENGINEPRESENCESUBSERVICE_H
       
    20 #define MVIMPSTENGINEPRESENCESUBSERVICE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "tvimpstenums.h"
       
    25 #include "mvimpstenginesubservice.h"
       
    26 
       
    27 
       
    28 //FORWARD DECLARATION
       
    29 class MVIMPSTEnginePresenceSubServiceEventObserver;
       
    30 class MVIMPSTEngineBlockedListFetchEventObserver;
       
    31 //CLASS DECLARATION
       
    32 /**
       
    33  *  
       
    34  *  This class list the M-Class for subservices
       
    35  *
       
    36  *  @lib vimpstengine.lib
       
    37  *  @since S60 5.0
       
    38  */
       
    39 //Class declaration
       
    40 class MVIMPSTEnginePresenceSubService: public MVIMPSTEngineSubService
       
    41 	{
       
    42 	
       
    43 	public:
       
    44 	
       
    45 		/**
       
    46          * Casts MVIMPSTEnginePresenceSubService to this interface.
       
    47          *
       
    48          * @precond aSubService.Type() == TVIMPSTEnums::EPresence
       
    49          *          Panic(EPanicTypeMismatch)
       
    50          *          is raised if the precondition does not hold.
       
    51          * @param aSubService    Base Class .
       
    52          * @return Casted inteface for the Presence SubService
       
    53          */
       
    54         IMPORT_C static MVIMPSTEnginePresenceSubService& Cast(
       
    55                 MVIMPSTEngineSubService& aSubService);
       
    56 
       
    57         
       
    58         /**
       
    59          * Casts constMVIMPSTEnginePresenceSubService to this interface.
       
    60          *
       
    61          * @precond aSubService.Type() == TVIMPSTEnums::EPresence
       
    62          *          Panic(EPanicTypeMismatch)
       
    63          *          is raised if the precondition does not hold.
       
    64          * @param aSubService    Base Class .
       
    65          * @return Casted inteface for the Presence SubService
       
    66          */        
       
    67         IMPORT_C static const MVIMPSTEnginePresenceSubService& Cast(
       
    68                 const MVIMPSTEngineSubService& aSubService);
       
    69 	
       
    70 	
       
    71 		/**
       
    72 		* RegisterPresenceEventObserver
       
    73 		* The observers that have implemented MVIMPSTEnginePresenceSubServiceEventObserver can use this API
       
    74 		* to register themselves to receive Presence SubService related events
       
    75 		* @param aObserver - Object that implements the observer class 
       
    76 		*   MVIMPSTEnginePresenceSubServiceEventObserver that needs to be added.
       
    77 		*/
       
    78 	  	virtual void RegisterPresenceEventObserverL(
       
    79 	  								MVIMPSTEnginePresenceSubServiceEventObserver* aObserver) = 0;
       
    80 	  	
       
    81 		/**
       
    82 		* UnRegisterChatObserver
       
    83 		* The observers that have implemented MVIMPSTEnginePresenceSubServiceEventObserver can use this API
       
    84 		* to unregister themselves from Presence SubService related events
       
    85 		* @param aObserver - Object that implements the observer class 
       
    86 		*    MVIMPSTEnginePresenceSubServiceEventObserver that needs to be removed.
       
    87 		*/
       
    88 	  	virtual void UnRegisterPresenceEventObserver(
       
    89 	  								MVIMPSTEnginePresenceSubServiceEventObserver* aObserver) = 0;
       
    90 	  	
       
    91 		/**
       
    92          * Subsribes presence of a single contact
       
    93          * Can be done for the contacts who are already subscribed(Required atleast in XMPP Case)
       
    94          * This function can be used on FriendRequests also wherein it performs 2 operation
       
    95          * 1. Accepts the invitation if Friend Request is Pending(GrantPresenceForPresentityL)
       
    96          * 2. Subscribes for the presence either to PresenceCache 
       
    97          * or XIMP (MPresentityPresenceEvent)
       
    98          * 
       
    99          *
       
   100          * @since S60 5.0
       
   101          * @param aUriOfTheContact, Presence URI to be subscribed         
       
   102          */
       
   103         virtual  void SubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ) = 0;  
       
   104         
       
   105            /**
       
   106          * Unsubsribes presence of a single contact
       
   107          * Used for those contact whose presence has been subscribed
       
   108          * Can be used for Friend Requests also
       
   109          * 1. Denies the invitation for the contact (WithdrawPresenceGrantFromPresentityL)
       
   110          * 2. Sends a unsubscribe to PresenceCache 
       
   111          * or XIMP (UnsubscribePresentityPresenceL)
       
   112          *
       
   113          * @since S60 5.0
       
   114          * @param aUriOfTheContact, Presence URI to be subscribed         
       
   115          */
       
   116         virtual void UnSubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ) = 0;                          
       
   117         /**
       
   118          * Fetches presence from presencecache.
       
   119          * This is called by the service tab whenever it comes up,
       
   120          * so that it has uptodate presence information of the contacts
       
   121          * that are present in the service tab.
       
   122          * 
       
   123          * @since S60 5.0   
       
   124          **/
       
   125         virtual TInt FetchPresenceFromCache() = 0;
       
   126         
       
   127        
       
   128        /**
       
   129         * Requests the XIMPFw to subscribe for presence
       
   130         * grant request list subscription.
       
   131         */  
       
   132         virtual void  SubscribeForAuthorizationL() = 0;
       
   133        
       
   134        /**
       
   135         * sends PresenceGrantForPresentity  response to server        
       
   136         * 
       
   137         * @since S60 5.0   
       
   138         * @param aContactId, id of the requesting party..
       
   139         * @param aResponse , Etrue if accpeted else rejected. 
       
   140         * @return TInt error if any 
       
   141         *      
       
   142         */ 
       
   143         virtual TInt SendPresenceGrantPresentityL( const TDesC& aContactId , TBool aResponse ) = 0;
       
   144 
       
   145         /**
       
   146          * IsChangeOwnStatusSupported by the protocol
       
   147          * 
       
   148          * @since S60 5.0   
       
   149          * @return TBool ETrue if supported else EFalse.
       
   150          */ 
       
   151         virtual TBool IsChangeOwnStatusSupported() = 0;
       
   152         
       
   153         /**
       
   154          * IsStatusMsgSupported by the protocol
       
   155          * 
       
   156          * @since S60 5.0   
       
   157          * @return TBool ETrue if supported else EFalse.
       
   158          */ 
       
   159         virtual TBool IsStatusMsgSupported() = 0;
       
   160         
       
   161          /**
       
   162          * IsAvatarSupported by the protocol
       
   163          * 
       
   164          * @since S60 5.0   
       
   165          * @return TBool ETrue if supported else EFalse.
       
   166          */ 
       
   167         virtual TBool IsAvatarSupported() = 0;
       
   168         
       
   169         /**
       
   170          * SetAvatarSupported by the protocol
       
   171          * 
       
   172          * @since S60 5.0   
       
   173          * @param aSupported, TBool ETrue if supported else EFalse.
       
   174          */ 
       
   175         virtual void SetAvatarSupported(TBool aSupported ) = 0;
       
   176 
       
   177         /**
       
   178           * PublishOwnPresenceL
       
   179           * to update the  ownstatus to server.
       
   180           * and publishes the own status.
       
   181           * 
       
   182           * @param aStatus ,status to be updated to the server.
       
   183           * @param aValue , text for the status message
       
   184  		  * @param aFilename , avatar file name
       
   185   		  * @param aMimetype , a mime type
       
   186   		  * @param aIsAvatar , a avatar field included
       
   187           * @return TInt error if any
       
   188           */                                
       
   189          virtual TInt PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus aStatus,
       
   190          						  const TDesC& aValue,
       
   191          						  const TDesC& aFilename = KNullDesC, 
       
   192          						  const TDesC8& aMimetype = KNullDesC8,
       
   193          						  TBool aIsAvatar = EFalse  ) = 0 ;
       
   194         
       
   195          /**
       
   196           * Removes URI from block list
       
   197           *
       
   198           * @since S60 5.0
       
   199           * @param aUriOfTheContact, URI to be removed
       
   200           * @return error.
       
   201           */
       
   202          virtual TInt  RemoveFromBlockListL( const TDesC& aUriOfTheContact ) = 0;
       
   203 
       
   204          /**
       
   205           * Adds URI to block list
       
   206           *
       
   207           * @since S60 5.0
       
   208           * @param aContactId, URI to be added
       
   209           * @return error.
       
   210           */
       
   211          virtual TInt  AddToBlockListL( const TDesC& aContactId ) = 0;
       
   212          
       
   213          /**
       
   214           * Returns the blocked list.
       
   215           * it returns the blocked list that it maintains locally in engine.
       
   216           * @since S60 5.0
       
   217           * @return blocked list.
       
   218           */
       
   219          virtual RPointerArray<HBufC>* GetBlockedList() = 0;
       
   220          
       
   221 		/**
       
   222 		* fetch blocked list from server to get the freshed blocked list.
       
   223 		*@param aOb,pointer of MVIMPSTEngineBlockedListFetchEventObserver,
       
   224 		*		   Notify that fetch of blocked list has been completed..
       
   225 		*/
       
   226 		virtual void FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb) = 0;
       
   227 
       
   228          /**
       
   229           * function call from the engine on the completion of contact fetch operation
       
   230           */
       
   231          virtual void UpdatePresenceStateL() = 0;
       
   232          
       
   233      /**
       
   234       * Fetches the presence of singlecontact form presence cache
       
   235       * @param aContact, user id of the ocntact who's presence 
       
   236       * needs to eb fetched.
       
   237       */
       
   238      virtual void FetchPresenceOfSingleContactL(const TDesC& aContact) = 0; 
       
   239      
       
   240      /**
       
   241      * Unsubscribes ximp group contents.
       
   242      * 
       
   243      * Buddy list and authorization lists are always unsubscibed.
       
   244      * Block list is unsubscribed if it is supported.
       
   245      *
       
   246      * @since S60 5.0
       
   247      * @param None
       
   248      * @leave Standard Symbian error codes.
       
   249      * @return None
       
   250      */                 
       
   251     virtual void UnsubscribeListsL() = 0;
       
   252        /**
       
   253 		* virtual Destructor
       
   254 		*/		
       
   255 		virtual ~MVIMPSTEnginePresenceSubService() 
       
   256 		{}
       
   257 		
       
   258 	};
       
   259 
       
   260 #endif //MVIMPSTENGINEPRESENCESUBSERVICE_H
       
   261 
       
   262