wlanutilities/wlanlogin/ictsqtwrapper/src/ictsqtwrapper.cpp
branchRCL_3
changeset 25 f28ada11abbf
parent 24 63be7eb3fc78
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
     1 /*
       
     2 * Copyright (c) 2010 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 * Implementation of IctsWrapper class
       
    16 *
       
    17 */
       
    18 
       
    19 // System includes
       
    20 
       
    21 // User includes
       
    22 
       
    23 #include "ictsqtwrapper.h"
       
    24 #include "ictsqtwrapper_symbian.h"
       
    25 
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "ictsqtwrapperTraces.h"
       
    29 #endif
       
    30 
       
    31 /*!
       
    32     \class IctsWrapper
       
    33     \brief This is a wrapper implementation for symbian side ICTS client interface
       
    34 */
       
    35 
       
    36 // External function prototypes
       
    37 
       
    38 // Local constants
       
    39 
       
    40 
       
    41 // ======== LOCAL FUNCTIONS ========
       
    42 
       
    43 
       
    44 // ======== MEMBER FUNCTIONS ========
       
    45 
       
    46 /*!
       
    47     Constructor
       
    48         
       
    49  */
       
    50 IctsWrapper::IctsWrapper(int iap, int netId, QObject *parent) : 
       
    51     QObject(parent), 
       
    52     mIsPolling(false),
       
    53     d_ptr(new IctsWrapperPrivate(iap, netId, this))
       
    54 {
       
    55     OstTraceFunctionEntry0( ICTSWRAPPER_ICTSWRAPPER_ENTRY );
       
    56     
       
    57     OstTraceFunctionExit0( ICTSWRAPPER_ICTSWRAPPER_EXIT );
       
    58 }
       
    59 
       
    60 /*!
       
    61     Destructor
       
    62         
       
    63  */
       
    64 IctsWrapper::~IctsWrapper()
       
    65 {
       
    66     OstTraceFunctionEntry0( ICTSWRAPPER_DESTRUCTOR_ENTRY );
       
    67     
       
    68     OstTraceFunctionExit0( ICTSWRAPPER_DESTRUCTOR_EXIT );
       
    69 }
       
    70 
       
    71 /*!
       
    72     This function emits connectivityTestResult signal
       
    73     @param [in] result result of internet connectivity test
       
    74     @param [in] redirectUrl Possible redirection URL that was received
       
    75  */
       
    76 void IctsWrapper::emitConnectivityTestResult(IctsWrapper::ConnectivityTestResult result, QUrl redirectUrl)
       
    77 {
       
    78     OstTraceFunctionEntry0( ICTSWRAPPER_EMITCONNECTIVITYTESTRESULT_ENTRY );
       
    79 
       
    80     OstTrace1( TRACE_NORMAL, ICTSWRAPPER_EMITCONNECTIVITYTESTRESULT_RESULT_TRACE, "IctsWrapper::emitConnectivityTestResult;result=%d", result );
       
    81           
       
    82 #ifdef OST_TRACE_COMPILER_IN_USE
       
    83     QString url = redirectUrl.toString();
       
    84     TPtrC tmp(url.utf16(),url.length() );
       
    85     
       
    86     OstTraceExt1( TRACE_NORMAL, ICTSWRAPPER_EMITCONNECTIVITYTESTRESULT_URL_TRACE, 
       
    87         "IctsWrapper::emitConnectivityTestResult;redirectUrl=%S", tmp );
       
    88 #endif
       
    89     
       
    90     emit connectivityTestResult(result, redirectUrl);
       
    91     mIsPolling = false;
       
    92 
       
    93     OstTraceFunctionExit0( ICTSWRAPPER_EMITCONNECTIVITYTESTRESULT_EXIT );
       
    94 }
       
    95 
       
    96 /*!
       
    97     This function starts connectivity test
       
    98  */
       
    99 
       
   100 void IctsWrapper::startConnectivityTest()
       
   101 {
       
   102     OstTraceFunctionEntry0( ICTSWRAPPER_STARTCONNECTIVITYTEST_ENTRY );
       
   103     
       
   104     d_ptr->startConnectivityTest();
       
   105 
       
   106     OstTraceFunctionExit0( ICTSWRAPPER_STARTCONNECTIVITYTEST_EXIT );
       
   107 }
       
   108 
       
   109 /*!
       
   110     This function starts connectivity test in polling mode
       
   111     
       
   112     @param [in] pollingTime Total polling time
       
   113     @param [in] pollingInterval Interval between polls
       
   114  */
       
   115 void IctsWrapper::startPolling(int pollingTime, int pollingInterval)
       
   116 {
       
   117     OstTraceFunctionEntry0( ICTSWRAPPER_STARTPOLLING_ENTRY );
       
   118     
       
   119     d_ptr->startPolling(pollingTime, pollingInterval);
       
   120     mIsPolling = true;
       
   121 
       
   122     OstTraceFunctionExit0( ICTSWRAPPER_STARTPOLLING_EXIT );
       
   123 }
       
   124 
       
   125 /*!
       
   126     This function stops polling mode
       
   127  */
       
   128 void IctsWrapper::stopPolling()
       
   129 {
       
   130     OstTraceFunctionEntry0( ICTSWRAPPER_STOPPOLLING_ENTRY );
       
   131 
       
   132     d_ptr->stopPolling();
       
   133     
       
   134     OstTraceFunctionExit0( ICTSWRAPPER_STOPPOLLING_EXIT );
       
   135 }
       
   136 
       
   137 /*!
       
   138     This function returns whether we are polling or not
       
   139  */
       
   140 bool IctsWrapper::isPolling() const
       
   141 {
       
   142     OstTraceFunctionEntry0( ICTSWRAPPER_ISPOLLING_ENTRY );
       
   143     
       
   144     OstTraceFunctionExit0( ICTSWRAPPER_ISPOLLING_EXIT );
       
   145     
       
   146     return mIsPolling;
       
   147 }