voipplugins/dhcppositionprovider/inc/dhcpwlanqueryhandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007 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 #ifndef DHCPWLANQUERYHANDLER_H
       
    20 #define DHCPWLANQUERYHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <es_sock.h>
       
    24 #include <in_sock.h>
       
    25 
       
    26 #include "dhcppsyrequesterprogressobserver.h"
       
    27 #include "dhcpconstants.h"
       
    28 
       
    29 class CDhcpPsySocketListener;
       
    30 class CDhcpDataRequestor;
       
    31 class CDhcpConnectionEngine;
       
    32 class CDhcpPsyDhcpServerIPResolver;
       
    33 
       
    34 /**
       
    35 *  Class for handling the DHCP Messages sending and receiving.
       
    36 *
       
    37 *  @lib dhcppositionprovider
       
    38 *  @since S60 3.2
       
    39 */
       
    40 class CDhcpWlanQueryHandler : public CActive
       
    41     {
       
    42     public:
       
    43 
       
    44         /**
       
    45          * Two-phased statical constructor which can leave
       
    46          *
       
    47          * @since S60 3.2
       
    48          */
       
    49         static CDhcpWlanQueryHandler* NewL(MDhcpPsyRequesterProgressObserver *aObserver);
       
    50 
       
    51         /**
       
    52          * C++ destructor
       
    53          *
       
    54          * @since S60 3.2
       
    55          */
       
    56         virtual ~CDhcpWlanQueryHandler();
       
    57 
       
    58     public:
       
    59 
       
    60         /**
       
    61          * Make DHCP location query to WLAN network
       
    62          * @param aIAPProfileId     Id to used IAP profile
       
    63          *
       
    64          */
       
    65         void MakeLocationQueryL (TUint32 aIAPProfileId );
       
    66 
       
    67         /**
       
    68         * Return location data for requestor.
       
    69          *
       
    70          * @returns   Address to location data object
       
    71          */
       
    72         HBufC8* LocationData ();
       
    73 
       
    74     protected:  // From CActive
       
    75 
       
    76         /**
       
    77         * Handles an active object's request completion event.
       
    78         */
       
    79         void RunL();
       
    80 
       
    81         /**
       
    82         * Cancellation of an outstanding request.
       
    83         */
       
    84         void DoCancel();
       
    85 
       
    86         /**
       
    87         * Handles a leave occurring in the RunL()
       
    88         */
       
    89         TInt RunError( TInt aErr );
       
    90 
       
    91 
       
    92     private:
       
    93 
       
    94         /**
       
    95          * C++ constructor
       
    96          *
       
    97          * @since S60 3.2
       
    98          */
       
    99         CDhcpWlanQueryHandler(MDhcpPsyRequesterProgressObserver *aObserver);
       
   100 
       
   101         /**
       
   102          * Symbian Os construtor which can leave
       
   103          *
       
   104          * @since S60 3.2
       
   105          */
       
   106         void ConstructL();
       
   107 
       
   108         /**
       
   109          * Release location based reserved resources
       
   110          *
       
   111          * @since S60 3.2
       
   112          */
       
   113         void Flush ();
       
   114 
       
   115     private:
       
   116 
       
   117         enum TDhcpWLanQueryStates
       
   118             {
       
   119             EDhpWlanIdle,
       
   120             EAttachToConnection,
       
   121             EDhcpIpAddressQuery,
       
   122             ESendDhcpLocatinQuery,
       
   123             EReceiveDhcpLocationAck,
       
   124             EWlanMakeQueryToConnectionIoctl,
       
   125             EStopExecution
       
   126             };
       
   127 
       
   128     private: // data
       
   129 
       
   130         // Address of psy progress observer object.
       
   131         MDhcpPsyRequesterProgressObserver *iPsyProgressObserver;
       
   132 
       
   133         /**
       
   134         * Socket server
       
   135         */
       
   136         RSocketServ iSocketServer;
       
   137 
       
   138         /**
       
   139         * Connection
       
   140         */
       
   141         RConnection iConnection;
       
   142 
       
   143         /**
       
   144         * Sockets
       
   145         */
       
   146         RSocket iSocket;
       
   147 
       
   148         //
       
   149         TDhcpWLanQueryStates iState;
       
   150 
       
   151         //
       
   152         CDhcpDataRequestor* iLctnDataRequestor;
       
   153 
       
   154         //
       
   155         CDhcpPsySocketListener* iLctnDataListener;
       
   156 
       
   157         //
       
   158         CDhcpPsyDhcpServerIPResolver* iDhcpResolver;
       
   159 
       
   160         //
       
   161         CDhcpConnectionEngine*    iConnectionEngine;
       
   162 
       
   163 
       
   164         // Owned
       
   165         HBufC8*     iLocationBufferData;
       
   166 
       
   167         //
       
   168         TInetAddr   iInetLclIpAddress;
       
   169 
       
   170         // Used IAP
       
   171         TUint32 iIapProfileId;
       
   172 
       
   173     };
       
   174 
       
   175 #endif // DHCPWLANQUERYHANDLER_H
       
   176