![]() |
Home · All Namespaces · All Classes |
00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of systemui. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #ifndef STATUSINDICATOR_H 00021 #define STATUSINDICATOR_H 00022 00023 #include <MWidgetController> 00024 #include <QDBusConnection> 00025 #include "statusindicatormodel.h" 00026 #include <QTimer> 00027 00028 #ifdef HAVE_QMSYSTEM 00029 #include <qmdevicemode.h> 00030 #endif 00031 00032 class ApplicationContext; 00033 class ContextItem; 00034 class MGConfItem; 00035 00040 class StatusIndicator : public MWidgetController 00041 { 00042 Q_OBJECT 00043 M_CONTROLLER(StatusIndicator) 00044 00045 Q_PROPERTY(QVariant value READ value WRITE setValue) 00046 00047 public: 00053 explicit StatusIndicator(QGraphicsItem *parent = NULL); 00054 00058 virtual ~StatusIndicator(); 00059 00061 // Reimplemented here as public so that the view can call it 00062 virtual void updateGeometry(); 00064 00065 signals: 00067 void subscriptionMade(); 00068 00069 protected: 00075 void setStyleNameAndUpdate(const QString &name = QString()); 00076 00085 void setValue(QVariant v); 00086 00090 QVariant value() const; 00091 00093 void updateAnimationStatus(); 00094 00096 bool animateIfPossible; 00097 00110 ContextItem *createContextItem(ApplicationContext& context, const QString& key); 00111 00112 private: 00114 virtual void enterDisplayEvent(); 00115 virtual void exitDisplayEvent(); 00117 00123 void setModelUpdatesEnabled(bool modelUpdatesEnabled); 00124 00126 bool modelUpdatesEnabled; 00127 00129 QVariant currentValue; 00130 00132 QList<ContextItem*> contextItems; 00133 00134 #ifdef UNIT_TEST 00135 friend class Ut_StatusIndicator; 00136 #endif 00137 }; 00138 00142 class PhoneNetworkSignalStrengthStatusIndicator : public StatusIndicator 00143 { 00144 Q_OBJECT 00145 M_CONTROLLER(PhoneNetworkSignalStrengthStatusIndicator) 00146 00147 public: 00154 explicit PhoneNetworkSignalStrengthStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00155 00156 virtual ~PhoneNetworkSignalStrengthStatusIndicator(); 00157 00158 signals: 00159 void networkAvailabilityChanged(bool available); 00160 00161 private slots: 00162 void signalStrengthChanged(); 00163 void setNetworkStatus(); 00164 00165 private: 00166 ContextItem *signalStrength; 00167 ContextItem *systemOfflineMode; 00168 ContextItem *cellularRegistrationStatus; 00169 00170 bool networkAvailable; 00171 00172 #ifdef UNIT_TEST 00173 friend class Ut_StatusIndicator; 00174 #endif 00175 }; 00176 00186 class PhoneNetworkTypeStatusIndicator : public StatusIndicator 00187 { 00188 Q_OBJECT 00189 M_CONTROLLER(PhoneNetworkTypeStatusIndicator); 00190 00191 public: 00198 explicit PhoneNetworkTypeStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00199 00200 virtual ~PhoneNetworkTypeStatusIndicator(); 00201 00202 public slots: 00203 void setNetworkAvailability(bool availability); 00204 00205 private slots: 00206 void setNetworkType(); 00207 00208 private: 00209 00210 ContextItem *cellularDataTechnology; 00211 ContextItem *connectionType; 00212 ContextItem *connectionState; 00213 ContextItem *packetData; 00214 ContextItem *wlanEnabled; 00215 00216 #ifdef UNIT_TEST 00217 friend class Ut_StatusIndicator; 00218 #endif 00219 00220 }; 00221 00226 class BatteryStatusIndicator : public StatusIndicator 00227 { 00228 Q_OBJECT 00229 M_CONTROLLER(BatteryStatusIndicator) 00230 00231 public: 00238 explicit BatteryStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00239 00240 virtual ~BatteryStatusIndicator(); 00241 00242 private slots: 00243 void batteryLevelChanged(); 00244 void batteryChargingChanged(); 00245 00246 private: 00247 ContextItem *batteryLevel; 00248 ContextItem *batteryCharging; 00249 ContextItem *batterySaveMode; 00250 00251 #ifdef UNIT_TEST 00252 friend class Ut_StatusIndicator; 00253 #endif 00254 }; 00255 00259 class AlarmStatusIndicator : public StatusIndicator 00260 { 00261 Q_OBJECT 00262 M_CONTROLLER(AlarmStatusIndicator) 00263 00264 public: 00271 explicit AlarmStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00272 00273 virtual ~AlarmStatusIndicator(); 00274 00275 private slots: 00276 void alarmChanged(); 00277 00278 private: 00279 ContextItem *alarm; 00280 }; 00281 00286 class BluetoothStatusIndicator : public StatusIndicator 00287 { 00288 Q_OBJECT 00289 M_CONTROLLER(BluetoothStatusIndicator) 00290 00291 public: 00298 explicit BluetoothStatusIndicator(ApplicationContext &context, 00299 QGraphicsItem *parent = NULL); 00300 00301 virtual ~BluetoothStatusIndicator(); 00302 00303 private slots: 00304 void bluetoothChanged(); 00305 00306 private: 00307 ContextItem *bluetoothEnabled; 00308 ContextItem *bluetoothConnected; 00309 }; 00310 00314 class PresenceStatusIndicator : public StatusIndicator 00315 { 00316 Q_OBJECT 00317 M_CONTROLLER(PresenceStatusIndicator) 00318 00319 public: 00326 explicit PresenceStatusIndicator(ApplicationContext &context, 00327 QGraphicsItem *parent = NULL); 00328 00329 virtual ~PresenceStatusIndicator(); 00330 00331 private slots: 00332 void presenceChanged(); 00333 00334 private: 00335 ContextItem *presence; 00336 }; 00337 00338 00344 class PhoneNetworkStatusIndicator : public StatusIndicator 00345 { 00346 Q_OBJECT 00347 M_CONTROLLER(PhoneNetworkStatusIndicator) 00348 00349 public: 00356 explicit PhoneNetworkStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00357 00358 virtual ~PhoneNetworkStatusIndicator(); 00359 00360 private slots: 00361 void phoneNetworkChanged(); 00362 void showVisitorNetworkName(); 00363 00364 private: 00365 QString homeNetwork() const; 00366 QString visitorNetwork() const; 00367 QString localizedNetwork() const; 00368 00369 ContextItem *networkName; 00370 ContextItem *extendedNetworkName; 00371 ContextItem *cellularServiceStatus; 00372 MGConfItem *displayLimitedServiceState; 00373 QTimer networkChangeShowVisitorTimer; 00374 00375 #ifdef UNIT_TEST 00376 friend class Ut_StatusIndicator; 00377 #endif 00378 }; 00379 00384 class InputMethodStatusIndicator : public StatusIndicator 00385 { 00386 Q_OBJECT 00387 M_CONTROLLER(InputMethodStatusIndicator) 00388 00389 public: 00395 explicit InputMethodStatusIndicator(QGraphicsItem *parent = NULL); 00396 00397 virtual ~InputMethodStatusIndicator(); 00398 00399 void setIconID(const QString &iconID); 00400 }; 00401 00407 class CallStatusIndicator : public StatusIndicator 00408 { 00409 Q_OBJECT 00410 M_CONTROLLER(CallStatusIndicator) 00411 00412 public: 00413 explicit CallStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00414 00415 virtual ~CallStatusIndicator(); 00416 00417 private slots: 00418 void callOrMutedChanged(); 00419 00420 private: 00421 ContextItem *call; 00422 ContextItem *muted; 00423 }; 00424 00429 class ProfileStatusIndicator : public StatusIndicator 00430 { 00431 Q_OBJECT 00432 M_CONTROLLER(ProfileStatusIndicator) 00433 00434 public: 00435 explicit ProfileStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00436 00437 virtual ~ProfileStatusIndicator(); 00438 00439 private slots: 00440 void profileChanged(); 00441 00442 private: 00443 ContextItem *profile; 00444 }; 00445 00449 class GPSStatusIndicator : public StatusIndicator 00450 { 00451 Q_OBJECT 00452 M_CONTROLLER(GPSStatusIndicator) 00453 00454 public: 00461 explicit GPSStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00462 00463 virtual ~GPSStatusIndicator(); 00464 00465 private slots: 00466 void gpsStateChanged(); 00467 00468 private: 00469 ContextItem *gpsState; 00470 }; 00471 00475 class CallForwardingStatusIndicator : public StatusIndicator 00476 { 00477 Q_OBJECT 00478 M_CONTROLLER(CallForwardingStatusIndicator) 00479 00480 public: 00487 explicit CallForwardingStatusIndicator(ApplicationContext &context, QGraphicsItem *parent = NULL); 00488 00489 virtual ~CallForwardingStatusIndicator(); 00490 00491 private slots: 00492 void callForwardingChanged(); 00493 00494 private: 00495 ContextItem *callForwarding; 00496 }; 00497 00502 class TransferStatusIndicator : public StatusIndicator 00503 { 00504 Q_OBJECT 00505 M_CONTROLLER(TransferStatusIndicator) 00506 00507 public: 00514 explicit TransferStatusIndicator(QGraphicsItem *parent = NULL); 00515 00519 virtual ~TransferStatusIndicator(); 00520 00521 00522 private slots: 00529 void transferStateChanged(const QString &state); 00530 00531 private: 00533 QDBusConnection connectionSessionBus; 00534 00536 static const QString TRANSFER_UI_DBUS_PATH; 00538 static const QString TRANSFER_UI_DBUS_INTERFACE; 00540 static const QString TRANSFER_UI_DBUS_SIGNAL; 00542 static const QString TRANSFER_UI_STATE_IDLE; 00544 static const QString TRANSFER_UI_STATE_LIVE; 00546 static const QString TRANSFER_UI_STATE_FAIL; 00548 static const QString TRANSFER_UI_STATE_PENDING; 00550 static const QString TRANSFER_UI_SUFFIX_FAIL; 00552 static const QString TRANSFER_UI_SUFFIX_LIVE; 00554 static const QString TRANSFER_UI_SUFFIX_PENDING; 00555 00556 #ifdef UNIT_TEST 00557 friend class Ut_StatusIndicator; 00558 #endif 00559 00560 }; 00561 00562 #endif // STATUSINDICATOR_H
Copyright © 2011 Nokia Corporation | Generated on Tue Aug 30 2011 16:38:12 Doxygen 1.7.1 |
MeeGo Touch |