qtmobility/tests/bearerex/bearerex.h
changeset 0 cfcbf08528c4
child 4 90517678cc4f
equal deleted inserted replaced
-1:000000000000 0:cfcbf08528c4
       
     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 #ifndef ACCESSPOINTMANAGEREX_H
       
    42 #define ACCESSPOINTMANAGEREX_H
       
    43 
       
    44 #include <QtGui>
       
    45 
       
    46 #include "ui_bearerex.h"
       
    47 #include "ui_detailedinfodialog.h"
       
    48 #include "ui_sessiondialog.h"
       
    49 
       
    50 #include "qnetworkconfigmanager.h"
       
    51 #include "qnetworksession.h"
       
    52 #include "xqlistwidget.h"
       
    53 
       
    54 QT_BEGIN_NAMESPACE
       
    55 class QHttp;
       
    56 QT_END_NAMESPACE
       
    57 
       
    58 class SessionTab;
       
    59 
       
    60 QTM_USE_NAMESPACE
       
    61 
       
    62 class BearerEx : public QMainWindow, public Ui::BearerExMainWindow
       
    63 {
       
    64      Q_OBJECT
       
    65 
       
    66 public:
       
    67     BearerEx(QWidget* parent = 0);
       
    68     void createMenus();
       
    69     void showConfigurations();
       
    70 
       
    71 private Q_SLOTS:
       
    72     void on_updateConfigurationsButton_clicked();
       
    73     void on_updateListButton_clicked();
       
    74     void on_showDetailsButton_clicked();
       
    75     void on_createSessionButton_clicked();
       
    76     void on_clearEventListButton_clicked();
       
    77 
       
    78     void configurationsUpdateCompleted();
       
    79     void configurationAdded(const QNetworkConfiguration& config);
       
    80     void configurationRemoved(const QNetworkConfiguration& config);
       
    81     void onlineStateChanged(bool isOnline);
       
    82     void configurationChanged(const QNetworkConfiguration & config);     
       
    83 
       
    84 private:
       
    85     QNetworkConfigurationManager m_NetworkConfigurationManager;
       
    86     QAction* m_openAction;
       
    87 };
       
    88 
       
    89 class DetailedInfoDialog : public QDialog, public Ui::DetailedInfoDialog
       
    90 {
       
    91     Q_OBJECT
       
    92 
       
    93 public:
       
    94     DetailedInfoDialog(QNetworkConfiguration* apNetworkConfiguration = 0, QWidget* parent = 0);
       
    95 };
       
    96 
       
    97 
       
    98 class SessionTab : public QWidget, public Ui::SessionTab
       
    99 {
       
   100     Q_OBJECT
       
   101 
       
   102 public:
       
   103     SessionTab(QNetworkConfiguration* apNetworkConfiguration = 0, QNetworkConfigurationManager* configManager = 0,
       
   104                QListWidget* eventListWidget = 0,  int index = 0, BearerEx* parent = 0);
       
   105     ~SessionTab();
       
   106     
       
   107     QString stateString(QNetworkSession::State state);    
       
   108 
       
   109 private Q_SLOTS:
       
   110     void on_createQHttpButton_clicked();
       
   111     void on_sendRequestButton_clicked();
       
   112     void on_openSessionButton_clicked();
       
   113     void on_closeSessionButton_clicked();
       
   114     void on_stopConnectionButton_clicked();
       
   115     void on_deleteSessionButton_clicked();
       
   116     void on_alrButton_clicked();
       
   117     void done(bool error);
       
   118     
       
   119     void newConfigurationActivated();
       
   120     void preferredConfigurationChanged(const QNetworkConfiguration& config, bool isSeamless);
       
   121     void stateChanged(QNetworkSession::State state);
       
   122     void newState(QNetworkSession::State state);
       
   123     void opened();
       
   124     void closed();
       
   125     void error(QNetworkSession::SessionError error);
       
   126 
       
   127 private: //data
       
   128     QHttp* m_http;
       
   129     QNetworkSession* m_NetworkSession;
       
   130     QNetworkConfigurationManager* m_ConfigManager;
       
   131     QListWidget* m_eventListWidget;
       
   132     QNetworkConfiguration m_config;
       
   133     int m_index;
       
   134     bool m_httpRequestOngoing;
       
   135     bool m_alrEnabled;
       
   136 };
       
   137 
       
   138 #endif // ACCESSPOINTMANAGEREX_H
       
   139 
       
   140 // End of file
       
   141