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();
109 * Signal is emited when refresh button is clicked.
111 void refreshButtonClicked();
114 //! Signal. Emitted if the shown week has been changed.
116 * Signal. Emitted if the shown week has been changed.
117 * \param aDate The first date of the shown week.
119 void shownWeekChanged( QDate aDate );
122 //! Slot. Sets the connection status
124 * Sets the current time, and connection status
125 * \param aCurrentTime Time to be displayed.
126 * \param aConnected connection status to be displayed.
127 * \param aLastUpdated Time of last successful connection to be displayed.
129 void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "" );
132 * Handle possible resize changes after the view is resized
133 * to match the window managers client area.
135 void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }
137 void showError( QString aError );
139 void connectionEstablished();
141 void connectionLost();
144 //! Displays the selectable meeting rooms.
145 MeetingRoomCombo *iRoomsCombo;
146 //! Displays the time.
147 BorderedBarWidget *iTimeDisplay;
148 //! Displays the status.
149 BorderedBarWidget *iStatusBar;
150 //! Displays the calendar.
151 ScheduleWidget *iSchedule;
152 //! Displays the date.
153 QLabel *iCurrentDayLabel;
154 //! Displays the week number.
155 QLabel *iCurrentWeekLabel;
156 //! Button used to display previous week's calendar.
157 QPushButton *iPreviousWeekButton;
158 //! Button used to display current week's calendar.
159 QPushButton *iCurrentWeekButton;
160 //! Button used to display next week's calendar.
161 QPushButton *iNextWeekButton;
162 //! Settings button. TODO : Correct widget is needed!!
163 QPushButton *iSettingsButton;
164 //! About button. TODO : Correct widget is needed!!
165 QPushButton *iAboutButton;
167 * Pointer to configuration object.
168 * Contains configurable data and IS NOT OWNED by the widget.
170 Configuration *iConfiguration;
173 #endif /*WEEKLYVIEWWIDGET_H_*/