wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp
author hgs
Thu, 24 Jun 2010 10:49:51 +0300
changeset 39 7b3e49e4608a
child 61 e1d68407ed06
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:
hgs
parents:
diff changeset
    15
* Wlan Login QtHighway Service.
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// System includes
hgs
parents:
diff changeset
    19
#include <QUrl>
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
// User includes
hgs
parents:
diff changeset
    22
#include "wlanloginservice.h"
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include "OstTraceDefinitions.h"
hgs
parents:
diff changeset
    25
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents:
diff changeset
    26
#include "wlanloginserviceTraces.h"
hgs
parents:
diff changeset
    27
#endif
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
/*!
hgs
parents:
diff changeset
    30
    \class WlanLoginService
hgs
parents:
diff changeset
    31
    \brief Wlan Login QtHighway service implementation.
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
    This class implements a QtHighway service that is used to launch
hgs
parents:
diff changeset
    34
    Wlan login application. 
hgs
parents:
diff changeset
    35
*/
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
/*!
hgs
parents:
diff changeset
    38
    Constructor.
hgs
parents:
diff changeset
    39
    
hgs
parents:
diff changeset
    40
    @param[in] parent Object parent.
hgs
parents:
diff changeset
    41
 */
hgs
parents:
diff changeset
    42
WlanLoginService::WlanLoginService(QObject* parent)
hgs
parents:
diff changeset
    43
    : XQServiceProvider(QLatin1String("wlanlogin.com.nokia.symbian.IWlanLogin"), parent),
hgs
parents:
diff changeset
    44
      mReturnValue(WlanLoginStatusNone)
hgs
parents:
diff changeset
    45
{
hgs
parents:
diff changeset
    46
    OstTraceFunctionEntry0(WLANLOGINSERVICE_WLANLOGINSERVICE_ENTRY);
hgs
parents:
diff changeset
    47
    
hgs
parents:
diff changeset
    48
    publishAll();
hgs
parents:
diff changeset
    49
    
hgs
parents:
diff changeset
    50
    OstTraceFunctionExit0(WLANLOGINSERVICE_WLANLOGINSERVICE_EXIT);
hgs
parents:
diff changeset
    51
}
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
/*!
hgs
parents:
diff changeset
    54
    Destructor.
hgs
parents:
diff changeset
    55
 */
hgs
parents:
diff changeset
    56
WlanLoginService::~WlanLoginService()
hgs
parents:
diff changeset
    57
{
hgs
parents:
diff changeset
    58
    OstTraceFunctionEntry0(WLANLOGINSERVICE_DESTRUCTOR_ENTRY);
hgs
parents:
diff changeset
    59
    
hgs
parents:
diff changeset
    60
    OstTraceFunctionExit0(WLANLOGINSERVICE_DESTRUCTOR_EXIT);
hgs
parents:
diff changeset
    61
}
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
/*!
hgs
parents:
diff changeset
    64
    Completes the current service.
hgs
parents:
diff changeset
    65
    
hgs
parents:
diff changeset
    66
    @param [in] status completeing status of the service request  
hgs
parents:
diff changeset
    67
 */
hgs
parents:
diff changeset
    68
void WlanLoginService::completeServiceRequest(int status)
hgs
parents:
diff changeset
    69
{    
hgs
parents:
diff changeset
    70
     OstTraceFunctionEntry0(WLANLOGINSERVICE_COMPLETESERVICEREQUEST_ENTRY);
hgs
parents:
diff changeset
    71
     
hgs
parents:
diff changeset
    72
    mReturnValue.setValue(status);
hgs
parents:
diff changeset
    73
    bool ret = completeRequest(mAsyncRequestIndex, mReturnValue);
hgs
parents:
diff changeset
    74
    Q_ASSERT(ret);
hgs
parents:
diff changeset
    75
    
hgs
parents:
diff changeset
    76
    OstTraceFunctionExit0(WLANLOGINSERVICE_COMPLETESERVICEREQUEST_EXIT);
hgs
parents:
diff changeset
    77
}
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
/*!
hgs
parents:
diff changeset
    80
    Launches Wlan Login application giving needed information.
hgs
parents:
diff changeset
    81
    
hgs
parents:
diff changeset
    82
    @param [in] iapId of the connection that we need to attach to
hgs
parents:
diff changeset
    83
    @param [in] netId of the connection that we need to attach to
hgs
parents:
diff changeset
    84
    @param [in] url redirection URL of the login page to be loaded
hgs
parents:
diff changeset
    85
      
hgs
parents:
diff changeset
    86
 */
hgs
parents:
diff changeset
    87
void WlanLoginService::start(int iapId, int netId, QUrl url)
hgs
parents:
diff changeset
    88
{
hgs
parents:
diff changeset
    89
    OstTraceFunctionEntry0( WLANLOGINSERVICE_START_ENTRY );
hgs
parents:
diff changeset
    90
    
hgs
parents:
diff changeset
    91
    mAsyncRequestIndex = setCurrentRequestAsync();
hgs
parents:
diff changeset
    92
    emit startLogin(iapId, netId, url);  
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
    OstTraceFunctionExit0(WLANLOGINSERVICE_START_EXIT);
hgs
parents:
diff changeset
    95
}
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
/*!
hgs
parents:
diff changeset
    98
    Stop launched Wlan Login application.
hgs
parents:
diff changeset
    99
 */
hgs
parents:
diff changeset
   100
void WlanLoginService::stop()
hgs
parents:
diff changeset
   101
{
hgs
parents:
diff changeset
   102
    OstTraceFunctionEntry0(WLANLOGINSERVICE_STOP_ENTRY);
hgs
parents:
diff changeset
   103
    
hgs
parents:
diff changeset
   104
    mAsyncRequestIndex = setCurrentRequestAsync();
hgs
parents:
diff changeset
   105
    emit stopLogin();
hgs
parents:
diff changeset
   106
    
hgs
parents:
diff changeset
   107
    OstTraceFunctionExit0(WLANLOGINSERVICE_STOP_EXIT);
hgs
parents:
diff changeset
   108
}