qtinternetradio/irqnwkinfoobserver/inc/irqnwkinfoobserver.h
changeset 14 896e9dbc5f19
parent 0 09774dfdd46b
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
    19 #ifndef IRQNWKINFOOBSERVER_H_
    19 #ifndef IRQNWKINFOOBSERVER_H_
    20 #define IRQNWKINFOOBSERVER_H_
    20 #define IRQNWKINFOOBSERVER_H_
    21 
    21 
    22 #include <QObject>
    22 #include <QObject>
    23 #include <QString>
    23 #include <QString>
       
    24 #include <QMutex>
    24 
    25 
    25 #include "irqnwkobserverinterface.h"  // MIRQNwkInfoUpdate
    26 #include "irqnwkinfoobserverexport.h"
    26 
    27 
    27 class IRQNwkInfoObserverImpl;
    28 class IRQNwkInfoObserverPrivate;
    28 
    29 
    29 class IRQNwkInfoObserver : public QObject, 
    30 class IRQNWKINFOOBSERVER_DLL_EXPORT IRQNwkInfoObserver : public QObject
    30                            public MIRQNwkInfoUpdate
       
    31 {
    31 {
    32     Q_OBJECT
    32     Q_OBJECT
    33     
    33     
    34 public:
    34 public:
    35     /*!
    35     /*!
    36      *  Get the instance of IRQNwkInfoObserver
    36      *  Get the instance of IRQNwkInfoObserver
    37      *  @return IRQNwkInfoObserver*
    37      *  @return IRQNwkInfoObserver*
    38      */
    38      */
    39     IMPORT_C static  IRQNwkInfoObserver* openInstance();
    39     static  IRQNwkInfoObserver* openInstance();
    40 
    40 
    41     /*!
    41     /*!
    42      *  Close the instance of IRQNwkInfoObserver
    42      *  Close the instance of IRQNwkInfoObserver
    43      */
    43      */
    44     IMPORT_C void closeInstance();
    44     void closeInstance();
    45 
    45 
    46 public:   
    46 public:   
    47     /*!
    47     /*!
    48      *  start monitoring network info change
    48      *  start monitoring network info change
    49      */
    49      */
    50     IMPORT_C void startMonitorNwkInfo();
    50     void startMonitorNwkInfo();
    51 
    51 
    52     /*!
    52     /*!
    53      *  stop monitoring network info change
    53      *  stop monitoring network info change
    54      */    
    54      */    
    55     IMPORT_C void stopMonitorNwkInfo();
    55     void stopMonitorNwkInfo();
    56 
    56 
    57 signals:
    57 signals:
    58 
    58 
    59     void currentNwkChanged(const QString &aCurrentNwkMCC, const QString &aCurrentNwkMNC);
    59     void currentNwkChanged(const QString &aCurrentNwkMCC, const QString &aCurrentNwkMNC);
    60     
    60     
    70     /*!
    70     /*!
    71      * Destructor.
    71      * Destructor.
    72      */    
    72      */    
    73     ~IRQNwkInfoObserver();
    73     ~IRQNwkInfoObserver();
    74     
    74     
    75     /**
       
    76      *  Creates IRQNwkInfoObserver instance
       
    77      */
       
    78     static IRQNwkInfoObserver* createInstanceL();
       
    79     
       
    80     void constructL();    
       
    81     
       
    82 public:      
       
    83     /*!
       
    84      * From MIRQNwkInfoUpdate.
       
    85      */  
       
    86     void updateCurrentNwkInfo(const QString &aCurrentNwkMCC, const QString &aCurrentNwkMNC);
       
    87     
       
    88     void updateHomeNwkInfo(const QString &aHomeNetworkMCC, const QString &aHomeNetworkMNC);  
       
    89     
    75     
    90 private:
    76 private:
    91 
    77 
    92     IRQNwkInfoObserverImpl *iBody;
    78     /**
       
    79      * Number of objects currently referring to the singleton object IRQNwkInfoObserver
       
    80      */
       
    81     int mRefCount;
    93     
    82     
    94     int iSingletonInstances;    
    83     /**
       
    84      * The instance of IRQNwkInfoObserver singleton
       
    85      */
       
    86     static IRQNwkInfoObserver *mInstance;
       
    87     
       
    88     /**
       
    89      * Mutex for the thread-safe of openInstance()
       
    90      */  
       
    91     static QMutex mMutex;
       
    92     
       
    93     /**
       
    94      *  IRQNwkInfoObserver instance
       
    95      */
       
    96     IRQNwkInfoObserverPrivate* d_ptr;
       
    97     
       
    98     /**
       
    99      *  The successful mark for initialization of private data
       
   100      */
       
   101     bool mInitPrivateSuccess;
       
   102 
       
   103     Q_DISABLE_COPY(IRQNwkInfoObserver)
       
   104     
       
   105     friend class IRQNwkInfoObserverPrivate; 
    95 };
   106 };
    96 
   107 
    97 #endif // IRQNWKINFOOBSERVER_H_
   108 #endif // IRQNWKINFOOBSERVER_H_