src/systeminfo/qsysteminfo_linux_common_p.h
changeset 0 876b1a06bc25
child 5 603d3f8b6302
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 #ifndef QSYSTEMINFO_LINUX_COMMON_P_H
       
    42 #define QSYSTEMINFO_LINUX_COMMON_P_H
       
    43 
       
    44 
       
    45 //
       
    46 //  W A R N I N G
       
    47 //  -------------
       
    48 //
       
    49 // This file is not part of the Qt API.  It exists purely as an
       
    50 // implementation detail.  This header file may change from version to
       
    51 // version without notice, or even be removed.
       
    52 //
       
    53 // We mean it.
       
    54 //
       
    55 
       
    56 
       
    57 #include <QObject>
       
    58 #include <QSize>
       
    59 #include <QHash>
       
    60 
       
    61 #include "qsysteminfo.h"
       
    62 #include <qmobilityglobal.h>
       
    63 #if !defined(QT_NO_DBUS)
       
    64 #include "qhalservice_linux_p.h"
       
    65 #endif
       
    66 
       
    67 QT_BEGIN_HEADER
       
    68 
       
    69 QT_BEGIN_NAMESPACE
       
    70 class QStringList;
       
    71 class QTimer;
       
    72 QT_END_NAMESPACE
       
    73 
       
    74 QTM_BEGIN_NAMESPACE
       
    75 
       
    76 class QSystemNetworkInfo;
       
    77 class QSystemInfoLinuxCommonPrivate : public QObject
       
    78 {
       
    79     Q_OBJECT
       
    80 
       
    81 public:
       
    82 
       
    83     QSystemInfoLinuxCommonPrivate(QObject *parent = 0);
       
    84     virtual ~QSystemInfoLinuxCommonPrivate();
       
    85     QString currentLanguage() const;
       
    86     QStringList availableLanguages() const {return QStringList();}
       
    87 
       
    88     QString version(QSystemInfo::Version,  const QString &/*parameter*/ = QString());
       
    89     QString currentCountryCode() const;
       
    90     virtual bool hasFeatureSupported(QSystemInfo::Feature feature);
       
    91     bool hasSysFeature(const QString &featureStr);
       
    92 
       
    93 Q_SIGNALS:
       
    94     void currentLanguageChanged(const QString &);
       
    95 
       
    96 private:
       
    97     QTimer *langTimer;
       
    98     QString langCached;
       
    99 
       
   100 protected Q_SLOTS:
       
   101     void startLanguagePolling();
       
   102 
       
   103 protected:
       
   104 #if !defined(QT_NO_DBUS)
       
   105     bool hasHalDeviceFeature(const QString &param);
       
   106     bool hasHalUsbFeature(qint32 usbClass);
       
   107     QHalInterface halIface;
       
   108 #endif
       
   109 };
       
   110 
       
   111 class QNetworkManagerInterface;
       
   112 class QNetworkManagerInterfaceDeviceWired;
       
   113 class QNetworkManagerInterfaceDeviceWireless;
       
   114 class QNetworkManagerInterfaceAccessPoint;
       
   115 
       
   116 class QSystemNetworkInfoLinuxCommonPrivate : public QObject
       
   117 {
       
   118     Q_OBJECT
       
   119 
       
   120 public:
       
   121 
       
   122     QSystemNetworkInfoLinuxCommonPrivate(QObject *parent = 0);
       
   123     virtual ~QSystemNetworkInfoLinuxCommonPrivate();
       
   124 
       
   125     virtual QSystemNetworkInfo::NetworkStatus networkStatus(QSystemNetworkInfo::NetworkMode mode);
       
   126     qint32 networkSignalStrength(QSystemNetworkInfo::NetworkMode mode);
       
   127     int cellId() {return 0;}
       
   128     int locationAreaCode() {return 0;}
       
   129 
       
   130     QString currentMobileCountryCode() {return QString();}
       
   131     QString currentMobileNetworkCode() {return QString();}
       
   132 
       
   133     QString homeMobileCountryCode() {return QString();}
       
   134     QString homeMobileNetworkCode() {return QString();}
       
   135 
       
   136     virtual QString networkName(QSystemNetworkInfo::NetworkMode mode);
       
   137     virtual QString macAddress(QSystemNetworkInfo::NetworkMode mode);
       
   138 
       
   139     virtual QNetworkInterface interfaceForMode(QSystemNetworkInfo::NetworkMode mode);
       
   140    // virtual QSystemNetworkInfo::NetworkMode currentMode();
       
   141 
       
   142 //public Q_SLOTS:
       
   143 //    void getPrimaryMode();
       
   144 
       
   145 Q_SIGNALS:
       
   146    void networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus);
       
   147    void networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode,int);
       
   148    void currentMobileCountryCodeChanged(const QString &);
       
   149    void currentMobileNetworkCodeChanged(const QString &);
       
   150    void networkNameChanged(QSystemNetworkInfo::NetworkMode, const QString &);
       
   151    void networkModeChanged(QSystemNetworkInfo::NetworkMode);
       
   152 
       
   153 protected:
       
   154 #if !defined(QT_NO_DBUS)
       
   155     int getBluetoothRssi();
       
   156     QString getBluetoothInfo(const QString &file);
       
   157     bool isDefaultInterface(const QString &device);
       
   158 #endif
       
   159     QSystemNetworkInfo::NetworkStatus getBluetoothNetStatus();
       
   160 
       
   161 };
       
   162 
       
   163 class QSystemDisplayInfoLinuxCommonPrivate : public QObject
       
   164 {
       
   165     Q_OBJECT
       
   166 
       
   167 public:
       
   168 
       
   169     QSystemDisplayInfoLinuxCommonPrivate(QObject *parent = 0);
       
   170     virtual ~QSystemDisplayInfoLinuxCommonPrivate();
       
   171 
       
   172     int displayBrightness(int screen);
       
   173     int colorDepth(int screen);
       
   174 };
       
   175 
       
   176 class QSystemStorageInfoLinuxCommonPrivate : public QObject
       
   177 {
       
   178     Q_OBJECT
       
   179 
       
   180 public:
       
   181 
       
   182     QSystemStorageInfoLinuxCommonPrivate(QObject *parent = 0);
       
   183     virtual ~QSystemStorageInfoLinuxCommonPrivate();
       
   184 
       
   185     qint64 availableDiskSpace(const QString &driveVolume);
       
   186     qint64 totalDiskSpace(const QString &driveVolume);
       
   187     QStringList logicalDrives();
       
   188     QSystemStorageInfo::DriveType typeForDrive(const QString &driveVolume);
       
   189 
       
   190 private:
       
   191      QMap<QString, QString> mountEntriesMap;
       
   192      void mountEntries();
       
   193 
       
   194 };
       
   195 
       
   196 class QSystemDeviceInfoLinuxCommonPrivate : public QObject
       
   197 {
       
   198     Q_OBJECT
       
   199 
       
   200 public:
       
   201 
       
   202     QSystemDeviceInfoLinuxCommonPrivate(QObject *parent = 0);
       
   203     virtual ~QSystemDeviceInfoLinuxCommonPrivate();
       
   204 
       
   205     QString imei() {return QString();}
       
   206     QString imsi() {return QString();}
       
   207     QString manufacturer();
       
   208     QString model();
       
   209     QString productName();
       
   210 
       
   211     QSystemDeviceInfo::InputMethodFlags inputMethodType();
       
   212 
       
   213     int  batteryLevel() const ;
       
   214 
       
   215     QSystemDeviceInfo::SimStatus simStatus() {return QSystemDeviceInfo::SimNotAvailable;}
       
   216     bool isDeviceLocked() {return false;}
       
   217     QSystemDeviceInfo::Profile currentProfile() {return QSystemDeviceInfo::UnknownProfile;}
       
   218 
       
   219     QSystemDeviceInfo::PowerState currentPowerState();
       
   220     void setConnection();
       
   221 
       
   222 Q_SIGNALS:
       
   223     void batteryLevelChanged(int);
       
   224     void batteryStatusChanged(QSystemDeviceInfo::BatteryStatus );
       
   225 
       
   226     void powerStateChanged(QSystemDeviceInfo::PowerState);
       
   227     void currentProfileChanged(QSystemDeviceInfo::Profile);
       
   228     void bluetoothStateChanged(bool);
       
   229 protected:
       
   230 #if !defined(QT_NO_DBUS)
       
   231     QHalInterface *halIface;
       
   232     QHalDeviceInterface *halIfaceDevice;
       
   233     void setupBluetooth();
       
   234 
       
   235 private Q_SLOTS:
       
   236     virtual void halChanged(int,QVariantList);
       
   237     void bluezPropertyChanged(const QString&, QDBusVariant);
       
   238 #endif
       
   239 };
       
   240 
       
   241 
       
   242 class QSystemScreenSaverLinuxCommonPrivate : public QObject
       
   243 {
       
   244     Q_OBJECT
       
   245 
       
   246 public:
       
   247     QSystemScreenSaverLinuxCommonPrivate(QObject *parent = 0);
       
   248     virtual ~QSystemScreenSaverLinuxCommonPrivate();
       
   249 
       
   250     bool screenSaverInhibited() {return false;}
       
   251     bool setScreenSaverInhibit() {return false;}
       
   252     bool isScreenLockEnabled() {return false;}
       
   253     bool isScreenSaverActive() {return false;}
       
   254 };
       
   255 
       
   256 QTM_END_NAMESPACE
       
   257 
       
   258 QT_END_HEADER
       
   259 
       
   260 #endif /*QSYSTEMINFO_LINUX_COMMON_P_H*/
       
   261 
       
   262 // End of file
       
   263