wlanutilities/wlanwizard/inc/wlanwizardhelper.h
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 *   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: WLAN AP explicit scanning need
       
    80         ConfWlanScanSSID = 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         //! WlanWizardScanList: Available network options
       
    88         ConfAvailableNetworkOptions = 16,
       
    89         //! bool: Wps supported
       
    90         ConfWpsSupported = 17,
       
    91         //! int: Identifies how many steps should be gone backwards from 
       
    92         // GenericErrorPage
       
    93         ConfGenericErrorPageStepsBackwards = 18,
       
    94     };
       
    95     
       
    96 public:
       
    97     
       
    98     /*!
       
    99        Reader method for wlan configurations.
       
   100        
       
   101        See ConfigurationId for further details about the data types in QVariant.
       
   102        
       
   103        @param [in] confId Defines what configuration is read.
       
   104        
       
   105        @return configuration value.
       
   106      */
       
   107     virtual QVariant configuration(ConfigurationId confId) const = 0;
       
   108     
       
   109     /*!
       
   110        Sets wlan configuration value for given configuration identifier.
       
   111        See ConfigurationId for further details about the data types in QVariant.
       
   112        
       
   113        @param [in] confId Configuration Identifier do to be set
       
   114        @param [in] value  Value for configuration.
       
   115      */
       
   116     virtual void setConfiguration(
       
   117         ConfigurationId confId, 
       
   118         const QVariant &value) = 0;
       
   119     
       
   120     /*!
       
   121      * Clears wlan configuration at the given configuration identifier and sets
       
   122      * the configuration value to type Invalid.
       
   123      * 
       
   124      * @param [in] confId Configuration Identifier do to be cleared
       
   125      */
       
   126     virtual void clearConfiguration(ConfigurationId confId) = 0;
       
   127     
       
   128     /*!
       
   129      * Tests whether a configuration has been set.
       
   130      * 
       
   131      * @param [in] confId Configuration Identifier do to be tested
       
   132      * @return true if configuration value != Invalid, else false.
       
   133      */
       
   134     virtual bool configurationExists(ConfigurationId confId) = 0;
       
   135     
       
   136     /*!
       
   137        Enables the next button in wizard.
       
   138        
       
   139        @param [in] enable to enable button set to true.
       
   140      */
       
   141     virtual void enableNextButton(bool enable) = 0;
       
   142 
       
   143     /*!
       
   144        Adds a new wizard page into the wizard framework.
       
   145        
       
   146        @param [in] pageId The identifier of Page. See WlanWizardPage::PageIds.
       
   147        @param [in] page New wizard page.
       
   148      */
       
   149     virtual void addPage(int pageId, WlanWizardPage *page) = 0;
       
   150 
       
   151     /*!
       
   152        Triggers movement to the next page.
       
   153        
       
   154        @note This operation has been protected with 1.5 second timer to prevent
       
   155        too short lasting pages.
       
   156        
       
   157        @note Must be used with WlanWizardPage::startOperation().
       
   158      */
       
   159     virtual void nextPage() = 0;
       
   160     
       
   161     /*!
       
   162        @return the main window of wizard.
       
   163      */
       
   164     virtual HbMainWindow *mainWindow() const = 0;
       
   165     
       
   166     /*!
       
   167        Checks if provided page visualization is the current visible page.
       
   168        
       
   169        @param [in] page Wizard Page visualization to be checked
       
   170        
       
   171        @return true if the page is currently visible.
       
   172      */
       
   173     virtual bool isCurrentPage(const HbWidget *page) const = 0;
       
   174 
       
   175     /*!
       
   176        Can be used to get correct page id based on the existing configuration.
       
   177        
       
   178        This method can be used in so called entry points to wizards
       
   179        - WLAN Wizard has been lauched and setParameters() has been called
       
   180        - WLAN Wizard makes own internal scanning
       
   181        - WPS Wizard uses manual configuration mode.
       
   182        
       
   183        @param [in] useWps true: if WPS Wizard needs to be opened, false: otherwise
       
   184        
       
   185        @return Page Id based on configurations:
       
   186        - WEP/WPA(2) with PSK: WlanWizardPageInternal::PageKeyQuery
       
   187        - Open: WlanWizardPage::PageProcessSettings
       
   188        - 802.1x or WPA (2) with EAP: WlanWizardPage::PageEapStart
       
   189        - UseWps: WlanWizardPage::PageWpsStart
       
   190      */
       
   191     virtual int nextPageId(bool useWps) = 0;
       
   192     
       
   193 signals:
       
   194     
       
   195 public slots:
       
   196     
       
   197 protected:
       
   198 
       
   199 protected slots:
       
   200 
       
   201 private:
       
   202 
       
   203 private slots:
       
   204 
       
   205 private: // data
       
   206 };
       
   207 
       
   208 /*! @} */
       
   209 
       
   210 #endif // WLANWIZARDHELPER_H