1 #ifndef ROOMSTATUSINDICATORWIDGET_H_
\r
2 #define ROOMSTATUSINDICATORWIDGET_H_
\r
4 #include "ViewBase.h"
\r
7 #include <QTabletEvent>
\r
13 class BorderedBarWidget;
\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 the connection status
\r
48 * Sets the current time, and connection status
\r
49 * \param aCurrentTime Time to be displayed.
\r
50 * \param aConnected connection status to be displayed.
\r
51 * \param aLastUpdated Time of last successful connection to be displayed.
\r
53 void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "");
\r
54 //! Slot. Used to indicate changes in the status of the default room.
\r
56 * Slot. Used to indicate changes in the status of the default room. If the specified until time equals
\r
57 * with the end of the day, i.e. there are no further meetings today or the room is busy until the end
\r
58 * of the day, then not the until time is shown but a human readable informative message instead.
\r
59 * \param aStatus The new status of the meeting room.
\r
60 * \param aUntil The new time until the specified status is valid.
\r
62 void statusChanged( const Room::Status aStatus, const QTime aUntil );
\r
64 void showError( QString aError );
\r
66 void currentRoomChanged( Room *aRoom );
\r
68 void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }
\r
70 void connectionEstablished();
\r
72 void connectionLost();
\r
75 //! Translates the status into human readable text.
\r
77 * Translates the status into human readable text.
\r
78 * \param aStatus The status to be translated.
\r
79 * \return The string translation of the status.
\r
81 QString statusToText( const Room::Status aStatus );
\r
82 //! Creates a palette used to indicate background color based on the specified status.
\r
84 * Creates a palette used to indicate background color based on the specified status.
\r
85 * \param aStatus The status.
\r
86 * \return The palette.
\r
88 QPalette createPalette( Room::Status aStatus );
\r
91 QLabel *iDefaultRoomLabel;
\r
92 QLabel *iStatusLabel;
\r
93 QLabel *iUntilTextLabel;
\r
94 BorderedBarWidget *iTimeDisplay;
\r
95 BorderedBarWidget *iStatusBar;
\r
97 QString iTimeFormat;
\r
99 static QTime endOfTheDay;
\r
103 #endif /*ROOMSTATUSINDICATORWIDGET_H_*/
\r