defuze.me
Client
|
00001 /************************************************************************** 00002 ** defuze.me Epitech Innovative Project 00003 ** 00004 ** Copyright 2010-2011 00005 ** Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard 00006 ** Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier 00007 ** 00008 ** All rights reserved. 00009 **************************************************************************/ 00010 00011 namespace Notification { 00012 class Status; 00013 } 00014 00015 #ifndef STATUS_HPP 00016 #define STATUS_HPP 00017 00018 #include "staticplugin.hpp" 00019 #include "statuswidget.hpp" 00020 #include "message.hpp" 00021 00022 namespace Notification 00023 { 00024 // Some pre-defined icons 00025 const QString OK = ":/icons/tick"; 00026 const QString INFO = ":/icons/info"; 00027 const QString SYNC = ":/icons/sync"; 00028 const QString WARN = ":/icons/warning"; 00029 const QString ERR = ":/icons/error"; 00030 const QString DEVICE = ":/icons/device-small"; 00031 00036 class Status : public QObject, public StaticPlugin 00037 { 00038 Q_OBJECT 00039 public: 00040 explicit Status(); 00041 ~Status(); 00042 void aboutToQuit(); 00043 void init(); 00044 static void gMessage(const QString &msg, const QString& pix = INFO); 00045 00046 signals: 00047 void forwardMessage(QString, QString); 00048 00049 public slots: 00050 Message* message(const QString &msg, const QString& pix = INFO); 00051 00052 private: 00053 StatusWidget* widget; 00054 Gui::Module *uiModule; 00055 Message* lastMessage; 00056 static Status *instance; 00057 static QList<QPair<QString, QString> > waitList; 00058 }; 00059 } 00060 00061 #endif // STATUS_HPP