643160aa0b77452bcbad46d36aa225d85162b19c
[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 TimeDisplayWidget;\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 current time.\r
47         /*!\r
48          * Slots. Sets current time on the widget. It is used to provide up-to-date time for the widget's\r
49          * TimeDisplayWidget.\r
50          * \param aCurrentTime The current time.\r
51          */\r
52         void setCurrentTime( QTime aCurrentTime );\r
53         //! Slot. Used to indicate changes in the status of the default room.\r
54         /*!\r
55          * Slot. Used to indicate changes in the status of the default room. If the specified until time equals\r
56          * with the end of the day, i.e. there are no further meetings today or the room is busy until the end\r
57          * of the day, then not the until time is shown but a human readable informative message instead.\r
58          * \param aStatus The new status of the meeting room.\r
59          * \param aUntil The new time until the specified status is valid.\r
60          */\r
61         void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
62         \r
63         void currentRoomChanged( Room *aRoom );\r
64         \r
65         void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
66 \r
67         void connectionEstablished();\r
68         \r
69         void connectionLost();\r
70         \r
71 private:\r
72         //! Translates the status into human readable text.\r
73         /*!\r
74          * Translates the status into human readable text.\r
75          * \param aStatus The status to be translated.\r
76          * \return The string translation of the status.\r
77          */\r
78         QString statusToText( const Room::Status aStatus );\r
79         //! Creates a palette used to indicate background color based on the specified status.\r
80         /*!\r
81          * Creates a palette used to indicate background color based on the specified status.\r
82          * \param aStatus The status.\r
83          * \return The palette.\r
84          */\r
85         QPalette createPalette( Room::Status aStatus );\r
86 \r
87 private:\r
88         QLabel *iDefaultRoomLabel;\r
89         QLabel *iStatusLabel;\r
90         QLabel *iUntilTextLabel;\r
91         QLabel *iConnectionLabel;\r
92         TimeDisplayWidget *iTimeDisplay;\r
93         QString iTimeFormat;\r
94 \r
95         static QTime endOfTheDay;\r
96 \r
97 };\r
98 \r
99 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/\r