realtimenetprots/sipfw/SIP/TransactionUser/src/ResolvingResults.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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 * Name          : ResolvingResults.h
       
    16 * Part of       : TransactionUser
       
    17 * Version       : SIP/5.0
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef RESOLVINGRESULTS_H
       
    30 #define RESOLVINGRESULTS_H
       
    31 
       
    32 // INCLUDES
       
    33 #include <e32base.h>
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class RStringF;
       
    37 class MSIPResolvingResult;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 /*
       
    41  * This class is used for storing and accessing the addresses returned from a
       
    42  * URI resolving.
       
    43  */
       
    44 class CResolvingResults : public CBase
       
    45 	{
       
    46 public: // Constructor and destructor
       
    47 
       
    48 	/**	 
       
    49 	 * @return New CResolvingResults object, ownership is transferred
       
    50 	 */
       
    51 	static CResolvingResults* NewL();
       
    52 
       
    53 	~CResolvingResults();
       
    54 
       
    55 public: // New functions
       
    56 	
       
    57 	/**
       
    58 	 * Return the resolve results.
       
    59 	 *	 
       
    60 	 * @return Array containing all the resolving results obtained so far.
       
    61 	 *	Ownership is not transferred.
       
    62 	 */
       
    63 	RPointerArray<MSIPResolvingResult>& Addresses();	
       
    64 
       
    65     /**
       
    66 	 * Obtain the next address, that hasn't been tried yet.
       
    67 	 *
       
    68 	 * @param aAddress OUT: Found address.
       
    69 	 *				   Set only if this function returns ETrue.
       
    70 	 * @param aTransport OUT: Transport protocol of aAddress.
       
    71 	 *				     Set only if this function returns ETrue.
       
    72 	 * @param aForceUDP OUT: ETrue if transport of aAddress must remain UDP.
       
    73 	 *				    Set only if this function returns ETrue.
       
    74 	 * @return ETrue If an address that hasn't been already tried was found.
       
    75 	 *	EFalse when no more addresses are left, that haven't been already tried.
       
    76 	 */
       
    77 	TBool GetNext(TInetAddr& aAddress,
       
    78 				  RStringF& aTransport,
       
    79 				  TBool& aForceUDP);
       
    80 
       
    81 	/**
       
    82 	 * Determine if there can be more resolving results for the URI.
       
    83 	 *
       
    84 	 * @return ETrue  If the URI should be resolved again to get more results
       
    85 	 *		   EFalse If current URI has been fully resolved
       
    86 	 */
       
    87 	TBool ContinueResolvingCurrentUri() const;
       
    88 
       
    89 	/**
       
    90 	 * Clear all resolving results.
       
    91 	 */
       
    92 	void ClearAll();
       
    93 
       
    94 private: // For internal use
       
    95 
       
    96 	CResolvingResults();
       
    97 
       
    98 private: // Data
       
    99 
       
   100     RPointerArray<MSIPResolvingResult> iAddresses;
       
   101 
       
   102 #ifdef CPPUNIT_TEST	
       
   103 	friend class CUserAgent_Test;
       
   104 	friend class CUserAgentClient_Test;
       
   105 	friend class CTransactionUser_Test;
       
   106 	friend class CNormalUAC_ResolveAddress_Test;
       
   107 	friend class CNormalUAC_WaitResponse_Test;
       
   108 	friend class CInviteUAC_Start_Test;
       
   109 	friend class CInviteUAC_WaitResponse_Test;
       
   110 	friend class CInviteUAC_ResolveAckAddress_Test;
       
   111 #endif
       
   112 	};
       
   113 
       
   114 #endif // end of RESOLVINGRESULTS_H
       
   115 
       
   116 // End of File