wlanutilities/wlanwizard/inc/wlanwizardhelper.h
changeset 38 2dc6da6fb431
child 39 7b3e49e4608a
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 "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 *   WLAN Wizard Plugin API: Interface for plugins to wizard services.
       
    16 */
       
    17 
       
    18 #ifndef WLANWIZARDHELPER_H
       
    19 #define WLANWIZARDHELPER_H
       
    20 
       
    21 // System includes
       
    22 #include <cmmanagerdefines_shim.h>
       
    23 
       
    24 // User includes
       
    25 
       
    26 // Forward declarations
       
    27 class HbMainWindow;
       
    28 class HbWidget;
       
    29 class WlanWizardPage;
       
    30 
       
    31 // External data types
       
    32 
       
    33 // Constants
       
    34 
       
    35 /*!
       
    36  * @addtogroup group_wlan_wizard_api_internal
       
    37  * @{
       
    38  */
       
    39 
       
    40 /*!
       
    41    This class specifies the interface class that wizard plugins (EAP and WPS) 
       
    42    can use to access wizard framework services.
       
    43  */
       
    44 class WlanWizardHelper
       
    45 {
       
    46 public:
       
    47     /*!
       
    48         WLAN Wizard configuration, which are accessible by wlan wizard and it's 
       
    49         plugins. WLAN wizard pages uses this information to store configurations
       
    50         from ui and state events.
       
    51         
       
    52         Please remember to update trace.properties upon changes.
       
    53      */
       
    54     enum ConfigurationId {
       
    55         //! QString: WLAN Network name (aka SSID)
       
    56         ConfSsid = 0,
       
    57         //! int: CMManagerShim::WlanConnectionMode
       
    58         ConfNetworkMode = 1,
       
    59         //! int: CMManagerShim::WlanSecMode
       
    60         ConfSecurityMode = 2,
       
    61         //! QString: WPA PSK
       
    62         ConfKeyWpa = 3,
       
    63         //! QString: WEP Key 1
       
    64         ConfKeyWep1 = 4,
       
    65         //! QString: WEP Key 2
       
    66         ConfKeyWep2 = 5,
       
    67         //! QString: WEP Key 3
       
    68         ConfKeyWep3 = 6,
       
    69         //! QString: WEP Key 4
       
    70         ConfKeyWep4 = 7,
       
    71         //! int: CMManagerShim:::WlanWepKeyIndex, Default WEP Key index
       
    72         ConfKeyWepDefault = 8,
       
    73         //! bool: Internet Connectivity Test result, true passed.
       
    74         ConfIctStatus = 9,
       
    75         //! int, -1 (WlanQtUtils::IapIdNone): not defined: IAP ID
       
    76         ConfIapId = 10,
       
    77         //! bool: true if connection was established successfully
       
    78         ConfConnected = 11,
       
    79         //! bool: if true hidden WLAN
       
    80         ConfHiddenWlan = 12,
       
    81         //! bool: if true use psk, if false use EAP 
       
    82         ConfUsePsk = 13,
       
    83         //! bool: if true processing connection page is required.
       
    84         ConfProcessSettings = 14,
       
    85         //! QString: Localized error string for WlanWizardPageGenericError
       
    86         ConfGenericErrorString = 15,
       
    87     };
       
    88     
       
    89 public:
       
    90     
       
    91     /*!
       
    92        Reader method for wlan configurations.
       
    93        
       
    94        See ConfigurationId for further details about the data types in QVariant.
       
    95        
       
    96        @param [in] confId Defines what configuration is read.
       
    97        
       
    98        @return configuration value.
       
    99      */
       
   100     virtual QVariant configuration(ConfigurationId confId) const = 0;
       
   101     
       
   102     /*!
       
   103        Sets wlan configuration value for given configuration identifier.
       
   104        See ConfigurationId for further details about the data types in QVariant.
       
   105        
       
   106        @param [in] confId Configuration Identifier do to be set
       
   107        @param [in] value  Value for configuration.
       
   108      */
       
   109     virtual void setConfiguration(
       
   110         ConfigurationId confId, 
       
   111         const QVariant &value) = 0;
       
   112     
       
   113     /*!
       
   114        Enables the next button in wizard.
       
   115        
       
   116        @param [in] enable to enable button set to true.
       
   117      */
       
   118     virtual void enableNextButton(bool enable) = 0;
       
   119 
       
   120     /*!
       
   121        Enables the previous button in wizard.
       
   122        
       
   123        @param [in] enable to enable button set to true.
       
   124      */
       
   125     virtual void enablePrevButton(bool enable) = 0;
       
   126 
       
   127     /*!
       
   128        Adds a new wizard page into the wizard framework.
       
   129        
       
   130        @param [in] pageId The identifier of Page. See WlanWizardPage::PageIds.
       
   131        @param [in] page New wizard page.
       
   132      */
       
   133     virtual void addPage(int pageId, WlanWizardPage *page) = 0;
       
   134 
       
   135     /*!
       
   136        Triggers movement to the next page.
       
   137        
       
   138        @note This operation has been protected with 1.5 second timer to prevent
       
   139        too short lasting pages.
       
   140        
       
   141        @note Must be used with WlanWizardPage::startOperation().
       
   142      */
       
   143     virtual void nextPage() = 0;
       
   144     
       
   145     /*!
       
   146        @return the main window of wizard.
       
   147      */
       
   148     virtual HbMainWindow *mainWindow() const = 0;
       
   149     
       
   150     /*!
       
   151        Checks if provided page visualization is the current visible page.
       
   152        
       
   153        @param [in] page Wizard Page visualization to be checked
       
   154        
       
   155        @return true if the page is currently visible.
       
   156      */
       
   157     virtual bool isCurrentPage(const HbWidget *page) const = 0;
       
   158 
       
   159     /*!
       
   160        Can be used to get correct page id based on the existing configuration.
       
   161        
       
   162        This method can be used in so called entry points to wizards
       
   163        - WLAN Wizard has been lauched and setParameters() has been called
       
   164        - WLAN Wizard makes own internal scanning
       
   165        - WPS Wizard uses manual configuration mode.
       
   166        
       
   167        @param [in] useWps true: if WPS Wizard needs to be opened, false: otherwise
       
   168        
       
   169        @return Page Id based on configurations:
       
   170        - WEP/WPA(2) with PSK: WlanWizardPageInternal::PageKeyQuery
       
   171        - Open: WlanWizardPage::PageProcessSettings
       
   172        - 802.1x or WPA (2) with EAP: WlanWizardPage::PageEapStart
       
   173        - UseWps: WlanWizardPage::PageWpsStart
       
   174      */
       
   175     virtual int nextPageId(bool useWps) = 0;
       
   176     
       
   177 signals:
       
   178     
       
   179 public slots:
       
   180     
       
   181 protected:
       
   182 
       
   183 protected slots:
       
   184 
       
   185 private:
       
   186 
       
   187 private slots:
       
   188 
       
   189 private: // data
       
   190 };
       
   191 
       
   192 /*! @} */
       
   193 
       
   194 #endif // WLANWIZARDHELPER_H