wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp
author hgs
Thu, 16 Sep 2010 12:52:33 +0300
changeset 61 e1d68407ed06
parent 39 7b3e49e4608a
permissions -rw-r--r--
201037
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>
61
hgs
parents: 39
diff changeset
    20
#include <xqaiwdeclplat.h> 
39
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
// User includes
hgs
parents:
diff changeset
    23
#include "wlanloginservice.h"
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
#include "OstTraceDefinitions.h"
hgs
parents:
diff changeset
    26
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents:
diff changeset
    27
#include "wlanloginserviceTraces.h"
hgs
parents:
diff changeset
    28
#endif
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
/*!
hgs
parents:
diff changeset
    31
    \class WlanLoginService
hgs
parents:
diff changeset
    32
    \brief Wlan Login QtHighway service implementation.
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
    This class implements a QtHighway service that is used to launch
hgs
parents:
diff changeset
    35
    Wlan login application. 
hgs
parents:
diff changeset
    36
*/
hgs
parents:
diff changeset
    37
61
hgs
parents: 39
diff changeset
    38
// External function prototypes
hgs
parents: 39
diff changeset
    39
hgs
parents: 39
diff changeset
    40
// Local constants
hgs
parents: 39
diff changeset
    41
 /*!
hgs
parents: 39
diff changeset
    42
     Full service name i.e "wlanlogin.com.nokia.symbian.IWlanLogin"
hgs
parents: 39
diff changeset
    43
*/
hgs
parents: 39
diff changeset
    44
static const QString wlanLoginFullServiceName = QString("wlanlogin") + QString(".") + QString(XQI_WLAN_LOGIN);
hgs
parents: 39
diff changeset
    45
39
hgs
parents:
diff changeset
    46
/*!
hgs
parents:
diff changeset
    47
    Constructor.
hgs
parents:
diff changeset
    48
    
hgs
parents:
diff changeset
    49
    @param[in] parent Object parent.
hgs
parents:
diff changeset
    50
 */
hgs
parents:
diff changeset
    51
WlanLoginService::WlanLoginService(QObject* parent)
61
hgs
parents: 39
diff changeset
    52
    : XQServiceProvider(wlanLoginFullServiceName, parent),
39
hgs
parents:
diff changeset
    53
      mReturnValue(WlanLoginStatusNone)
hgs
parents:
diff changeset
    54
{
hgs
parents:
diff changeset
    55
    OstTraceFunctionEntry0(WLANLOGINSERVICE_WLANLOGINSERVICE_ENTRY);
hgs
parents:
diff changeset
    56
    
hgs
parents:
diff changeset
    57
    publishAll();
hgs
parents:
diff changeset
    58
    
hgs
parents:
diff changeset
    59
    OstTraceFunctionExit0(WLANLOGINSERVICE_WLANLOGINSERVICE_EXIT);
hgs
parents:
diff changeset
    60
}
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
/*!
hgs
parents:
diff changeset
    63
    Destructor.
hgs
parents:
diff changeset
    64
 */
hgs
parents:
diff changeset
    65
WlanLoginService::~WlanLoginService()
hgs
parents:
diff changeset
    66
{
hgs
parents:
diff changeset
    67
    OstTraceFunctionEntry0(WLANLOGINSERVICE_DESTRUCTOR_ENTRY);
hgs
parents:
diff changeset
    68
    
hgs
parents:
diff changeset
    69
    OstTraceFunctionExit0(WLANLOGINSERVICE_DESTRUCTOR_EXIT);
hgs
parents:
diff changeset
    70
}
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
/*!
hgs
parents:
diff changeset
    73
    Completes the current service.
hgs
parents:
diff changeset
    74
    
hgs
parents:
diff changeset
    75
    @param [in] status completeing status of the service request  
hgs
parents:
diff changeset
    76
 */
hgs
parents:
diff changeset
    77
void WlanLoginService::completeServiceRequest(int status)
hgs
parents:
diff changeset
    78
{    
hgs
parents:
diff changeset
    79
     OstTraceFunctionEntry0(WLANLOGINSERVICE_COMPLETESERVICEREQUEST_ENTRY);
hgs
parents:
diff changeset
    80
     
hgs
parents:
diff changeset
    81
    mReturnValue.setValue(status);
hgs
parents:
diff changeset
    82
    bool ret = completeRequest(mAsyncRequestIndex, mReturnValue);
hgs
parents:
diff changeset
    83
    Q_ASSERT(ret);
hgs
parents:
diff changeset
    84
    
hgs
parents:
diff changeset
    85
    OstTraceFunctionExit0(WLANLOGINSERVICE_COMPLETESERVICEREQUEST_EXIT);
hgs
parents:
diff changeset
    86
}
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
/*!
hgs
parents:
diff changeset
    89
    Launches Wlan Login application giving needed information.
hgs
parents:
diff changeset
    90
    
hgs
parents:
diff changeset
    91
    @param [in] iapId of the connection that we need to attach to
hgs
parents:
diff changeset
    92
    @param [in] netId of the connection that we need to attach to
hgs
parents:
diff changeset
    93
    @param [in] url redirection URL of the login page to be loaded
hgs
parents:
diff changeset
    94
      
hgs
parents:
diff changeset
    95
 */
hgs
parents:
diff changeset
    96
void WlanLoginService::start(int iapId, int netId, QUrl url)
hgs
parents:
diff changeset
    97
{
hgs
parents:
diff changeset
    98
    OstTraceFunctionEntry0( WLANLOGINSERVICE_START_ENTRY );
hgs
parents:
diff changeset
    99
    
hgs
parents:
diff changeset
   100
    mAsyncRequestIndex = setCurrentRequestAsync();
hgs
parents:
diff changeset
   101
    emit startLogin(iapId, netId, url);  
hgs
parents:
diff changeset
   102
hgs
parents:
diff changeset
   103
    OstTraceFunctionExit0(WLANLOGINSERVICE_START_EXIT);
hgs
parents:
diff changeset
   104
}
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
/*!
hgs
parents:
diff changeset
   107
    Stop launched Wlan Login application.
hgs
parents:
diff changeset
   108
 */
hgs
parents:
diff changeset
   109
void WlanLoginService::stop()
hgs
parents:
diff changeset
   110
{
hgs
parents:
diff changeset
   111
    OstTraceFunctionEntry0(WLANLOGINSERVICE_STOP_ENTRY);
hgs
parents:
diff changeset
   112
    
hgs
parents:
diff changeset
   113
    mAsyncRequestIndex = setCurrentRequestAsync();
hgs
parents:
diff changeset
   114
    emit stopLogin();
hgs
parents:
diff changeset
   115
    
hgs
parents:
diff changeset
   116
    OstTraceFunctionExit0(WLANLOGINSERVICE_STOP_EXIT);
hgs
parents:
diff changeset
   117
}