1 #ifndef ROOMSTATUSINDICATORWIDGET_H_
\r
2 #define ROOMSTATUSINDICATORWIDGET_H_
\r
4 #include "ObservedWidget.h"
\r
7 #include <QTabletEvent>
\r
13 class TimeDisplayWidget;
\r
15 //! UserInterface class. Indicates if the default meeting room is busy or not.
\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
22 class RoomStatusIndicatorWidget : public ObservedWidget
\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
37 RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );
\r
39 virtual ~RoomStatusIndicatorWidget();
\r
42 //! Slot. Sets current time.
\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
48 void setCurrentTime( QTime aCurrentTime );
\r
49 //! Slot. Used to indicate changes in the status of the default room.
\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
57 void statusChanged( const Room::Status aStatus, const QTime aUntil );
\r
60 //! Translates the status into human readable text.
\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
66 QString statusToText( const Room::Status aStatus );
\r
67 //! Creates a palette used to indicate background color based on the specified status.
\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
73 QPalette createPalette( Room::Status aStatus );
\r
76 QLabel *iDefaultRoomLabel;
\r
77 QLabel *iStatusLabel;
\r
78 QLabel *iUntilTextLabel;
\r
79 QLabel *iConnectionLabel;
\r
80 TimeDisplayWidget *iTimeDisplay;
\r
81 QString iTimeFormat;
\r
83 static QTime endOfTheDay;
\r
87 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/
\r