1.0.6 candidate
[qtmeetings] / src / UserInterface / Views / RoomStatusIndicatorWidget.h
1 #ifndef ROOMSTATUSINDICATORWIDGET_H_\r
2 #define ROOMSTATUSINDICATORWIDGET_H_\r
3 \r
4 #include "ViewBase.h"\r
5 #include <QTime>\r
6 #include <QKeyEvent>\r
7 #include <QTabletEvent>\r
8 \r
9 #include "Room.h"\r
10 \r
11 class QLabel;\r
12 class QVBoxLayout;\r
13 class BorderedBarWidget;\r
14 \r
15 class QEvent;\r
16 \r
17 //! UserInterface class. Indicates if the default meeting room is busy or not.\r
18 /*!\r
19  * UserInterface class. Indicates if the default meeting room is busy or not. This widget\r
20  * appears on the screen if there was no user interaction with the device for a ceratin period of time,\r
21  * and disappears if there is any. Its function is to behave like a screen saver on one hand, and\r
22  * to provide details about the current availability on the other hand.\r
23  */\r
24 class RoomStatusIndicatorWidget : public ViewBase\r
25 {\r
26         Q_OBJECT\r
27 \r
28 public:\r
29         //! Contructor.\r
30         /*!\r
31          * Constructor to initialize RoomStatusIndicatorWidget instances.\r
32          * \param aDefaultRoom The room which's status is indicated by the current instance.\r
33          * \param aStatus The current status of the room.\r
34          * \param aUntil Time until the availability information is valid.\r
35          * \param aTimeFormat Time format string.\r
36          * \param aParent Pointer to the parent widget. Optional.\r
37          *\r
38          */\r
39         RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );\r
40         //! Destructor.\r
41         virtual ~RoomStatusIndicatorWidget();\r
42         \r
43         bool event(QEvent *event);\r
44 \r
45 public slots:\r
46         //! Slot. Sets the connection status\r
47         /*!\r
48          * Sets the current time, and connection status\r
49          * \param aCurrentTime Time to be displayed.\r
50          * \param aConnected connection status to be displayed.\r
51          * \param aLastUpdated Time of last successful connection to be displayed.\r
52          */\r
53         void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "");\r
54         //! Slot. Used to indicate changes in the status of the default room.\r
55         /*!\r
56          * Slot. Used to indicate changes in the status of the default room. If the specified until time equals\r
57          * with the end of the day, i.e. there are no further meetings today or the room is busy until the end\r
58          * of the day, then not the until time is shown but a human readable informative message instead.\r
59          * \param aStatus The new status of the meeting room.\r
60          * \param aUntil The new time until the specified status is valid.\r
61          */\r
62         void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
63         \r
64         void showError( QString aError );\r
65 \r
66         void currentRoomChanged( Room *aRoom );\r
67         \r
68         void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }\r
69 \r
70         void connectionEstablished();\r
71         \r
72         void connectionLost();\r
73         \r
74 private:\r
75         //! Translates the status into human readable text.\r
76         /*!\r
77          * Translates the status into human readable text.\r
78          * \param aStatus The status to be translated.\r
79          * \return The string translation of the status.\r
80          */\r
81         QString statusToText( const Room::Status aStatus );\r
82         //! Creates a palette used to indicate background color based on the specified status.\r
83         /*!\r
84          * Creates a palette used to indicate background color based on the specified status.\r
85          * \param aStatus The status.\r
86          * \return The palette.\r
87          */\r
88         QPalette createPalette( Room::Status aStatus );\r
89 \r
90 private:\r
91         QLabel *iDefaultRoomLabel;\r
92         QLabel *iStatusLabel;\r
93         QLabel *iUntilTextLabel;\r
94         BorderedBarWidget *iTimeDisplay;\r
95         BorderedBarWidget *iStatusBar;\r
96 \r
97         QString iTimeFormat;\r
98 \r
99         static QTime endOfTheDay;\r
100 \r
101 };\r
102 \r
103 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/\r