realtimenetprots/sipfw/SIP/ServerResolver/inc/CServerQuery.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-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          : CServerQuery.h
       
    16 * Part of       : ServerResolver
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 #ifndef CSERVERQUERY_H
       
    28 #define CSERVERQUERY_H
       
    29 
       
    30 //INCLUDES
       
    31 #include <e32base.h>
       
    32 #include "MSIPServerQuery.h"
       
    33 #include "_sipcodecdefs.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CSIPQueryConditionBase;
       
    37 class MSIPServerResolverObserver;
       
    38 class CSIPQueryData;
       
    39 class MSIPHostResolver;
       
    40 
       
    41 // CLASS DEFINITION
       
    42 /**
       
    43  * CServerQuery implements a
       
    44  */
       
    45 class CServerQuery : public CBase, public MSIPServerQuery
       
    46 	{
       
    47 	public:// Constructors and destructor
       
    48 
       
    49 		/**
       
    50 	 	* Creates a new CServerQuery instance
       
    51 	 	* @param aObserver callback that will be used when resolving 
       
    52 	 	*    	has been completed. The ownership is not transferred.
       
    53 	 	* @param aQueryData for storing the query data. 
       
    54 	 	*		The ownership is transferred.
       
    55 	 	* @returns a new instance of CServerQuery
       
    56 	 	*/
       
    57 		static CServerQuery* NewL( MSIPServerResolverObserver* aObserver,
       
    58 							  	   CSIPQueryData* aQueryData );
       
    59 
       
    60     	/**
       
    61 	 	* Creates a new CServerQuery instance 
       
    62 	 	* and pushes it to CleanupStack
       
    63 	 	* @param aObserver callback that will be used when resolving 
       
    64 	 	*    	has been completed. The ownership is not transferred.
       
    65 	 	* @param aQueryData for storing the query data. 
       
    66 	 	*		The ownership is transferred.
       
    67 	 	* @returns a new instance of CServerQuery
       
    68 	 	*/
       
    69 		static CServerQuery* NewLC( MSIPServerResolverObserver* aObserver, 
       
    70 							   	    CSIPQueryData* aQueryData );
       
    71 							   	    
       
    72 		/**
       
    73 	 	* Destructor.
       
    74 	 	*/			   	    
       
    75 		~CServerQuery();
       
    76 					   
       
    77 	public:// From MSIPServerQuery
       
    78 	
       
    79 		CSIPQueryData& QueryData();
       
    80 
       
    81 	public:
       
    82 	
       
    83 		void Query( MSIPHostResolver& aResolver );
       
    84 		 
       
    85 		TBool HandleQueryResultL( TInt aStatus );
       
    86 		 
       
    87 		MSIPServerResolverObserver* ServerResolverObserver(); 
       
    88 	
       
    89 		void SetQueryConditionL( CSIPQueryConditionBase* aQueryCondition ); 
       
    90 		
       
    91 	public:// Data
       
    92 	
       
    93 		static const TInt iOffset;
       
    94 		
       
    95 		TSglQueLink iLink;
       
    96 
       
    97 	private:// Constructors and destructor
       
    98 
       
    99 		void ConstructL( MSIPServerResolverObserver* aObserver, 
       
   100 					 	 CSIPQueryData* aQueryData );
       
   101 					 	 
       
   102 		CServerQuery();
       
   103 		
       
   104 	private:// Data
       
   105 	
       
   106 		CSIPQueryConditionBase* iQueryCondition;
       
   107 		
       
   108 		//Not owned
       
   109 		MSIPServerResolverObserver* iObserver;
       
   110 		
       
   111 		CSIPQueryData* iQueryData;
       
   112 		
       
   113 	private: // For testing purposes
       
   114 
       
   115 		UNIT_TEST( CServerQueryTest)	
       
   116     
       
   117 	};
       
   118 #endif // end of CSERVERQUERY_H
       
   119 
       
   120 // End of File