diff -r 608f67c22514 -r 896e9dbc5f19 qtinternetradio/irqnwkinfoobserver/inc/irqnwkinfoobserver.h --- a/qtinternetradio/irqnwkinfoobserver/inc/irqnwkinfoobserver.h Tue Jul 06 14:07:20 2010 +0300 +++ b/qtinternetradio/irqnwkinfoobserver/inc/irqnwkinfoobserver.h Wed Aug 18 09:40:26 2010 +0300 @@ -21,13 +21,13 @@ #include #include +#include -#include "irqnwkobserverinterface.h" // MIRQNwkInfoUpdate +#include "irqnwkinfoobserverexport.h" -class IRQNwkInfoObserverImpl; +class IRQNwkInfoObserverPrivate; -class IRQNwkInfoObserver : public QObject, - public MIRQNwkInfoUpdate +class IRQNWKINFOOBSERVER_DLL_EXPORT IRQNwkInfoObserver : public QObject { Q_OBJECT @@ -36,23 +36,23 @@ * Get the instance of IRQNwkInfoObserver * @return IRQNwkInfoObserver* */ - IMPORT_C static IRQNwkInfoObserver* openInstance(); + static IRQNwkInfoObserver* openInstance(); /*! * Close the instance of IRQNwkInfoObserver */ - IMPORT_C void closeInstance(); + void closeInstance(); public: /*! * start monitoring network info change */ - IMPORT_C void startMonitorNwkInfo(); + void startMonitorNwkInfo(); /*! * stop monitoring network info change */ - IMPORT_C void stopMonitorNwkInfo(); + void stopMonitorNwkInfo(); signals: @@ -72,26 +72,37 @@ */ ~IRQNwkInfoObserver(); - /** - * Creates IRQNwkInfoObserver instance - */ - static IRQNwkInfoObserver* createInstanceL(); - - void constructL(); - -public: - /*! - * From MIRQNwkInfoUpdate. - */ - void updateCurrentNwkInfo(const QString &aCurrentNwkMCC, const QString &aCurrentNwkMNC); - - void updateHomeNwkInfo(const QString &aHomeNetworkMCC, const QString &aHomeNetworkMNC); private: - IRQNwkInfoObserverImpl *iBody; + /** + * Number of objects currently referring to the singleton object IRQNwkInfoObserver + */ + int mRefCount; + + /** + * The instance of IRQNwkInfoObserver singleton + */ + static IRQNwkInfoObserver *mInstance; - int iSingletonInstances; + /** + * Mutex for the thread-safe of openInstance() + */ + static QMutex mMutex; + + /** + * IRQNwkInfoObserver instance + */ + IRQNwkInfoObserverPrivate* d_ptr; + + /** + * The successful mark for initialization of private data + */ + bool mInitPrivateSuccess; + + Q_DISABLE_COPY(IRQNwkInfoObserver) + + friend class IRQNwkInfoObserverPrivate; }; #endif // IRQNWKINFOOBSERVER_H_