1 #ifndef ROOMSTATUSINDICATORWIDGET_H_
\r
2 #define ROOMSTATUSINDICATORWIDGET_H_
\r
4 #include "ViewBase.h"
\r
7 #include <QTabletEvent>
\r
13 class TimeDisplayWidget;
\r
17 //! UserInterface class. Indicates if the default meeting room is busy or not.
\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
24 class RoomStatusIndicatorWidget : public ViewBase
\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
39 RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );
\r
41 virtual ~RoomStatusIndicatorWidget();
\r
43 bool event(QEvent *event);
\r
46 //! Slot. Sets current time.
\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
52 void setCurrentTime( QTime aCurrentTime );
\r
53 //! Slot. Used to indicate changes in the status of the default room.
\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
61 void statusChanged( const Room::Status aStatus, const QTime aUntil );
\r
63 void viewResized(const QSize &newSize, const QSize &oldSize) { }
\r
66 //! Translates the status into human readable text.
\r
68 * Translates the status into human readable text.
\r
69 * \param aStatus The status to be translated.
\r
70 * \return The string translation of the status.
\r
72 QString statusToText( const Room::Status aStatus );
\r
73 //! Creates a palette used to indicate background color based on the specified status.
\r
75 * Creates a palette used to indicate background color based on the specified status.
\r
76 * \param aStatus The status.
\r
77 * \return The palette.
\r
79 QPalette createPalette( Room::Status aStatus );
\r
82 QLabel *iDefaultRoomLabel;
\r
83 QLabel *iStatusLabel;
\r
84 QLabel *iUntilTextLabel;
\r
85 TimeDisplayWidget *iTimeDisplay;
\r
86 QString iTimeFormat;
\r
88 static QTime endOfTheDay;
\r
92 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/
\r