1.0.6 candidate
[qtmeetings] / src / UserInterface / Views / WeeklyViewWidget.h
index 055617b..5ea4bf6 100644 (file)
-#ifndef WEEKLYVIEWWIDGET_H_\r
-#define WEEKLYVIEWWIDGET_H_\r
-\r
-#include "ViewBase.h"\r
-#include <QDateTime>\r
-\r
-class QLabel;\r
-class QPushButton;\r
-class MeetingRoomCombo;\r
-class TimeDisplayWidget;\r
-class ScheduleWidget;\r
-class Configuration;\r
-class Meeting;\r
-class Room;\r
-\r
-//! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information.\r
-/*!\r
- * UserInterface class. Shows the current date and time and selected week's calendar for\r
- * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate\r
- * back to the current week.\r
- */\r
-class WeeklyViewWidget : public ViewBase\r
-{\r
-       Q_OBJECT\r
-\r
-public:\r
-       //! Constructor.\r
-       /*!\r
-        * Constructor to initialize an WeeklyViewWidget instance.\r
-        * \param aCurrentDateTime\r
-        * \param aConfiguration Pointer to the configuration object. Not owned.\r
-        * \param aParent Pointer to the parent widget.\r
-        */\r
-       WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 );\r
-       //! Destructor.\r
-       virtual ~WeeklyViewWidget();\r
-\r
-       //! Current room\r
-       /*!\r
-        * Returns the currently selected meeting room.\r
-        * \return Selected meeting room.\r
-        */\r
-       Room* currentRoom();\r
-\r
-       //! First day of week currently displayd\r
-       /*!\r
-        * Returns the first day of week currently displayd.\r
-        * \return First day of week.\r
-        */\r
-       QDate beginnigOfShownWeek();\r
-       //! Sends the refresh command to schedule widget.\r
-       /*!\r
-        * Sends the refresh command to schedule widget.\r
-        * \param aMeetings The list of meetings.\r
-        */\r
-       void refreshMeetings( const QList<Meeting*> &aMeetings );\r
-       \r
-       void showCurrentWeek();\r
-       \r
-       void setDefaultRoom();\r
-       \r
-signals:\r
-       //! Signals change of the meeting room.\r
-       /*!\r
-        * Signal is emited when meeting room is changed.\r
-        * \param aNewRoom Selected meeting room.\r
-        */\r
-       void currentRoomChanged( Room *aNewRoom );\r
-       //! Meeting activated.\r
-       /*!\r
-        * Signal is emitted when a meeting is clicked by the user.\r
-        * \param aMeeting actived meeting.\r
-        */\r
-       void meetingActivated( Meeting *aMeeting );\r
-       //! Signals creation of new meeting.\r
-       /*!\r
-        * Signal is emited when new meeting is created.\r
-        * \param aMeeting Meeting that has been created.\r
-        * \param aUsername User who created the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-       //! Signals deletion of a meeting.\r
-       /*!\r
-        * Signal is emited when meeting is deleted.\r
-        * \param aMeeting Deleted meeting.\r
-        * \param aUsername User who deleted the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-       //! Signals modifications of a meeting.\r
-       /*!\r
-        * Signal is emited when meeting is modified.\r
-        * \param aMeeting Modified meeting.\r
-        * \param aUsername User who modified the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-\r
-       //! Signals\r
-       /*!\r
-        * Signal is emited when settings button is clicked.\r
-        */\r
-       void settingsButtonClicked();\r
-       \r
-       //! Signal. Emitted if the shown week has been changed.\r
-       /*!\r
+#ifndef WEEKLYVIEWWIDGET_H_
+#define WEEKLYVIEWWIDGET_H_
+
+#include "ViewBase.h"
+#include <QDateTime>
+
+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<Meeting*> &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 );\r
-\r
-public slots:\r
-       //! Sets the date and time\r
-       /*!\r
-        * Sets the current date and time\r
-        * \param aCurrentDateTime Date and time to be displayd.\r
-        */\r
-       void setCurrentDateTime( QDateTime aCurrentDateTime );\r
-       //! Handle resizing\r
-       /*!\r
-        * Handle possible resize changes after the view is resized\r
-        * to match the window managers client area.\r
-        */\r
-       void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
-\r
-private:\r
-       //! Displays the selectable meeting rooms.\r
-       MeetingRoomCombo *iRoomsCombo;\r
-       //! Displays the time.\r
-       TimeDisplayWidget *iTimeDisplay;\r
-       //! Displays the calendar.\r
-       ScheduleWidget *iSchedule;\r
-       //! Displays the date.\r
-       QLabel *iCurrentDayLabel;\r
-       //! Displays the week number.\r
-       QLabel *iCurrentWeekLabel;\r
-       //! Button used to display previous week's calendar.\r
-       QPushButton *iPreviousWeekButton;\r
-       //! Button used to display current week's calendar.\r
-       QPushButton *iCurrentWeekButton;\r
-       //! Button used to display next week's calendar.\r
-       QPushButton *iNextWeekButton;\r
-       //! Settings button. TODO : Correct widget is needed!!\r
-       QPushButton *iSettingsButton;\r
-       //! About button. TODO : Correct widget is needed!!\r
-       QPushButton *iAboutButton;\r
-       /* !\r
-        * Pointer to configuration object.\r
-        * Contains configurable data and IS NOT OWNED by the widget.\r
-        */\r
-       Configuration *iConfiguration;\r
-};\r
-\r
-#endif /*WEEKLYVIEWWIDGET_H_*/\r
+       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_*/