applayerprotocols/ftpengine/inc/RESOLVER.H
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 /**
       
     2 * Copyright (c) 1998-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 * Active object to perform DNS lookup
       
    16 * Author:	Philippe Gabriel
       
    17 * Performs DNS lookup for the FTP client
       
    18 * 
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @file RESOLVER.H
       
    26  @internalComponent
       
    27 */
       
    28 
       
    29 #if !defined(__RESOLVER_H__)
       
    30 #define __RESOLVER_H__
       
    31 #include "DEBUG.H"
       
    32 #include "FTPDEF.H"
       
    33 #include <e32base.h>
       
    34 #include <in_sock.h>
       
    35 
       
    36 //////////////////////////////////////////////////////////////
       
    37 // Definitions
       
    38 //////////////////////////////////////////////////////////////
       
    39 
       
    40 class CFtpProtocol;
       
    41 class MFTPResolverNotifier
       
    42 /**
       
    43 @internalComponent
       
    44 */
       
    45 {
       
    46 public:
       
    47 /** 
       
    48 Operation completion return codes.
       
    49 */ 
       
    50 	enum TFTPResolverNotificationCode 
       
    51 		{
       
    52 		EDtpLookupComplete=0, 
       
    53 		EDtpLookupFailed
       
    54 		};
       
    55 public:
       
    56 		/** Notify of normal completion of an operation */
       
    57 		virtual void FTPResolverNotifier(const TFTPResolverNotificationCode)=0;
       
    58 };
       
    59 NONSHARABLE_CLASS(CFTPResolver) : public CActive
       
    60 /**
       
    61 @internalComponent
       
    62 */
       
    63 {
       
    64 public:
       
    65 	CFTPResolver(MFTPResolverNotifier*);
       
    66 	~CFTPResolver();
       
    67 	static CFTPResolver* NewL(MFTPResolverNotifier*,RSocketServ&);
       
    68 	void ConstructL(RSocketServ& aSockServ);
       
    69 	void Lookup(const THostName& aServerName);
       
    70 	void SetAddress(TInetAddr& aAddress);
       
    71 protected:
       
    72 	void RunL();
       
    73     void DoCancel(void);
       
    74 private:
       
    75 	/** Used for resoving Ip Address from a name and vice versa */
       
    76 	RHostResolver iResolver;  
       
    77 	/** PlaceHolder for the resolved address */
       
    78 	TInetAddr* iAddress; 
       
    79 	TNameEntry iNameEntry;
       
    80 	TNameRecord iNameRecord;
       
    81 	MFTPResolverNotifier* iNotifier;
       
    82 	TBuf8<40> iServerName;
       
    83 };
       
    84 #endif // __RESOLVER_H__