ipappsrv_plat/comms_event_api/inc/mceinrefer.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMCEINREFER_H
       
    22 #define CMCEINREFER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <mcerefer.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMceInEvent;
       
    29 class CMceMsgSIPEvent;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * Class for mobile terminated MCE refers.
       
    35 *
       
    36 * CMceInRefer represents incoming request to perform an action. If the remote terminal
       
    37 * expects notifications about how the action is proceeding, instance of CMceInEvent
       
    38 * is also passed to the user. User is then responsible of sending notifications and
       
    39 * finally terminate the event and refer. If notifications are not expected by the
       
    40 * remote terminal, instance of CMceInEvent is not returned and refer is terminated
       
    41 * as soon as either accept or reject response is sent. 
       
    42 *
       
    43 * This class is never instantiated by user, but the ownership is in any case transferred
       
    44 * to it. See class MMceInReferObserver.
       
    45 *
       
    46 * If for any reason instance of this class is deleted while in accepted state,
       
    47 * it is automatically terminated by MCE server.
       
    48 *
       
    49 *  @lib mceclient.lib
       
    50 */
       
    51 class CMceInRefer: public CMceRefer
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54                
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         IMPORT_C ~CMceInRefer();
       
    59 
       
    60     public: // New functions
       
    61               
       
    62 	    /**
       
    63 	    * Sends accept respond to an incoming refer.
       
    64 	    * @pre State() == CMceRefer::EIdle
       
    65 	    * @post State() == CMCRefer::EPending ||
       
    66 	    *       State() == CMCRefer::EAccepted (for suppressed refers)	    
       
    67         * @return New instance of event, if CMceRefer::Type() != CMceRefer::ESuppressed.
       
    68 	    */
       
    69 	    IMPORT_C CMceInEvent* AcceptL();
       
    70 		
       
    71 	    /**
       
    72 	    * Rejects incoming refer.
       
    73 	    * @pre State() == CMceRefer::EIdle
       
    74 	    * @post State() == CMCRefer::ETerminated	    
       
    75 	    */
       
    76 	    IMPORT_C void RejectL();
       
    77 	    
       
    78 	    /**
       
    79 	    * Sends respond to an incoming refer.
       
    80 	    * @pre State() == CMceRefer::EIdle
       
    81 	    * @post State() == CMCRefer::ETerminated ||
       
    82 	    *       State() == CMCRefer::EPending ||	    
       
    83 	    *       State() == CMCRefer::EAccepted (for suppressed refers)	    
       
    84 	    * @param aReason, reason phrase
       
    85 	    * @param aCode, reason code
       
    86 	    * @param aHeaders, SIP headers to be added into respond. Ownership is
       
    87 		*		 transferred.
       
    88 		* @param aContentType, a type of content. Ownership
       
    89 		*		 is transferred.
       
    90 	    * @param aContent, content to be added in body. Ownership is 
       
    91 		*		 transferred.
       
    92         * @return New instance of event, if refer was accepted and 
       
    93         *         CMceRefer::Type() != CMceRefer::ESuppressed.
       
    94 	    */
       
    95 	    IMPORT_C CMceInEvent* RespondL(
       
    96 					 		 const TDesC8& aReason,
       
    97 	                 		 TUint32 aCode,
       
    98 	                 		 CDesC8Array* aHeaders = 0,
       
    99 					 		 HBufC8* aContentType = 0,
       
   100 					 		 HBufC8* aContent = 0 ); 
       
   101 	    
       
   102     
       
   103     public: // Functions from base class
       
   104         
       
   105         /**
       
   106         * Returns truth value, is the refer in-refer or not.
       
   107         * @return TBool, ETrue.
       
   108         */
       
   109         TBool IsInRefer() const;
       
   110 
       
   111         /**
       
   112         * Two-phased constructor.
       
   113         */
       
   114         static CMceInRefer* NewL( CMceManager& aManager,
       
   115                                 TUint32 aProfileId,
       
   116                                 CMceMsgSIPEvent& aEventMsg,
       
   117                                 CMceInEvent* aInEvent = NULL );
       
   118         
       
   119     
       
   120     private:   
       
   121         /**
       
   122         * C++ default constructor.
       
   123         * @param aManager, reference to event manager.
       
   124         * @param aProfileId, id of the sip profile used for the event.
       
   125         */
       
   126     	CMceInRefer( CMceManager& aManager, 
       
   127                       TUint32 aProfileId,
       
   128                       TUint32 aId,
       
   129                       TUint32 aDialogId,
       
   130                       TType aType );
       
   131 		    
       
   132 	    /**
       
   133         * second-phase constructor
       
   134         */
       
   135 	    void ConstructL( HBufC8* aReferTo,
       
   136                          HBufC8* aRecipient,
       
   137                          HBufC8* aOrginator,
       
   138                          CMceInEvent* aInEvent );
       
   139     };
       
   140 
       
   141 #endif