qtmobility/tests/networkmanager/nmview.h
changeset 11 06b8e2af4411
parent 8 71781823f776
child 14 6fbed849b4f4
equal deleted inserted replaced
8:71781823f776 11:06b8e2af4411
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include <QWidget>
       
    43 #include <QDBusConnection>
       
    44 #include <qnetworkconfigmanager.h>
       
    45 #include <qnetworksession.h>
       
    46 #include <qnetworkconfiguration.h>
       
    47 
       
    48 #include "ui_dialog.h"
       
    49 
       
    50 QTM_USE_NAMESPACE
       
    51 
       
    52 QT_BEGIN_NAMESPACE
       
    53 class QListWidget;
       
    54 class QTreeWidget;
       
    55 class QTreeWidgetItem;
       
    56 QT_END_NAMESPACE
       
    57 
       
    58 class NMView : public QDialog, private Ui::Dialog
       
    59 {
       
    60     Q_OBJECT
       
    61 public:
       
    62     NMView(QDialog* parent = 0);
       
    63     virtual ~NMView();
       
    64 
       
    65 private:
       
    66     void init();
       
    67     QString stateString;
       
    68 
       
    69     QDBusConnection dbc;
       
    70     void printConnectionDetails(const QString&);
       
    71 
       
    72     QString deviceStateToString(int state);
       
    73     QString deviceTypeToString(int device);
       
    74     QString securityCapabilitiesToString(int caps);
       
    75     QString deviceModeToString(int mode);
       
    76 //QDBusInterface getInterface();
       
    77     QNetworkConfigurationManager *manager;
       
    78     QNetworkSession *sess;
       
    79     QString stateToString(int state);
       
    80     QString typeToString(int type);
       
    81 
       
    82 private slots:
       
    83     void update();
       
    84     void deactivate();
       
    85     void activate();
       
    86     void getActiveConnections();
       
    87     void updateConnections();
       
    88     void getDevices();
       
    89  //   void readConnectionManagerDetails();
       
    90     void getNetworkDevices();
       
    91     void connectionItemActivated( QTreeWidgetItem *, int);
       
    92 //    void activeItemActivated( QListWidgetItem *);
       
    93     void deviceItemActivated( QTreeWidgetItem *, int);
       
    94     void netconfig();
       
    95     void findAccessPoints();
       
    96 
       
    97     void netManagerState(quint32);
       
    98     void readSettings();
       
    99     void updateCompleted();
       
   100     void newConfigurationActivated();
       
   101 
       
   102     void stateChanged(QNetworkSession::State);
       
   103     void deviceStateChanged(quint32 state);
       
   104 
       
   105     void configurationAdded(const QNetworkConfiguration &config);
       
   106     void aPPropertiesChanged( QMap<QString,QVariant> map);
       
   107     void networkSessionError(QNetworkSession::SessionError);
       
   108 
       
   109 };