wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp
branchRCL_3
changeset 25 f28ada11abbf
parent 24 63be7eb3fc78
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
     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 * WLAN Entry plugin implementation.
       
    16 */
       
    17 
       
    18 // System includes
       
    19 
       
    20 #include <QApplication>
       
    21 #include <HbTranslator>
       
    22 #include "qsysteminfo.h"
       
    23 
       
    24 // User includes
       
    25 
       
    26 #include "cpwlanentryitemdata.h"
       
    27 #include "cpwlanentryplugin.h"
       
    28 
       
    29 #include "OstTraceDefinitions.h"
       
    30 #ifdef OST_TRACE_COMPILER_IN_USE
       
    31 #include "cpwlanentrypluginTraces.h"
       
    32 #endif
       
    33 
       
    34 using namespace QtMobility;
       
    35 
       
    36 /*!
       
    37     \class CpWlanEntryPlugin
       
    38     \brief CpWlanEntryPlugin implements the WLAN Status Control Panel Plugin
       
    39     that shows the current WLAN status.
       
    40 */
       
    41 
       
    42 // External function prototypes
       
    43 
       
    44 // Local constants
       
    45 
       
    46 // ======== LOCAL FUNCTIONS ========
       
    47 
       
    48 // ======== MEMBER FUNCTIONS ========
       
    49 
       
    50 /*!
       
    51     Constructor.
       
    52 */
       
    53 
       
    54 CpWlanEntryPlugin::CpWlanEntryPlugin() :
       
    55     QObject(),
       
    56     mWlanSupported(false),
       
    57     mTranslator()
       
    58 {
       
    59     OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY);
       
    60     
       
    61     // Check & store WLAN dynamic configuration
       
    62     QtMobility::QSystemInfo sysinfo;
       
    63     mWlanSupported = sysinfo.hasFeatureSupported(QSystemInfo::WlanFeature);
       
    64     
       
    65     if (mWlanSupported) {
       
    66         // Install localization
       
    67         mTranslator = QSharedPointer<HbTranslator>(
       
    68             new HbTranslator("wlanentryplugin"));
       
    69     }
       
    70     
       
    71     OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT);
       
    72 }
       
    73 
       
    74 /*!
       
    75     Destructor.
       
    76 */
       
    77 
       
    78 CpWlanEntryPlugin::~CpWlanEntryPlugin()
       
    79 {
       
    80     OstTraceFunctionEntry0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY);
       
    81     OstTraceFunctionExit0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT);
       
    82 }
       
    83 
       
    84 /*!
       
    85     Plugin function for creating the entry plugin form item data.
       
    86     
       
    87     @param [in,out] itemDataHelper Control Panel item data helper.
       
    88 */
       
    89 
       
    90 QList<CpSettingFormItemData *> CpWlanEntryPlugin::createSettingFormItemData(
       
    91     CpItemDataHelper &itemDataHelper) const
       
    92 {
       
    93     OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY);
       
    94     
       
    95     QList<CpSettingFormItemData *> settingFormData;
       
    96     
       
    97     // The plugin is disabled if WLAN is not supported by the product.
       
    98     if (mWlanSupported) {
       
    99         settingFormData.append(new CpWlanEntryItemData(itemDataHelper));
       
   100     }
       
   101 
       
   102     OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_EXIT);
       
   103     return settingFormData;
       
   104 }
       
   105 
       
   106 Q_EXPORT_PLUGIN2(cpwlanentryplugin, CpWlanEntryPlugin);