qtmobility/tests/bearerex/bearerex.h
branchRCL_3
changeset 10 cd2778e5acfe
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
       
     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 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_detailedinfodialog.h"
       
    47 
       
    48 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
       
    49 #include "ui_bearerex_maemo.h"
       
    50 #include "ui_sessiondialog_maemo.h"
       
    51 #else
       
    52 #include "ui_bearerex.h"
       
    53 #include "ui_sessiondialog.h"
       
    54 #endif
       
    55 #include "qnetworkconfigmanager.h"
       
    56 #include "qnetworksession.h"
       
    57 #include "datatransferer.h"
       
    58 #include "xqlistwidget.h"
       
    59 
       
    60 QT_BEGIN_NAMESPACE
       
    61 class QNetworkAccessManager;
       
    62 class QNetworkReply;
       
    63 QT_END_NAMESPACE
       
    64 
       
    65 class SessionTab;
       
    66 class DataTransferer;
       
    67 
       
    68 QTM_USE_NAMESPACE
       
    69 
       
    70 class BearerEx : public QMainWindow, public Ui::BearerExMainWindow
       
    71 {
       
    72      Q_OBJECT
       
    73 
       
    74 public:
       
    75     BearerEx(QWidget* parent = 0);
       
    76     void createMenus();
       
    77     void showConfigurations();
       
    78 
       
    79 private Q_SLOTS:
       
    80     void on_updateConfigurationsButton_clicked();
       
    81     void on_updateListButton_clicked();
       
    82     void on_showDetailsButton_clicked();
       
    83     void on_createSessionButton_clicked();
       
    84     void on_clearEventListButton_clicked();
       
    85 
       
    86     void configurationsUpdateCompleted();
       
    87     void configurationAdded(const QNetworkConfiguration& config);
       
    88     void configurationRemoved(const QNetworkConfiguration& config);
       
    89     void onlineStateChanged(bool isOnline);
       
    90     void configurationChanged(const QNetworkConfiguration & config);     
       
    91 
       
    92 private:
       
    93     QNetworkConfigurationManager m_NetworkConfigurationManager;
       
    94     QAction* m_openAction;
       
    95 };
       
    96 
       
    97 class DetailedInfoDialog : public QDialog, public Ui::DetailedInfoDialog
       
    98 {
       
    99     Q_OBJECT
       
   100 
       
   101 public:
       
   102     DetailedInfoDialog(QNetworkConfiguration* apNetworkConfiguration = 0, QWidget* parent = 0);
       
   103 };
       
   104 
       
   105 
       
   106 class SessionTab : public QWidget, public Ui::SessionTab
       
   107 {
       
   108     Q_OBJECT
       
   109 
       
   110 public:
       
   111     SessionTab(QNetworkConfiguration* apNetworkConfiguration = 0, QNetworkConfigurationManager* configManager = 0,
       
   112                QListWidget* eventListWidget = 0,  int index = 0, BearerEx* parent = 0);
       
   113     ~SessionTab();
       
   114     
       
   115     QString stateString(QNetworkSession::State state);    
       
   116 
       
   117 private Q_SLOTS:
       
   118     void on_createQNetworkAccessManagerButton_clicked();
       
   119     void on_sendRequestButton_clicked();
       
   120     void on_openSessionButton_clicked();
       
   121     void on_closeSessionButton_clicked();
       
   122     void on_stopConnectionButton_clicked();
       
   123     void on_deleteSessionButton_clicked();
       
   124     void on_dataObjectChanged(const QString& newObjectType);
       
   125     void on_alrButton_clicked();
       
   126     void finished(quint32 errorCode, qint64 dataReceived, QString errorType);
       
   127     
       
   128     void newConfigurationActivated();
       
   129     void preferredConfigurationChanged(const QNetworkConfiguration& config, bool isSeamless);
       
   130     void stateChanged(QNetworkSession::State state);
       
   131     void newState(QNetworkSession::State state);
       
   132     void opened();
       
   133     void closed();
       
   134     void error(QNetworkSession::SessionError error);
       
   135 
       
   136 private: //data
       
   137     // QNetworkAccessManager* m_networkAccessManager;
       
   138     DataTransferer* m_dataTransferer;
       
   139     QNetworkSession* m_NetworkSession;
       
   140     QNetworkConfigurationManager* m_ConfigManager;
       
   141     QListWidget* m_eventListWidget;
       
   142     QNetworkConfiguration m_config;
       
   143     int m_index;
       
   144     bool m_dataTransferOngoing;
       
   145     bool m_alrEnabled;
       
   146 };
       
   147 
       
   148 #endif // ACCESSPOINTMANAGEREX_H
       
   149 
       
   150 // End of file
       
   151