qtmobility/src/systeminfo/qsysteminfo_mac_p.h
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    62 #include <qmobilityglobal.h>
    62 #include <qmobilityglobal.h>
    63 
    63 
    64 #include <QTimer>
    64 #include <QTimer>
    65 #include <QtCore/qthread.h>
    65 #include <QtCore/qthread.h>
    66 #include <QtCore/qmutex.h>
    66 #include <QtCore/qmutex.h>
    67  #include <QEventLoop>
    67 #include <QEventLoop>
       
    68 #include <IOKit/IOKitLib.h>
    68 
    69 
    69 #include <SystemConfiguration/SystemConfiguration.h>
    70 #include <SystemConfiguration/SystemConfiguration.h>
    70 //#include <CoreFoundation/CoreFoundation.h>
    71 //#include <CoreFoundation/CoreFoundation.h>
    71 
    72 
    72 QT_BEGIN_HEADER
    73 QT_BEGIN_HEADER
   108     QString langCached;
   109     QString langCached;
   109     QLangLoopThread * langloopThread;
   110     QLangLoopThread * langloopThread;
   110     static QSystemInfoPrivate *self;
   111     static QSystemInfoPrivate *self;
   111 
   112 
   112 private Q_SLOTS:
   113 private Q_SLOTS:
   113  protected:
   114 protected:
   114     void connectNotify(const char *signal);
   115     void connectNotify(const char *signal);
   115     void disconnectNotify(const char *signal);
   116     void disconnectNotify(const char *signal);
   116 
   117 
   117 };
   118 };
   118 
   119 
   211     bool updateVolumesMap();
   212     bool updateVolumesMap();
   212     void mountEntries();
   213     void mountEntries();
   213 
   214 
   214 };
   215 };
   215 
   216 
       
   217 class QBluetoothListenerThread;
   216 class QSystemDeviceInfoPrivate : public QObject
   218 class QSystemDeviceInfoPrivate : public QObject
   217 {
   219 {
   218     Q_OBJECT
   220     Q_OBJECT
   219 
   221 
   220 public:
   222 public:
   236     bool isDeviceLocked();
   238     bool isDeviceLocked();
   237     QSystemDeviceInfo::Profile currentProfile();
   239     QSystemDeviceInfo::Profile currentProfile();
   238 
   240 
   239     QSystemDeviceInfo::PowerState currentPowerState();
   241     QSystemDeviceInfo::PowerState currentPowerState();
   240     void setConnection();
   242     void setConnection();
   241     static QSystemDeviceInfoPrivate *instance() {return self;}
   243     static QSystemDeviceInfoPrivate *instance();
       
   244 
       
   245     bool currentBluetoothPowerState();
   242 
   246 
   243 Q_SIGNALS:
   247 Q_SIGNALS:
   244     void batteryLevelChanged(int);
   248     void batteryLevelChanged(int);
   245     void batteryStatusChanged(QSystemDeviceInfo::BatteryStatus );
   249     void batteryStatusChanged(QSystemDeviceInfo::BatteryStatus );
   246 
   250 
   251 private:
   255 private:
   252     int batteryLevelCache;
   256     int batteryLevelCache;
   253     QSystemDeviceInfo::PowerState currentPowerStateCache;
   257     QSystemDeviceInfo::PowerState currentPowerStateCache;
   254     QSystemDeviceInfo::BatteryStatus batteryStatusCache;
   258     QSystemDeviceInfo::BatteryStatus batteryStatusCache;
   255     static QSystemDeviceInfoPrivate *self;
   259     static QSystemDeviceInfoPrivate *self;
       
   260     QBluetoothListenerThread *btThread;
       
   261 
       
   262 protected:
       
   263     void connectNotify(const char *signal);
       
   264     void disconnectNotify(const char *signal);
       
   265 
   256 };
   266 };
   257 
   267 
   258 
   268 
   259 class QSystemScreenSaverPrivate : public QObject
   269 class QSystemScreenSaverPrivate : public QObject
   260 {
   270 {
   285 
   295 
   286 public:
   296 public:
   287     QRunLoopThread(QObject *parent = 0);
   297     QRunLoopThread(QObject *parent = 0);
   288     ~QRunLoopThread();
   298     ~QRunLoopThread();
   289     bool keepRunning;
   299     bool keepRunning;
   290     void quit();
   300     void stop();
   291 
   301 
   292 protected:
   302 protected:
   293     void run();
   303     void run();
   294 
   304 
   295 private:
   305 private:
   314 protected:
   324 protected:
   315     void run();
   325     void run();
   316 
   326 
   317 private:
   327 private:
   318     QMutex mutex;
   328     QMutex mutex;
       
   329 private Q_SLOTS:
       
   330 };
       
   331 
       
   332 class QBluetoothListenerThread : public QThread
       
   333 {
       
   334     Q_OBJECT
       
   335 
       
   336 public:
       
   337     QBluetoothListenerThread(QObject *parent = 0);
       
   338     ~QBluetoothListenerThread();
       
   339     bool keepRunning;
       
   340 
       
   341 public Q_SLOTS:
       
   342     void emitBtPower(bool);
       
   343     void stop();
       
   344 
       
   345 Q_SIGNALS:
       
   346     void bluetoothPower(bool);
       
   347 
       
   348 protected:
       
   349     void run();
       
   350     IONotificationPortRef port;
       
   351     CFRunLoopRef rl;
       
   352     CFRunLoopSourceRef rls;
       
   353 
       
   354 private:
       
   355     QMutex mutex;
   319 
   356 
   320 private Q_SLOTS:
   357 private Q_SLOTS:
   321 };
   358 };
   322 
   359 
   323 QTM_END_NAMESPACE
   360 QTM_END_NAMESPACE