1 #ifndef ROOMSTATUSINDICATORWIDGET_H_
\r
2 #define ROOMSTATUSINDICATORWIDGET_H_
\r
4 #include "ViewBase.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 ViewBase
\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
59 void viewResized(const QSize &newSize, const QSize &oldSize) { }
\r
62 //! Translates the status into human readable text.
\r
64 * Translates the status into human readable text.
\r
65 * \param aStatus The status to be translated.
\r
66 * \return The string translation of the status.
\r
68 QString statusToText( const Room::Status aStatus );
\r
69 //! Creates a palette used to indicate background color based on the specified status.
\r
71 * Creates a palette used to indicate background color based on the specified status.
\r
72 * \param aStatus The status.
\r
73 * \return The palette.
\r
75 QPalette createPalette( Room::Status aStatus );
\r
78 QLabel *iDefaultRoomLabel;
\r
79 QLabel *iStatusLabel;
\r
80 QLabel *iUntilTextLabel;
\r
81 QLabel *iConnectionLabel;
\r
82 TimeDisplayWidget *iTimeDisplay;
\r
83 QString iTimeFormat;
\r
85 static QTime endOfTheDay;
\r
89 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/
\r