ipappsrv_plat/comms_event_api/inc/mceinevent.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 CMCEINEVENT_H
       
    22 #define CMCEINEVENT_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <mceevent.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMceManager;
       
    29 class CMceSession;
       
    30 class CMceMsgSIPEvent;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * Class for mobile terminated MCE events.
       
    36 *
       
    37 * CMceOutEvent represents incoming request to from terminal to establish event dialog.
       
    38 *
       
    39 * After the event has been succesfylly set up, it can be later updated and
       
    40 * must be finally terminated. Notifications about the event are send using NotifyL
       
    41 * function. The respond to this in not passed to user, unless there is failure.
       
    42 *
       
    43 * If for any reason instance of this class is deleted while in active state,
       
    44 * event is automatically terminated by MCE server.
       
    45 *
       
    46 *  @lib mceclient.lib
       
    47 */
       
    48 class CMceInEvent:public CMceEvent
       
    49     {
       
    50 	public:  // Constructors and destructor
       
    51 	       
       
    52 	    /**
       
    53 	    * Destructor.
       
    54 	    */
       
    55 	    IMPORT_C ~CMceInEvent();
       
    56 
       
    57 	public: // New functions
       
    58 	       
       
    59 	    /**
       
    60 	    * Sends accept respond to an incoming event.
       
    61 	    * @pre State() == CMceEvent::EIdle
       
    62 	    * @post State() == CMceEvent::EPending	    
       
    63 	    */
       
    64 	    IMPORT_C void AcceptL();
       
    65 		
       
    66 	    /**
       
    67 	    * Sends reject respond to an incoming event.
       
    68 	    * @pre State() == CMceEvent::EIdle
       
    69 	    * @post State() == CMCEvent::ETerminated	    
       
    70 	    */
       
    71 	    IMPORT_C void RejectL();
       
    72 
       
    73 	    /**
       
    74 	    * Sends respond to an incoming event.
       
    75 	    * @pre State() == CMceEvent::EIdle
       
    76 	    * @post State() == CMCEvent::ETerminated ||	    
       
    77 	    *       State() == CMCEvent::EPending	    
       
    78 	    * @param aReason, reason phrase
       
    79 	    * @param aCode, reason code
       
    80 	    * @param aHeaders, SIP headers to be added into respond. Ownership is
       
    81 		*		 transferred.
       
    82 		* @param aContentType, a type of content. Ownership
       
    83 		*		 is transferred.
       
    84 	    * @param aContent, content to be added in body. Ownership is 
       
    85 		*		 transferred.
       
    86 	    */
       
    87 	    IMPORT_C void RespondL(
       
    88 					 const TDesC8& aReason,
       
    89 	                 TUint32 aCode,
       
    90 	                 CDesC8Array* aHeaders = 0,
       
    91 					 HBufC8* aContentType = 0,
       
    92 					 HBufC8* aContent = 0 ); 
       
    93 
       
    94 	    /**
       
    95 	    * Sends notification related to an event.
       
    96 	    * @pre State() == CMceEvent::EIdle
       
    97 	    * @post State() == CMCEvent::EPending	    
       
    98 	    * @param aHeaders, SIP headers to be added. Ownership is
       
    99 		*		 transferred.
       
   100 	    * @param aContentType, content type of the body.
       
   101 		*		 Ownership is transferred.
       
   102 	    * @param aContent, content to be added in a body. Ownership is 
       
   103 		*		 transferred.
       
   104 	    */
       
   105 		IMPORT_C void NotifyL(
       
   106 					 CDesC8Array* aHeaders = 0, 
       
   107 					 HBufC8* aContentType = 0,
       
   108 					 HBufC8* aContent = 0 ); 
       
   109 					 
       
   110 	public: 
       
   111 	
       
   112 	    /**
       
   113 	    * Two-phased constructor.
       
   114 	    */
       
   115 	    static CMceInEvent* NewL( CMceManager& aManager,
       
   116 	                              TUint32 aProfileId,
       
   117 	                              CMceMsgSIPEvent& aEventMsg );
       
   118 	                              
       
   119 		TBool IsInEvent() const;
       
   120 
       
   121 	private: // Functions from base classes
       
   122 		    
       
   123 		    /**
       
   124 	        * C++ default constructor.
       
   125 	        * @param aManager, reference to event manager.
       
   126 	        * @param aProfileId, id of the sip profile used for the event.
       
   127 	        */
       
   128 		CMceInEvent( CMceManager& aManager, 
       
   129 		             TUint32 aProfileId,
       
   130 		             TUint32 aId,
       
   131 	                 TUint32 aDialogId,
       
   132 	                 TUint32 aRefreshInterval );
       
   133 		
       
   134 	private: 
       
   135 
       
   136 		    
       
   137 	    /**
       
   138 	    * second-phase constructor
       
   139 	    */
       
   140 	    void ConstructL( HBufC8* aEventHeader, 
       
   141 	                     HBufC8* aRecipient, 
       
   142 	                     HBufC8* aOriginator,
       
   143 	                     TUint32 aDialogType );
       
   144 
       
   145 		
       
   146 	    MCE_UNIT_TEST_DEFS
       
   147     };
       
   148 
       
   149 #endif