qtmeetings sources to Maemo garage
[qtmeetings] / src / UserInterface / Views / RoomStatusIndicatorWidget.h
1 #ifndef ROOMSTATUSINDICATORWIDGET_H_\r
2 #define ROOMSTATUSINDICATORWIDGET_H_\r
3 \r
4 #include "ObservedWidget.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 //! UserInterface class. Indicates if the default meeting room is busy or not.\r
16 /*!\r
17  * UserInterface class. Indicates if the default meeting room is busy or not. This widget\r
18  * appears on the screen if there was no user interaction with the device for a ceratin period of time,\r
19  * and disappears if there is any. Its function is to behave like a screen saver on one hand, and\r
20  * to provide details about the current availability on the other hand.\r
21  */\r
22 class RoomStatusIndicatorWidget : public ObservedWidget\r
23 {\r
24         Q_OBJECT\r
25 \r
26 public:\r
27         //! Contructor.\r
28         /*!\r
29          * Constructor to initialize RoomStatusIndicatorWidget instances.\r
30          * \param aDefaultRoom The room which's status is indicated by the current instance.\r
31          * \param aStatus The current status of the room.\r
32          * \param aUntil Time until the availability information is valid.\r
33          * \param aTimeFormat Time format string.\r
34          * \param aParent Pointer to the parent widget. Optional.\r
35          *\r
36          */\r
37         RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );\r
38         //! Destructor.\r
39         virtual ~RoomStatusIndicatorWidget();\r
40 \r
41 public slots:\r
42         //! Slot. Sets current time.\r
43         /*!\r
44          * Slots. Sets current time on the widget. It is used to provide up-to-date time for the widget's\r
45          * TimeDisplayWidget.\r
46          * \param aCurrentTime The current time.\r
47          */\r
48         void setCurrentTime( QTime aCurrentTime );\r
49         //! Slot. Used to indicate changes in the status of the default room.\r
50         /*!\r
51          * Slot. Used to indicate changes in the status of the default room. If the specified until time equals\r
52          * with the end of the day, i.e. there are no further meetings today or the room is busy until the end\r
53          * of the day, then not the until time is shown but a human readable informative message instead.\r
54          * \param aStatus The new status of the meeting room.\r
55          * \param aUntil The new time until the specified status is valid.\r
56          */\r
57         void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
58 \r
59 private:\r
60         //! Translates the status into human readable text.\r
61         /*!\r
62          * Translates the status into human readable text.\r
63          * \param aStatus The status to be translated.\r
64          * \return The string translation of the status.\r
65          */\r
66         QString statusToText( const Room::Status aStatus );\r
67         //! Creates a palette used to indicate background color based on the specified status.\r
68         /*!\r
69          * Creates a palette used to indicate background color based on the specified status.\r
70          * \param aStatus The status.\r
71          * \return The palette.\r
72          */\r
73         QPalette createPalette( Room::Status aStatus );\r
74 \r
75 private:\r
76         QLabel *iDefaultRoomLabel;\r
77         QLabel *iStatusLabel;\r
78         QLabel *iUntilTextLabel;\r
79         TimeDisplayWidget *iTimeDisplay;\r
80         QString iTimeFormat;\r
81 \r
82         static QTime endOfTheDay;\r
83 \r
84 };\r
85 \r
86 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/\r