wlanutilities/wpswizard/src/wpswizardstepthreebutton.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  *   WPS Wizard Page: Step 3 Push button number
       
    16  *
       
    17  */
       
    18 
       
    19 // System includes
       
    20 #include <HbDocumentLoader>
       
    21 #include <HbWidget>
       
    22 #include <HbRadioButtonList>
       
    23 #include <HbLineEdit>
       
    24 #include <HbLabel>
       
    25 #include <HbMainwindow>
       
    26 
       
    27 // User includes
       
    28 #include "wpswizardstepthreebutton.h"
       
    29 #include "wpswizard_p.h"
       
    30 
       
    31 // Trace includes
       
    32 #include "OstTraceDefinitions.h"
       
    33 #ifdef OST_TRACE_COMPILER_IN_USE
       
    34 #include "wpswizardstepthreebuttonTraces.h"
       
    35 #endif
       
    36 
       
    37 // External function prototypes
       
    38 
       
    39 // Local constants
       
    40 
       
    41 /*!
       
    42    \class WpsPageStepThreeButton
       
    43    \brief Implementation of wps wizard page for step three button press mode.
       
    44  */
       
    45 
       
    46 // ======== LOCAL FUNCTIONS ========
       
    47 
       
    48 // ======== MEMBER FUNCTIONS ========
       
    49 
       
    50 /*!
       
    51    Constructor for WPS page three button
       
    52    
       
    53    @param [in] parent Pointer to the WPS wizard private implementation 
       
    54  */
       
    55 WpsPageStepThreeButton::WpsPageStepThreeButton(WpsWizardPrivate* parent) :
       
    56     WpsWizardPage(parent), 
       
    57     mWidget(NULL), 
       
    58     mHeading(NULL),
       
    59     mLoader(NULL)
       
    60 {
       
    61     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this); 
       
    62     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this);
       
    63 
       
    64 }
       
    65 
       
    66 /*!
       
    67    Destructor
       
    68  */
       
    69 WpsPageStepThreeButton::~WpsPageStepThreeButton()
       
    70 {
       
    71     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_DESTRUCTOR_ENTRY, this);
       
    72     delete mLoader;
       
    73     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_DESTRUCTOR_EXIT, this);
       
    74 }
       
    75 
       
    76 /*!
       
    77    Loads the page with all the widgets
       
    78    
       
    79    @return HbWidget* Returns the view widget
       
    80  */
       
    81 HbWidget* WpsPageStepThreeButton::initializePage()
       
    82 {
       
    83     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_ENTRY, this);
       
    84 
       
    85     if (!mWidget) {
       
    86         bool ok;
       
    87         mLoader = new HbDocumentLoader(mWizard->mainWindow());
       
    88         
       
    89         mLoader->load(":/docml/occ_wps_02_03.docml", &ok);
       
    90         Q_ASSERT(ok);
       
    91         
       
    92         mWidget = qobject_cast<HbWidget*> (mLoader->findWidget("occ_wps_P2"));
       
    93         Q_ASSERT(mWidget);
       
    94 
       
    95         mHeading = qobject_cast<HbLabel*> (mLoader->findWidget("label_heading"));
       
    96         Q_ASSERT(mHeading);
       
    97         
       
    98         mHeading->setPlainText(hbTrId("txt_occ_dialog_first_press_button_on_the_wireless"));
       
    99     } 
       
   100     
       
   101     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_EXIT, this);
       
   102     return mWidget;
       
   103 }
       
   104 
       
   105 /*!
       
   106    Funtion to determine the next page to be displayed in the wizard process
       
   107    
       
   108    @param [out] removeFromStack bool indicating whether the current page should be 
       
   109    removed from the stack
       
   110    
       
   111    @return int Page Id of the next page to be displayed.
       
   112  */
       
   113 int WpsPageStepThreeButton::nextId(bool &removeFromStack) const
       
   114 {
       
   115     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_NEXTID_ENTRY, this);
       
   116     removeFromStack = false;
       
   117     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_NEXTID_EXIT, this);
       
   118 
       
   119     return WpsWizardPage::PageWpsWizardStep4;
       
   120 }
       
   121 
       
   122 /*!
       
   123    Determines the Number of steps to move backwards when 'Prev' Button
       
   124    is clicked
       
   125    
       
   126    @return int Number of pages to move backwards
       
   127  */
       
   128 int WpsPageStepThreeButton::previousTriggered()
       
   129 {
       
   130     OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_ENTRY, this); 
       
   131     OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_EXIT, this);
       
   132     return (PageWpsWizardStep3_Button - PageWpsWizardStep2);
       
   133 }
       
   134 
       
   135 
       
   136