phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkpluginform.h
changeset 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     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  *
       
    16  */
       
    17 
       
    18 #ifndef CPNETWORKPLUGINFORM_H
       
    19 #define CPNETWORKPLUGINFORM_H
       
    20 
       
    21 #include <hbdataform.h>
       
    22 #include <QStringList>
       
    23 #include <psetnetworkwrapper.h>
       
    24 #include <hbmessagebox.h>
       
    25 
       
    26 class HbDataFormModelItem;
       
    27 class CpSettingsWrapper;
       
    28 class PSetWrapper;
       
    29 class HbListWidget;
       
    30 class PSetNetworkWrapper;
       
    31 class CpSettingFormItemData;
       
    32 class CpPhoneNotes;
       
    33 
       
    34 class CpNetworkPluginForm : public HbDataForm
       
    35 {
       
    36     Q_OBJECT
       
    37     
       
    38 public:
       
    39     
       
    40     explicit CpNetworkPluginForm(QGraphicsItem *parent = 0);
       
    41     
       
    42     virtual ~CpNetworkPluginForm();
       
    43     
       
    44 signals:
       
    45     
       
    46     void showGlobalProgressNote(int &noteId, const QString& text);
       
    47     void showGlobalNote(
       
    48         int &noteId, const QString& text, HbMessageBox::MessageBoxType msgBoxType);
       
    49     void cancelNote(int noteId);
       
    50 
       
    51 public slots: 
       
    52 
       
    53     void networkModeStateChanged(int index);
       
    54     void operatorSelectionStateChanged(bool index);
       
    55     void networkAccessModeGot(int mode);
       
    56     void availableNetworksGot(
       
    57         QList<PSetNetworkWrapper::NetworkInfo*> &m_networkInfoList);
       
    58     void networkReqestFailed(
       
    59         PSetNetworkWrapper::ErrorCode error, 
       
    60         PSetNetworkWrapper::RequestType type);
       
    61     void userCancel();
       
    62     void handleSearchingNetworks(PSetNetworkWrapper::RequestType &type);
       
    63     void handleRequestingSelectedNetwork(bool ongoing);
       
    64     void handleNetworkChanged(
       
    65         PSetNetworkWrapper::NetworkInfo& currentInfo,
       
    66         PSetNetworkWrapper::RegistrationStatus& status);
       
    67 
       
    68 private:     
       
    69     HbDataFormModelItem *createNetworkModeItem();
       
    70     HbDataFormModelItem *createOperatorSelectionItem();
       
    71     
       
    72     void automaticOperatorSelection();
       
    73     void manualOperatorSelection();
       
    74     
       
    75     void dualModeSelection();
       
    76     void umtsSelection();
       
    77     void gsmSelection();
       
    78     
       
    79     HbDialog* createDialog(const QString& heading) const;
       
    80     void addItemToListWidget(
       
    81         HbListWidget* w, const QString& item, const int& data) const;
       
    82     
       
    83     void showManualSeletiondialog();
       
    84     void restoreUiSelection();
       
    85     QString networkName(PSetNetworkWrapper::NetworkInfo &info);
       
    86 
       
    87     void connectToNetworkWrapper(PSetNetworkWrapper &wrapper);
       
    88     
       
    89     void connectToPhoneNotes(CpPhoneNotes &notes);
       
    90     
       
    91     bool isPhoneOnLine();
       
    92     
       
    93 private:
       
    94     
       
    95     QStringList mNetworkModeOptions;
       
    96     QStringList mOperatorSelectionOptions;
       
    97     int m_activeNoteId;
       
    98     int m_activeProgressNoteId;
       
    99     // Own
       
   100     PSetWrapper *m_pSetWrapper;
       
   101     CpSettingsWrapper *m_cpSettingsWrapper;
       
   102     
       
   103     // Not own
       
   104     PSetNetworkWrapper *m_psetNetworkWrapper;
       
   105     CpSettingFormItemData *m_NetworkModeOptionsItemData;
       
   106     CpSettingFormItemData *m_NetworkOperatorSelectionItemData;
       
   107     QList<PSetNetworkWrapper::NetworkInfo*> *m_networkInfoList;
       
   108 };
       
   109 
       
   110 #endif  // CPNETWORKPLUGINFORM_H