1 #ifndef WEEKLYVIEWWIDGET_H_
2 #define WEEKLYVIEWWIDGET_H_
9 class MeetingRoomCombo;
10 class TimeDisplayWidget;
15 class BorderedBarWidget;
17 //! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information.
19 * UserInterface class. Shows the current date and time and selected week's calendar for
20 * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate
21 * back to the current week.
23 class WeeklyViewWidget : public ViewBase
30 * Constructor to initialize an WeeklyViewWidget instance.
31 * \param aCurrentDateTime
32 * \param aConfiguration Pointer to the configuration object. Not owned.
33 * \param aParent Pointer to the parent widget.
35 WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 );
37 virtual ~WeeklyViewWidget();
41 * Returns the currently selected meeting room.
42 * \return Selected meeting room.
46 //! First day of week currently displayd
48 * Returns the first day of week currently displayd.
49 * \return First day of week.
51 QDate beginnigOfShownWeek();
52 //! Sends the refresh command to schedule widget.
54 * Sends the refresh command to schedule widget.
55 * \param aMeetings The list of meetings.
57 void refreshMeetings( const QList<Meeting*> &aMeetings );
59 void showCurrentWeek();
61 void setDefaultRoom();
64 //! Signals change of the meeting room.
66 * Signal is emited when meeting room is changed.
67 * \param aNewRoom Selected meeting room.
69 void currentRoomChanged( Room *aNewRoom );
70 //! Meeting activated.
72 * Signal is emitted when a meeting is clicked by the user.
73 * \param aMeeting actived meeting.
75 void meetingActivated( Meeting *aMeeting );
76 //! Signals creation of new meeting.
78 * Signal is emited when new meeting is created.
79 * \param aMeeting Meeting that has been created.
80 * \param aUsername User who created the meeting.
81 * \param aPassword Password of the "aUsername"
83 void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
84 //! Signals deletion of a meeting.
86 * Signal is emited when meeting is deleted.
87 * \param aMeeting Deleted meeting.
88 * \param aUsername User who deleted the meeting.
89 * \param aPassword Password of the "aUsername"
91 void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
92 //! Signals modifications of a meeting.
94 * Signal is emited when meeting is modified.
95 * \param aMeeting Modified meeting.
96 * \param aUsername User who modified the meeting.
97 * \param aPassword Password of the "aUsername"
99 void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
103 * Signal is emited when settings button is clicked.
105 void settingsButtonClicked();
107 //! Signal. Emitted if the shown week has been changed.
109 * Signal. Emitted if the shown week has been changed.
110 * \param aDate The first date of the shown week.
112 void shownWeekChanged( QDate aDate );
115 //! Slot. Sets the connection status
117 * Sets the current time, and connection status
118 * \param aCurrentTime Time to be displayed.
119 * \param aConnected connection status to be displayed.
120 * \param aLastUpdated Time of last successful connection to be displayed.
122 void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "" );
125 * Handle possible resize changes after the view is resized
126 * to match the window managers client area.
128 void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }
130 void showError( QString aError );
132 void connectionEstablished();
134 void connectionLost();
137 //! Displays the selectable meeting rooms.
138 MeetingRoomCombo *iRoomsCombo;
139 //! Displays the time.
140 BorderedBarWidget *iTimeDisplay;
141 //! Displays the status.
142 BorderedBarWidget *iStatusBar;
143 //! Displays the calendar.
144 ScheduleWidget *iSchedule;
145 //! Displays the date.
146 QLabel *iCurrentDayLabel;
147 //! Displays the week number.
148 QLabel *iCurrentWeekLabel;
149 //! Button used to display previous week's calendar.
150 QPushButton *iPreviousWeekButton;
151 //! Button used to display current week's calendar.
152 QPushButton *iCurrentWeekButton;
153 //! Button used to display next week's calendar.
154 QPushButton *iNextWeekButton;
155 //! Settings button. TODO : Correct widget is needed!!
156 QPushButton *iSettingsButton;
157 //! About button. TODO : Correct widget is needed!!
158 QPushButton *iAboutButton;
160 * Pointer to configuration object.
161 * Contains configurable data and IS NOT OWNED by the widget.
163 Configuration *iConfiguration;
166 #endif /*WEEKLYVIEWWIDGET_H_*/