voipplugins/dhcppositionprovider/inc/dhcppsyrequester.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     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:  Header file DHCP PSY requester class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef DHCPPSYREQUESTER_H
       
    21 #define DHCPPSYREQUESTER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <lbspositioninfo.h>
       
    26 
       
    27 #include "dhcppsyrequesterprogressobserver.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CDhcpPsyPositioner;
       
    31 class CPositioner;
       
    32 class CDhcpWlanQueryHandler;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 
       
    37 /**
       
    38 *  This class implements the position requester.
       
    39 *
       
    40 *  Position requester is responsible for loading appropriate PSY vi ECom Plug-in
       
    41 *  and forward location request to the loaded PSY.
       
    42 *
       
    43 *  This class may owns an instance of CPositioner.
       
    44 *
       
    45 *  @lib dhcppositionprovider.dll
       
    46 *  @since 3.2
       
    47 */
       
    48 class CDhcpPsyRequester : public CBase, MDhcpPsyRequesterProgressObserver
       
    49     {
       
    50     public:  // Constructors and destructor
       
    51 
       
    52         /**
       
    53         * Two - phased constructor.
       
    54         *
       
    55         */
       
    56         static CDhcpPsyRequester* NewL ();
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CDhcpPsyRequester();
       
    62 
       
    63     public:
       
    64 
       
    65         /**
       
    66         * Notify position update
       
    67         * @param aPosInfo Reference to TPositionerInfoBase, used to store
       
    68         *                 fix information.
       
    69         * @param aStatus  Reference to TRequestStatus, used to complete location
       
    70         *                 request.
       
    71         * @since 3.2
       
    72         */
       
    73         void NotifyPositionUpdate ( TPositionInfoBase& aPosInfo,
       
    74             TRequestStatus& aStatus );
       
    75 
       
    76         /**
       
    77          * Cancel ongoing location query.
       
    78          */
       
    79         void CancelRequest ();
       
    80 
       
    81     protected:
       
    82 
       
    83         void  ProgressPsyRequestNotificationL (TRequestProgressPhases aPhase,
       
    84             TInt aPhaseValue);
       
    85 
       
    86     private:
       
    87 
       
    88         enum TDhcpRequesterStates
       
    89             {
       
    90             EDhpWlanIdle,
       
    91             EDchpQueryInitalising,
       
    92             EDhcpLocationQueryInProgress
       
    93             };
       
    94 
       
    95     private:
       
    96 
       
    97         /**
       
    98         * C++default constructor.
       
    99         */
       
   100         CDhcpPsyRequester ();
       
   101 
       
   102         /**
       
   103         * By default Symbian 2nd phase constructor is private.
       
   104         */
       
   105         void ConstructL();
       
   106 
       
   107         /**
       
   108         * Make location request to the first PSY
       
   109         */
       
   110         void MakeLocationRequest();
       
   111 
       
   112         /**
       
   113         * Complete location request
       
   114         */
       
   115         void CompleteRequest( TInt aErr );
       
   116 
       
   117         /**
       
   118         * Free all reserved memory
       
   119         */
       
   120         void Flush();
       
   121 
       
   122     private:    // Methods
       
   123 
       
   124         /**
       
   125         *
       
   126         * Fetch position generic data from input to make location query
       
   127         * to the wlan network.
       
   128         *
       
   129         * @param aPosInfo Reference to TPositionerInfoBase, used to store
       
   130         *                 fix information.
       
   131         *
       
   132         * @return TInt  Status code.
       
   133         *
       
   134         * @since 3.2
       
   135         */
       
   136         TInt FetchPositioningGenericData  ( TPositionInfoBase& aPosInfo );
       
   137 
       
   138     private:    // Data
       
   139         // States
       
   140         TDhcpRequesterStates    iQueryState;
       
   141 
       
   142         // Internet access point id
       
   143         TUint32 iIAPProfileId;
       
   144 
       
   145         //
       
   146         CDhcpWlanQueryHandler* iWlanDhcpQuery;
       
   147 
       
   148         // Pointer to position info
       
   149         TPositionInfoBase* iPositionInfo;
       
   150 
       
   151         // Status to notify the LF
       
   152         TRequestStatus* iRequestStatus;
       
   153 
       
   154         // To hold location data until module deleted or
       
   155         // new request is made.
       
   156         HBufC8* iLocationData;
       
   157 
       
   158         //
       
   159         TBool iCancelled;
       
   160 
       
   161     };
       
   162 
       
   163 #endif      // DHCPPSYREQUESTER_H
       
   164 
       
   165 // End of File