qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontrollerbody.h
changeset 0 09774dfdd46b
child 11 f683e24efca3
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     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 #ifndef IRQNETWORKCONTROLLERBODY_H_
       
    18 #define IRQNETWORKCONTROLLERBODY_H_
       
    19 
       
    20 #include <QObject>
       
    21 #include "irnetworkcontroller.h"
       
    22 #include "irqenums.h"
       
    23 #include "irqevent.h"
       
    24 
       
    25 /**
       
    26  * This class implements the IR Network Controller component
       
    27  */
       
    28 
       
    29 class IRQNetworkControllerBody : public QObject
       
    30                                , public MIRActiveNetworkObserver
       
    31                                , public MIRNetworkController
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36     /**
       
    37      *  Create resources
       
    38      */
       
    39     void initL();
       
    40     /**
       
    41      *  Default C++ Destructor
       
    42      */
       
    43     ~IRQNetworkControllerBody();
       
    44 
       
    45     /**
       
    46      *  Return the variable which indicates if connection is active or not
       
    47      *  @return bool
       
    48      */
       
    49     bool getNetworkStatus() const;
       
    50 
       
    51     /**
       
    52      *  Return the IAP Id of the chosen IAP
       
    53      *  @return int Error code
       
    54      */
       
    55     IRQError getIAPId(unsigned long& aIapId) const;
       
    56 
       
    57     /**
       
    58      *  Returns the list of available access points
       
    59      *  @return QStringList &aList specifying the access point names
       
    60      */
       
    61     void getAccessPointList(QStringList &aList);
       
    62 
       
    63     /**
       
    64      *  Returns the list of iap ids for available access points
       
    65      *  @return QList<unsigned long> &aList specifying the iap ids
       
    66      */
       
    67     void getApIdList(QList<unsigned long> &aList);
       
    68 
       
    69     /**
       
    70      *  Returns the list of bearer ids for available access points
       
    71      *  @return QList<unsigned long> &aList specifying the bearer ids
       
    72      */
       
    73     void getBearerList(QList<unsigned long> &aList);
       
    74 
       
    75     /**
       
    76      *  Returns the list of network ids for available access points
       
    77      *  @return QList<unsigned long> &aList specifying the network ids
       
    78      */
       
    79     void getNetworkList(QList<unsigned long> &aList);
       
    80     
       
    81     /**
       
    82      *  Configure the Access Point which is used by all the components for network connectivity
       
    83      */
       
    84     void  chooseAccessPoint();
       
    85 
       
    86     /*
       
    87      * Cancel configuring access point
       
    88      */
       
    89     void cancelConnecting();
       
    90     
       
    91     /**
       
    92      *  This api is used to determine if the phone is in offline mode
       
    93      *  @return True if the phone is in offline mode else False
       
    94      */
       
    95     bool isOfflineMode();
       
    96 
       
    97     /**
       
    98      *  This api is used to determine if the phone supports WLan usage
       
    99      *  @return True if the phone supports else False
       
   100      */
       
   101     bool isWlanSupported() const;
       
   102 
       
   103     /**
       
   104      *  Reset the connection status to Disconnected state
       
   105      */
       
   106     void resetConnectionStatus();
       
   107 
       
   108     /**
       
   109      *  Used to determine the type of connection
       
   110      *  @return enum describing the type of connection ( GPRS/3G/WiFi )
       
   111      */
       
   112     IRQConnectionType identifyConnectionType() const;
       
   113 
       
   114     /**
       
   115      *  Notifies all observers whose network request is active to reissue the request
       
   116      */
       
   117     void notifyActiveNetworkObservers(IRQNetworkEvent aEvent);
       
   118 
       
   119     /**
       
   120      *  Indicates if the hand over of network connection has happened
       
   121      */
       
   122     bool isHandlingOverConnection();
       
   123 
       
   124     /**
       
   125      *  Indicates if chooseAccessPoint is called
       
   126      */
       
   127     bool isConnectRequestIssued() const;
       
   128 
       
   129     /**
       
   130      *  MIRActiveNetworkObserver::NotifyActiveNetworkObserversL()
       
   131      *  Callback which notifies all observers whose network request is active to reissue the request
       
   132      *  @param aEvent Indicates the type of network event that occurred
       
   133      */
       
   134     void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   135 
       
   136     /**
       
   137      *  MIRActiveNetworkObserver::ResetPendingRequests()
       
   138      *  Callback which notifies all observers whose network request is active to reset the pending
       
   139      *  request status
       
   140      */
       
   141     void ResetPendingRequests(TBool aValue);
       
   142 
       
   143     /**
       
   144      *  MIRNetworkController::IRNetworkEventL()
       
   145      *  @param aEvent Indicates the type of network event that occurred
       
   146      */
       
   147     void IRNetworkEventL(TIRNetworkEvent aEvent);
       
   148     
       
   149 signals:
       
   150 
       
   151     /**
       
   152      *  Notifies all observers whose network request is active to reissue the request
       
   153      *  Called in NotifyActiveNetworkObserversL()
       
   154      */
       
   155     void networkRequestNotified(IRQNetworkEvent aEvent);
       
   156 
       
   157     /**
       
   158      *  Notifies all observers whose network request is active to reset the pending request status
       
   159      *  Called in ResetPendingRequests()
       
   160      */
       
   161     void pendingRequestsReset(bool aValue);
       
   162 
       
   163     /**
       
   164      *  Notifies the type of network event that occurred
       
   165      *  Called in IRNetworkEventL
       
   166      */
       
   167     void networkEventNotified(IRQNetworkEvent aEvent);
       
   168 
       
   169     /**
       
   170      *  Notifies the error
       
   171      */
       
   172     void errorOccured(IRQError aError);
       
   173 
       
   174 private:
       
   175 
       
   176     /**
       
   177      *  NetworkController singleton instance
       
   178      */
       
   179     CIRNetworkController* iNetworkController;
       
   180 };
       
   181 
       
   182 #endif /* IRQNETWORKCONTROLLERBODY_H_ */