wlanutilities/wpswizard/src/wpswizardstepthreebutton.cpp
changeset 38 2dc6da6fb431
parent 29 dbe86d96ce5b
child 41 a87deff717bc
child 45 d9ec2b8c6bad
equal deleted inserted replaced
29:dbe86d96ce5b 38:2dc6da6fb431
     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 the License "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  *   WPS Wizard Page: Step 3 Push button number
       
    16  *
       
    17  */
       
    18 
       
    19 // System includes
       
    20 #include <hbdocumentloader.h>
       
    21 #include <hbwidget.h>
       
    22 #include <hbradiobuttonlist.h>
       
    23 #include <hblineedit.h>
       
    24 #include <hblabel.h>
       
    25 
       
    26 // User includes
       
    27 #include "wpswizardstepthreebutton.h"
       
    28 #include "wpswizard_p.h"
       
    29 
       
    30 // Trace includes
       
    31 #include "OstTraceDefinitions.h"
       
    32 #ifdef OST_TRACE_COMPILER_IN_USE
       
    33 #include "wpspagestepthreebuttonTraces.h"
       
    34 #endif
       
    35 
       
    36 
       
    37 /*!
       
    38  * Constructor for WPS page three button
       
    39  * 
       
    40  * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation 
       
    41  */
       
    42 WpsPageStepThreeButton::WpsPageStepThreeButton(WpsWizardPrivate* parent) :
       
    43     WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(true)
       
    44 {
       
    45 OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this)
       
    46 OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this)
       
    47 
       
    48 }
       
    49 
       
    50 /*!
       
    51  * Destructor
       
    52  */
       
    53 WpsPageStepThreeButton::~WpsPageStepThreeButton()
       
    54 {
       
    55     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this)
       
    56 
       
    57     delete mWidget;
       
    58 
       
    59 OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this)
       
    60 }
       
    61 
       
    62 /*!
       
    63   * Loads the page with all the widgets
       
    64   * 
       
    65   * \return HbWidget* Returns the view widget
       
    66  */
       
    67 HbWidget* WpsPageStepThreeButton::initializePage()
       
    68 {
       
    69     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_ENTRY, this)
       
    70 
       
    71     if (!mWidget) {
       
    72         bool ok;
       
    73         HbDocumentLoader loader;
       
    74         loader.load(":/docml/occ_wps_P2.docml", &ok);
       
    75         Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file");
       
    76 
       
    77         mWidget = qobject_cast<HbWidget*> (loader.findWidget("occ_wps_P2"));
       
    78         Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
       
    79 
       
    80         //mTitle = qobject_cast<HbLabel*> (loader.findWidget("label_title"));
       
    81         //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found");
       
    82 
       
    83         mHeading = qobject_cast<HbLabel*> (loader.findWidget("label_heading"));
       
    84         Q_ASSERT_X(mHeading != 0, "WPS wizard", "Header not found");
       
    85 
       
    86         mWizard->enableNextButton(true);
       
    87     }
       
    88     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_EXIT, this)
       
    89 
       
    90     return mWidget;
       
    91 }
       
    92 
       
    93 /*!
       
    94   * Funtion to determine the next page to be displayed in the wizard process
       
    95   * 
       
    96   * \param bool& RemoveFromStack indicating whether the current page should be 
       
    97   * removed from the stack
       
    98   * 
       
    99   * \return int Page Id of the next page to be displayed.
       
   100  */
       
   101 int WpsPageStepThreeButton::nextId(bool &removeFromStack) const
       
   102 {
       
   103     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_NEXTID_ENTRY, this)
       
   104     int id = WlanWizardPage::PageNone;
       
   105     removeFromStack = false;
       
   106     id = WpsWizardPage::PageWpsWizardStep4;
       
   107     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_NEXTID_EXIT, this)
       
   108 
       
   109     return id;
       
   110 }
       
   111 
       
   112 /*!
       
   113  * Determines the Number of steps to move backwards when 'Prev' Button
       
   114  * is clicked
       
   115  * 
       
   116  * \return int Number of pages to move backwards
       
   117 */
       
   118 int WpsPageStepThreeButton::stepsBackwards()
       
   119 {
       
   120     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_STEPSBACKWARDS_ENTRY, this)
       
   121     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_STEPBACKWARDS_EXIT, this)
       
   122 
       
   123     return (PageWpsWizardStep3_Button - PageWpsWizardStep2);
       
   124 }
       
   125 
       
   126 /*!
       
   127   * Callback when the previous button is clicked
       
   128  */
       
   129 void WpsPageStepThreeButton::previousTriggered()
       
   130 {
       
   131 OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_ENTRY, this)
       
   132 OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_EXIT, this)
       
   133 
       
   134 }
       
   135 
       
   136 /*!
       
   137   * CallBack when the cancel button is clicked
       
   138  */
       
   139 void WpsPageStepThreeButton::cancelTriggered()
       
   140 {
       
   141 OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_CANCELTRIGGERED_ENTRY, this)
       
   142 OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_CANCELTRIGGERED_EXIT, this)
       
   143 
       
   144 }
       
   145 
       
   146 /*!
       
   147  * Validates the content of the pages
       
   148  * 
       
   149  * \return bool Indicating the result of the operation
       
   150 */
       
   151 bool WpsPageStepThreeButton::validate() const
       
   152 {
       
   153     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_VALIDATE_ENTRY, this)
       
   154     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_VALIDATE_EXIT, this)
       
   155 
       
   156     return mValid;
       
   157 }
       
   158