wlanutilities/wlanlogin/wlanloginapp/src/wlanloginwebpage.cpp
branchRCL_3
changeset 24 63be7eb3fc78
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
       
     1 /*
       
     2  * Copyright (c) 2009 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 // System includes
       
    19 #include <QWebPage>
       
    20 #include <QWebFrame>
       
    21 #include <QNetworkRequest>
       
    22 
       
    23 // User includes
       
    24 #include "wlanloginwebpage.h"
       
    25 
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "wlanloginwebpageTraces.h"
       
    29 #endif
       
    30 
       
    31 /*!
       
    32     \class WlanLoginWebPage
       
    33     \brief WLAN Login web page class implementation.
       
    34 */
       
    35 
       
    36 // External function prototypes
       
    37 
       
    38 // Local constants
       
    39 
       
    40 // ======== LOCAL FUNCTIONS ========
       
    41 
       
    42 // ======== MEMBER FUNCTIONS ========
       
    43 
       
    44 
       
    45 /*!
       
    46     Constructor.
       
    47  */
       
    48 WlanLoginWebPage::WlanLoginWebPage(QObject *parent): QWebPage(parent)
       
    49 {
       
    50     OstTraceFunctionEntry0( WLANLOGINWEBPAGE_WLANLOGINWEBPAGE_ENTRY );
       
    51 
       
    52     //Hide scrollbars
       
    53     mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff );
       
    54     mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff );
       
    55 
       
    56     setContentEditable(false);
       
    57     
       
    58     OstTraceFunctionExit0( WLANLOGINWEBPAGE_WLANLOGINWEBPAGE_EXIT );
       
    59 }
       
    60 
       
    61 
       
    62 WlanLoginWebPage::~WlanLoginWebPage()
       
    63 {
       
    64     OstTraceFunctionEntry0( WLANLOGINWEBPAGE_DESTRUCTOR_ENTRY );
       
    65 
       
    66     OstTraceFunctionExit0( WLANLOGINWEBPAGE_DESTRUCTOR_EXIT );
       
    67 }
       
    68 
       
    69 
       
    70 /*!
       
    71     This function checks navigation events. This was rewritten as we needed
       
    72     indication to login view when user has submitted the password and user name. That 
       
    73     corresponds to value QWebPage::NavigationTypeFormSubmitted. This triggers starting of
       
    74     internet connectivity test.
       
    75     
       
    76     @param [in] frame
       
    77     @param [in] request
       
    78     @param [in] type
       
    79  */
       
    80 bool WlanLoginWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
       
    81 {
       
    82     OstTraceFunctionEntry0( WLANLOGINWEBPAGE_ACCEPTNAVIGATIONREQUEST_ENTRY );
       
    83     
       
    84     if (type== QWebPage::NavigationTypeFormSubmitted) {
       
    85     
       
    86     OstTrace0(
       
    87         TRACE_BORDER,
       
    88         WLANLOGINWEBPAGE_ACCEPTNAVIGATIONREQUEST_EMITTING_TRACE,
       
    89         "WlanLoginWebPage::acceptNavigationRequest emitting formSubmitted() signal");
       
    90     
       
    91         emit formSubmitted();
       
    92     }
       
    93    
       
    94     OstTraceFunctionExit0( WLANLOGINWEBPAGE_ACCEPTNAVIGATIONREQUEST_EXIT );
       
    95     
       
    96     return QWebPage::acceptNavigationRequest(frame,request,type);
       
    97 }