X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FUserInterface%2FViews%2FWeeklyViewWidget.h;h=5ea4bf6137e62a316f356eea86c3bf993d7c3ff3;hb=6a31f3484996e9b7e719954c3a64a56d3fa586aa;hp=055617b6715351c35e0f9c97bd91f36fd074efba;hpb=59b4a9d85f3cd02e90c8efcecc66f9150f8a61f8;p=qtmeetings diff --git a/src/UserInterface/Views/WeeklyViewWidget.h b/src/UserInterface/Views/WeeklyViewWidget.h index 055617b..5ea4bf6 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.h +++ b/src/UserInterface/Views/WeeklyViewWidget.h @@ -1,155 +1,173 @@ -#ifndef WEEKLYVIEWWIDGET_H_ -#define WEEKLYVIEWWIDGET_H_ - -#include "ViewBase.h" -#include - -class QLabel; -class QPushButton; -class MeetingRoomCombo; -class TimeDisplayWidget; -class ScheduleWidget; -class Configuration; -class Meeting; -class Room; - -//! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information. -/*! - * UserInterface class. Shows the current date and time and selected week's calendar for - * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate - * back to the current week. - */ -class WeeklyViewWidget : public ViewBase -{ - Q_OBJECT - -public: - //! Constructor. - /*! - * Constructor to initialize an WeeklyViewWidget instance. - * \param aCurrentDateTime - * \param aConfiguration Pointer to the configuration object. Not owned. - * \param aParent Pointer to the parent widget. - */ - WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 ); - //! Destructor. - virtual ~WeeklyViewWidget(); - - //! Current room - /*! - * Returns the currently selected meeting room. - * \return Selected meeting room. - */ - Room* currentRoom(); - - //! First day of week currently displayd - /*! - * Returns the first day of week currently displayd. - * \return First day of week. - */ - QDate beginnigOfShownWeek(); - //! Sends the refresh command to schedule widget. - /*! - * Sends the refresh command to schedule widget. - * \param aMeetings The list of meetings. - */ - void refreshMeetings( const QList &aMeetings ); - - void showCurrentWeek(); - - void setDefaultRoom(); - -signals: - //! Signals change of the meeting room. - /*! - * Signal is emited when meeting room is changed. - * \param aNewRoom Selected meeting room. - */ - void currentRoomChanged( Room *aNewRoom ); - //! Meeting activated. - /*! - * Signal is emitted when a meeting is clicked by the user. - * \param aMeeting actived meeting. - */ - void meetingActivated( Meeting *aMeeting ); - //! Signals creation of new meeting. - /*! - * Signal is emited when new meeting is created. - * \param aMeeting Meeting that has been created. - * \param aUsername User who created the meeting. - * \param aPassword Password of the "aUsername" - */ - void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); - //! Signals deletion of a meeting. - /*! - * Signal is emited when meeting is deleted. - * \param aMeeting Deleted meeting. - * \param aUsername User who deleted the meeting. - * \param aPassword Password of the "aUsername" - */ - void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); - //! Signals modifications of a meeting. - /*! - * Signal is emited when meeting is modified. - * \param aMeeting Modified meeting. - * \param aUsername User who modified the meeting. - * \param aPassword Password of the "aUsername" - */ - void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); - - //! Signals - /*! - * Signal is emited when settings button is clicked. - */ - void settingsButtonClicked(); - - //! Signal. Emitted if the shown week has been changed. - /*! +#ifndef WEEKLYVIEWWIDGET_H_ +#define WEEKLYVIEWWIDGET_H_ + +#include "ViewBase.h" +#include + +class QLabel; +class QPushButton; +class MeetingRoomCombo; +class TimeDisplayWidget; +class ScheduleWidget; +class Configuration; +class Meeting; +class Room; +class BorderedBarWidget; + +//! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information. +/*! + * UserInterface class. Shows the current date and time and selected week's calendar for + * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate + * back to the current week. + */ +class WeeklyViewWidget : public ViewBase +{ + Q_OBJECT + +public: + //! Constructor. + /*! + * Constructor to initialize an WeeklyViewWidget instance. + * \param aCurrentDateTime + * \param aConfiguration Pointer to the configuration object. Not owned. + * \param aParent Pointer to the parent widget. + */ + WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 ); + //! Destructor. + virtual ~WeeklyViewWidget(); + + //! Current room + /*! + * Returns the currently selected meeting room. + * \return Selected meeting room. + */ + Room* currentRoom(); + + //! First day of week currently displayd + /*! + * Returns the first day of week currently displayd. + * \return First day of week. + */ + QDate beginnigOfShownWeek(); + //! Sends the refresh command to schedule widget. + /*! + * Sends the refresh command to schedule widget. + * \param aMeetings The list of meetings. + */ + void refreshMeetings( const QList &aMeetings ); + + void showCurrentWeek(); + + void setDefaultRoom(); + +signals: + //! Signals change of the meeting room. + /*! + * Signal is emited when meeting room is changed. + * \param aNewRoom Selected meeting room. + */ + void currentRoomChanged( Room *aNewRoom ); + //! Meeting activated. + /*! + * Signal is emitted when a meeting is clicked by the user. + * \param aMeeting actived meeting. + */ + void meetingActivated( Meeting *aMeeting ); + //! Signals creation of new meeting. + /*! + * Signal is emited when new meeting is created. + * \param aMeeting Meeting that has been created. + * \param aUsername User who created the meeting. + * \param aPassword Password of the "aUsername" + */ + void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); + //! Signals deletion of a meeting. + /*! + * Signal is emited when meeting is deleted. + * \param aMeeting Deleted meeting. + * \param aUsername User who deleted the meeting. + * \param aPassword Password of the "aUsername" + */ + void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); + //! Signals modifications of a meeting. + /*! + * Signal is emited when meeting is modified. + * \param aMeeting Modified meeting. + * \param aUsername User who modified the meeting. + * \param aPassword Password of the "aUsername" + */ + void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword ); + + //! Signals + /*! + * Signal is emited when settings button is clicked. + */ + void settingsButtonClicked(); + + //! Signals + /*! + * Signal is emited when refresh button is clicked. + */ + void refreshButtonClicked(); + + + //! Signal. Emitted if the shown week has been changed. + /*! * Signal. Emitted if the shown week has been changed. * \param aDate The first date of the shown week. */ - void shownWeekChanged( QDate aDate ); - -public slots: - //! Sets the date and time - /*! - * Sets the current date and time - * \param aCurrentDateTime Date and time to be displayd. - */ - void setCurrentDateTime( QDateTime aCurrentDateTime ); - //! Handle resizing - /*! - * Handle possible resize changes after the view is resized - * to match the window managers client area. - */ - void viewResized(const QSize &newSize, const QSize &oldSize) { } - -private: - //! Displays the selectable meeting rooms. - MeetingRoomCombo *iRoomsCombo; - //! Displays the time. - TimeDisplayWidget *iTimeDisplay; - //! Displays the calendar. - ScheduleWidget *iSchedule; - //! Displays the date. - QLabel *iCurrentDayLabel; - //! Displays the week number. - QLabel *iCurrentWeekLabel; - //! Button used to display previous week's calendar. - QPushButton *iPreviousWeekButton; - //! Button used to display current week's calendar. - QPushButton *iCurrentWeekButton; - //! Button used to display next week's calendar. - QPushButton *iNextWeekButton; - //! Settings button. TODO : Correct widget is needed!! - QPushButton *iSettingsButton; - //! About button. TODO : Correct widget is needed!! - QPushButton *iAboutButton; - /* ! - * Pointer to configuration object. - * Contains configurable data and IS NOT OWNED by the widget. - */ - Configuration *iConfiguration; -}; - -#endif /*WEEKLYVIEWWIDGET_H_*/ + void shownWeekChanged( QDate aDate ); + +public slots: + //! Slot. Sets the connection status + /*! + * Sets the current time, and connection status + * \param aCurrentTime Time to be displayed. + * \param aConnected connection status to be displayed. + * \param aLastUpdated Time of last successful connection to be displayed. + */ + void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "" ); + //! Handle resizing + /*! + * Handle possible resize changes after the view is resized + * to match the window managers client area. + */ + void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { } + + void showError( QString aError ); + + void connectionEstablished(); + + void connectionLost(); + +private: + //! Displays the selectable meeting rooms. + MeetingRoomCombo *iRoomsCombo; + //! Displays the time. + BorderedBarWidget *iTimeDisplay; + //! Displays the status. + BorderedBarWidget *iStatusBar; + //! Displays the calendar. + ScheduleWidget *iSchedule; + //! Displays the date. + QLabel *iCurrentDayLabel; + //! Displays the week number. + QLabel *iCurrentWeekLabel; + //! Button used to display previous week's calendar. + QPushButton *iPreviousWeekButton; + //! Button used to display current week's calendar. + QPushButton *iCurrentWeekButton; + //! Button used to display next week's calendar. + QPushButton *iNextWeekButton; + //! Settings button. TODO : Correct widget is needed!! + QPushButton *iSettingsButton; + //! About button. TODO : Correct widget is needed!! + QPushButton *iAboutButton; + /* ! + * Pointer to configuration object. + * Contains configurable data and IS NOT OWNED by the widget. + */ + Configuration *iConfiguration; +}; + +#endif /*WEEKLYVIEWWIDGET_H_*/