smf/smfservermodule/smfserver/transportmgr/smftransportmanager.h
changeset 7 be09cf1f39dd
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
       
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "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  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  * 
       
    15  * Description:
       
    16  * The Transport Manager class initializes the transport component of Smf 
       
    17  * framework
       
    18  * Note: This class has dependencies on QtMobility project
       
    19  *
       
    20  */
       
    21 
       
    22 #ifndef SMFTRANSPORTMANAGER_H_
       
    23 #define SMFTRANSPORTMANAGER_H_
       
    24 
       
    25 // Include files
       
    26 #include <smfserverglobal.h>
       
    27 
       
    28 // Qt mobility classes
       
    29 #include <qnetworkconfigmanager.h>
       
    30 #include <qsysteminfo.h>
       
    31 
       
    32 using namespace QtMobility;
       
    33 
       
    34 /**
       
    35  * The Transport Manager class initializes the transport component of Smf 
       
    36  * framework
       
    37  * 
       
    38  * Note: This class has dependencies on QtMobility project
       
    39  */
       
    40 class SmfTransportManager : public QObject
       
    41 	{
       
    42 	Q_OBJECT
       
    43 	
       
    44 public:
       
    45 	/**
       
    46 	 * Method to get the instance of SmfTransportManager class
       
    47 	 * @return The instance of SmfTransportManager class
       
    48 	 */
       
    49 	static SmfTransportManager* getInstance ( );
       
    50 	
       
    51 	/**
       
    52 	 * Destructor
       
    53 	 */
       
    54 	~SmfTransportManager ( );
       
    55 	
       
    56 public slots:
       
    57 	/**
       
    58 	 * Method to initialize the transport component before 
       
    59 	 * executing a web query
       
    60 	 * @return SmfTransportInitializeResult
       
    61 	 * @see smfglobal.h
       
    62 	 */
       
    63 	SmfTransportInitializeResult initializeTransport ( );
       
    64 	
       
    65 	/*
       
    66 	 * This slot is called whenever a new network configuration is added to the system.
       
    67 	 * @param aConfig The new configuration
       
    68 	 */
       
    69 	void configurationAdded ( const QNetworkConfiguration &aConfig );
       
    70 
       
    71 	/*
       
    72 	 * This slot is called when the state of the aConfig changes.
       
    73 	 * @param aConfig The changed configuration
       
    74 	 */
       
    75 	void configurationChanged ( const QNetworkConfiguration &aConfig );
       
    76 
       
    77 	/*
       
    78 	 * This slot is called when a configuration is about to be removed from the system.
       
    79 	 * The removed configuration is invalid but retains name and identifier.
       
    80 	 * @param aConfig The to be removed configuration
       
    81 	 */
       
    82 	void configurationRemoved ( const QNetworkConfiguration &aConfig );
       
    83 	
       
    84 private:
       
    85 	/* Method to get network availability.
       
    86 	 * @return True if online, else false.
       
    87 	 */
       
    88 	bool getNetworkAvailabilty ( );
       
    89 	
       
    90 	/*
       
    91 	 * Method that checks if the phone is in home network or in roaming.
       
    92 	 * @param aStatus [out] An output parameter indicating the current network 
       
    93 	 * status as SmfNetworkStatus
       
    94 	 * @see smfglobal.h
       
    95 	 */
       
    96 	void getCurrentNetworkStatus ( SmfNetworkStatus &aStatus );
       
    97 	
       
    98 private:
       
    99 	/**
       
   100 	 * Constructor with default argument
       
   101 	 */
       
   102 	SmfTransportManager ( );
       
   103 	
       
   104 	/**
       
   105 	 * Copy Constructor
       
   106 	 * @param aOther The reference object
       
   107 	 */
       
   108 	SmfTransportManager ( const SmfTransportManager &aOther );
       
   109 	
       
   110 private:
       
   111 	/**
       
   112 	 * The single instance of SmfTransportManager
       
   113 	 */
       
   114 	static SmfTransportManager* m_myInstance;
       
   115 	
       
   116 	/*
       
   117 	 * Member variable - QNetworkConfigurationManager instance
       
   118 	 */
       
   119 	QNetworkConfigurationManager m_netwConfigMngr;
       
   120 	
       
   121 	/*
       
   122 	 * Member variable - QSystemNetworkInfo instance
       
   123 	 */
       
   124 	QSystemNetworkInfo m_systemInfo;
       
   125 	};
       
   126 
       
   127 #endif /* SMFTRANSPORTMANAGER_H_ */