qtmobility/src/systeminfo/qsysteminfo.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
   150     \value UndefinedStatus        There is no network device, or error.
   150     \value UndefinedStatus        There is no network device, or error.
   151     \value NoNetworkAvailable     There is no network available.
   151     \value NoNetworkAvailable     There is no network available.
   152     \value EmergencyOnly          Emergency calls only.
   152     \value EmergencyOnly          Emergency calls only.
   153     \value Searching              Searching for or connecting with the network.
   153     \value Searching              Searching for or connecting with the network.
   154     \value Busy                   Network is busy.
   154     \value Busy                   Network is busy.
   155     \value Connected              Connected to newtwork.
   155     \value Connected              Connected to network.
   156     \value HomeNetwork            On Home Network.
   156     \value HomeNetwork            On Home Network.
   157     \value Denied                 Network access denied.
   157     \value Denied                 Network access denied.
   158     \value Roaming                On Roaming network.
   158     \value Roaming                On Roaming network.
   159 
   159 
   160   */
   160   */
   493 }
   493 }
   494 
   494 
   495 /*!
   495 /*!
   496   \property QSystemNetworkInfo::cellId
   496   \property QSystemNetworkInfo::cellId
   497   \brief The devices Cell ID
   497   \brief The devices Cell ID
   498     Returns the Cell ID of the connected tower or based station.
   498     Returns the Cell ID of the connected tower or based station, or 0 if not connected.
   499 */
   499 */
   500 int QSystemNetworkInfo::cellId()
   500 int QSystemNetworkInfo::cellId()
   501 {
   501 {
   502     return netInfoPrivate()->cellId();
   502     return netInfoPrivate()->cellId();
   503 }
   503 }
   504 
   504 
   505 /*!
   505 /*!
   506   \property QSystemNetworkInfo::locationAreaCode
   506   \property QSystemNetworkInfo::locationAreaCode
   507   \brief The LAC.
   507   \brief The LAC.
   508 
   508 
   509     Returns the Location Area Code. In the case of none such as a Desktop, an empty string.
   509     Returns the Location Area Code. In the case of a Desktop computer, 0 is returned.
   510 */
   510 */
   511 int QSystemNetworkInfo::locationAreaCode()
   511 int QSystemNetworkInfo::locationAreaCode()
   512 {
   512 {
   513     return netInfoPrivate()->locationAreaCode();
   513     return netInfoPrivate()->locationAreaCode();
   514 }
   514 }
   515 
   515 
   516  /*!
   516  /*!
   517    \property QSystemNetworkInfo::currentMobileCountryCode
   517    \property QSystemNetworkInfo::currentMobileCountryCode
   518    \brief The current MCC.
   518    \brief The current MCC.
   519 
   519 
   520     Returns the current Mobile Country Code. In the case of none such as a Desktop, an empty string.
   520     Returns the current Mobile Country Code. In the case of a Desktop computer, an empty string is returned.
   521 /*/
   521 */
   522 QString QSystemNetworkInfo::currentMobileCountryCode()
   522 QString QSystemNetworkInfo::currentMobileCountryCode()
   523 {
   523 {
   524     return netInfoPrivate()->currentMobileCountryCode();
   524     return netInfoPrivate()->currentMobileCountryCode();
   525 }
   525 }
   526 
   526 
   527 /*!
   527 /*!
   528   \property QSystemNetworkInfo::currentMobileNetworkCode
   528   \property QSystemNetworkInfo::currentMobileNetworkCode
   529   \brief The current MNC.
   529   \brief The current MNC.
   530 
   530 
   531     Returns the current Mobile Network Code. In the case of none such as a Desktop, an empty string.
   531     Returns the current Mobile Network Code. In the case of a Desktop computer, an empty string is returned.
   532 */
   532 */
   533 QString QSystemNetworkInfo::currentMobileNetworkCode()
   533 QString QSystemNetworkInfo::currentMobileNetworkCode()
   534 {
   534 {
   535     return netInfoPrivate()->currentMobileNetworkCode();
   535     return netInfoPrivate()->currentMobileNetworkCode();
   536 }
   536 }
   537 
   537 
   538 /*!
   538 /*!
   539   \property QSystemNetworkInfo::homeMobileCountryCode
   539   \property QSystemNetworkInfo::homeMobileCountryCode
   540   \brief The home MNC.
   540   \brief The home MNC.
   541 
   541 
   542     Returns the home Mobile Country Code. In the case of none such as a Desktop, an empty string.
   542     Returns the home Mobile Country Code. In the case of a Desktop computer, an empty string is returned.
   543 */
   543 */
   544 QString QSystemNetworkInfo::homeMobileCountryCode()
   544 QString QSystemNetworkInfo::homeMobileCountryCode()
   545 {
   545 {
   546     return netInfoPrivate()->homeMobileCountryCode();
   546     return netInfoPrivate()->homeMobileCountryCode();
   547 }
   547 }
   548 
   548 
   549 /*!
   549 /*!
   550   \property QSystemNetworkInfo::homeMobileNetworkCode
   550   \property QSystemNetworkInfo::homeMobileNetworkCode
   551   \brief The home MCC.
   551   \brief The home MCC.
   552 
   552 
   553     Returns the home Mobile Network Code. In the case of none such as a Desktop, an empty string.
   553     Returns the home Mobile Network Code. In the case of a Desktop computer, an empty string is returned.
   554     Note: Some platforms don't support retrieving this info. In this case the Network Code is
   554     Note: Some platforms don't support retrieving this info. In this case the Network Code is
   555     returned only when the device is registered on home network.
   555     returned only when the device is registered on home network.
   556 */
   556 */
   557 QString QSystemNetworkInfo::homeMobileNetworkCode()
   557 QString QSystemNetworkInfo::homeMobileNetworkCode()
   558 {
   558 {
   575 {
   575 {
   576     return netInfoPrivate()->macAddress(mode);
   576     return netInfoPrivate()->macAddress(mode);
   577 }
   577 }
   578 
   578 
   579 /*!
   579 /*!
   580   Returns the first found QNetworkInterface for type \a mode.
   580   Returns the first found QNetworkInterface for type \a mode, or an invalid QNetworkInterface, if none is found.
   581   */
   581   */
   582 QNetworkInterface QSystemNetworkInfo::interfaceForMode(QSystemNetworkInfo::NetworkMode mode)
   582 QNetworkInterface QSystemNetworkInfo::interfaceForMode(QSystemNetworkInfo::NetworkMode mode)
   583 {
   583 {
   584     return netInfoPrivate()->interfaceForMode(mode);
   584     return netInfoPrivate()->interfaceForMode(mode);
   585 }
   585 }
   605 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
   605 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
   606     if (QLatin1String(signal) == QLatin1String(QMetaObject::normalizedSignature(SIGNAL(
   606     if (QLatin1String(signal) == QLatin1String(QMetaObject::normalizedSignature(SIGNAL(
   607                                  networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int))))) {
   607                                  networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int))))) {
   608         netInfoPrivate()->setWlanSignalStrengthCheckEnabled(true);
   608         netInfoPrivate()->setWlanSignalStrengthCheckEnabled(true);
   609     }
   609     }
       
   610 #else
       
   611 Q_UNUSED(signal)
   610 #endif
   612 #endif
   611 }
   613 }
   612 
   614 
   613 /*!
   615 /*!
   614     \internal
   616     \internal
   625 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
   627 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
   626     if (QLatin1String(signal) == QLatin1String(QMetaObject::normalizedSignature(SIGNAL(
   628     if (QLatin1String(signal) == QLatin1String(QMetaObject::normalizedSignature(SIGNAL(
   627                                  networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int))))) {
   629                                  networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int))))) {
   628         netInfoPrivate()->setWlanSignalStrengthCheckEnabled(false);
   630         netInfoPrivate()->setWlanSignalStrengthCheckEnabled(false);
   629     }
   631     }
       
   632 #else
       
   633 Q_UNUSED(signal)
   630 #endif
   634 #endif
   631 }
   635 }
   632 
   636 
   633 // display
   637 // display
   634  /*!
   638  /*!
   661 {
   665 {
   662     return displayInfoPrivate()->displayBrightness(screenNumber);
   666     return displayInfoPrivate()->displayBrightness(screenNumber);
   663 }
   667 }
   664 
   668 
   665 /*!
   669 /*!
   666     Returns the color depth of the screen with the index \a screenNumber, in bits per pixel.
   670     Returns the color depth of the screen with the index \a screenNumber, in bits per pixel, or 0 if the screen is not found.
   667 
   671 
   668     \sa QDesktopWidget::screenCount()
   672     \sa QDesktopWidget::screenCount()
   669 */
   673 */
   670 int QSystemDisplayInfo::colorDepth(int screenNumber)
   674 int QSystemDisplayInfo::colorDepth(int screenNumber)
   671 {
   675 {
   709 
   713 
   710 /*!
   714 /*!
   711   \property QSystemStorageInfo::logicalDrives
   715   \property QSystemStorageInfo::logicalDrives
   712   \brief The logical drives.
   716   \brief The logical drives.
   713 
   717 
   714     Returns a QStringList of volumes or partitions.
   718     Returns a QStringList of volumes or partitions, or an empty list if no drives are found.
   715 */
   719 */
   716 QStringList QSystemStorageInfo::logicalDrives()
   720 QStringList QSystemStorageInfo::logicalDrives()
   717 {
   721 {
   718     return storageInfoPrivate()->logicalDrives();
   722     return storageInfoPrivate()->logicalDrives();
   719 }
   723 }
   819 
   823 
   820 /*!
   824 /*!
   821   \property QSystemDeviceInfo::productName
   825   \property QSystemDeviceInfo::productName
   822   \brief The product name.
   826   \brief The product name.
   823 
   827 
   824     Returns the product name of the device. In the case where no product information is available,
   828     Returns the product name of the device. In the case where no product information is available, an empty string will be returned.
   825 
   829 
   826 */
   830 */
   827 QString QSystemDeviceInfo::productName()
   831 QString QSystemDeviceInfo::productName()
   828 {
   832 {
   829     return deviceInfoPrivate()->productName();
   833     return deviceInfoPrivate()->productName();
   905 
   909 
   906 /////
   910 /////
   907  /*!
   911  /*!
   908    Constructs a QSystemScreenSaver object with the given \a parent.
   912    Constructs a QSystemScreenSaver object with the given \a parent.
   909 
   913 
   910    On platforms where there is no one default screensaver mechanism, such as Linux, this class
   914    On platforms where there is no default screensaver mechanism, such as Linux, this class
   911    may not be available.
   915    may not be available.
   912  */
   916  */
   913 
   917 
   914 QSystemScreenSaver::QSystemScreenSaver(QObject *parent)
   918 QSystemScreenSaver::QSystemScreenSaver(QObject *parent)
   915     : QObject(parent)
   919     : QObject(parent)
   931 }
   935 }
   932 
   936 
   933 /*!
   937 /*!
   934     Temporarily inhibits the screensaver.
   938     Temporarily inhibits the screensaver.
   935 
   939 
   936     Will be reverted upon destruction of the QSystemScreenSaver object.
   940     The screensaver will be set to a non inhibited state only when this QSystemScreenSaver object gets destroyed.
   937     Returns true on success, otherwise false.
   941 
       
   942     This is a non blocking function that will return true if the inhibit procedure was successful, otherwise false.
   938 
   943 
   939     On platforms that support it, if screensaver is secure by policy, the policy will be honored
   944     On platforms that support it, if screensaver is secure by policy, the policy will be honored
   940     and this will fail.
   945     and this will fail.
   941 */
   946 */
   942 bool QSystemScreenSaver::setScreenSaverInhibit()
   947 bool QSystemScreenSaver::setScreenSaverInhibit()