qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontrollerbody.h
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     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      *  Configure the Access Point which is used by all the components for network connectivity
       
    59      */
       
    60     void  chooseAccessPoint();
       
    61 
       
    62     /*
       
    63      * Cancel configuring access point
       
    64      */
       
    65     void cancelConnecting();
       
    66     
       
    67     /**
       
    68      *  This api is used to determine if the phone is in offline mode
       
    69      *  @return True if the phone is in offline mode else False
       
    70      */
       
    71     bool isOfflineMode();
       
    72 
       
    73     /**
       
    74      *  This api is used to determine if the phone supports WLan usage
       
    75      *  @return True if the phone supports else False
       
    76      */
       
    77     bool isWlanSupported() const;
       
    78 
       
    79     /**
       
    80      *  Reset the connection status to Disconnected state
       
    81      */
       
    82     void resetConnectionStatus();
       
    83 
       
    84     /**
       
    85      *  Used to determine the type of connection
       
    86      *  @return enum describing the type of connection ( GPRS/3G/WiFi )
       
    87      */
       
    88     IRQConnectionType identifyConnectionType() const;
       
    89 
       
    90     /**
       
    91      *  Notifies all observers whose network request is active to reissue the request
       
    92      */
       
    93     void notifyActiveNetworkObservers(IRQNetworkEvent aEvent);
       
    94 
       
    95     /**
       
    96      *  Indicates if the hand over of network connection has happened
       
    97      */
       
    98     bool isHandlingOverConnection();
       
    99 
       
   100     /**
       
   101      *  Indicates if chooseAccessPoint is called
       
   102      */
       
   103     bool isConnectRequestIssued() const;
       
   104 
       
   105     /**
       
   106      *  MIRActiveNetworkObserver::NotifyActiveNetworkObserversL()
       
   107      *  Callback which notifies all observers whose network request is active to reissue the request
       
   108      *  @param aEvent Indicates the type of network event that occurred
       
   109      */
       
   110     void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   111 
       
   112     /**
       
   113      *  MIRActiveNetworkObserver::ResetPendingRequests()
       
   114      *  Callback which notifies all observers whose network request is active to reset the pending
       
   115      *  request status
       
   116      */
       
   117     void ResetPendingRequests(TBool aValue);
       
   118 
       
   119     /**
       
   120      *  MIRNetworkController::IRNetworkEventL()
       
   121      *  @param aEvent Indicates the type of network event that occurred
       
   122      */
       
   123     void IRNetworkEventL(TIRNetworkEvent aEvent);
       
   124     
       
   125 signals:
       
   126 
       
   127     /**
       
   128      *  Notifies all observers whose network request is active to reissue the request
       
   129      *  Called in NotifyActiveNetworkObserversL()
       
   130      */
       
   131     void networkRequestNotified(IRQNetworkEvent aEvent);
       
   132 
       
   133     /**
       
   134      *  Notifies all observers whose network request is active to reset the pending request status
       
   135      *  Called in ResetPendingRequests()
       
   136      */
       
   137     void pendingRequestsReset(bool aValue);
       
   138 
       
   139     /**
       
   140      *  Notifies the type of network event that occurred
       
   141      *  Called in IRNetworkEventL
       
   142      */
       
   143     void networkEventNotified(IRQNetworkEvent aEvent);
       
   144 
       
   145     /**
       
   146      *  Notifies the error
       
   147      */
       
   148     void errorOccured(IRQError aError);
       
   149 
       
   150 private:
       
   151 
       
   152     /**
       
   153      *  NetworkController singleton instance
       
   154      */
       
   155     CIRNetworkController* iNetworkController;
       
   156 };
       
   157 
       
   158 #endif /* IRQNETWORKCONTROLLERBODY_H_ */