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