User interface update
[qtmeetings] / src / UserInterface / Views / WeeklyViewWidget.h
1 #ifndef WEEKLYVIEWWIDGET_H_
2 #define WEEKLYVIEWWIDGET_H_
3
4 #include "ViewBase.h"
5 #include <QDateTime>
6
7 class QLabel;
8 class QPushButton;
9 class MeetingRoomCombo;
10 class TimeDisplayWidget;
11 class ScheduleWidget;
12 class Configuration;
13 class Meeting;
14 class Room;
15 class BorderedBarWidget;
16
17 //! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information.
18 /*!
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.
22  */
23 class WeeklyViewWidget : public ViewBase
24 {
25         Q_OBJECT
26
27 public:
28         //! Constructor.
29         /*!
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.
34          */
35         WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 );
36         //! Destructor.
37         virtual ~WeeklyViewWidget();
38
39         //! Current room
40         /*!
41          * Returns the currently selected meeting room.
42          * \return Selected meeting room.
43          */
44         Room* currentRoom();
45
46         //! First day of week currently displayd
47         /*!
48          * Returns the first day of week currently displayd.
49          * \return First day of week.
50          */
51         QDate beginnigOfShownWeek();
52         //! Sends the refresh command to schedule widget.
53         /*!
54          * Sends the refresh command to schedule widget.
55          * \param aMeetings The list of meetings.
56          */
57         void refreshMeetings( const QList<Meeting*> &aMeetings );
58         
59         void showCurrentWeek();
60         
61         void setDefaultRoom();
62         
63 signals:
64         //! Signals change of the meeting room.
65         /*!
66          * Signal is emited when meeting room is changed.
67          * \param aNewRoom Selected meeting room.
68          */
69         void currentRoomChanged( Room *aNewRoom );
70         //! Meeting activated.
71         /*!
72          * Signal is emitted when a meeting is clicked by the user.
73          * \param aMeeting actived meeting.
74          */
75         void meetingActivated( Meeting *aMeeting );
76         //! Signals creation of new meeting.
77         /*!
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"
82          */
83         void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
84         //! Signals deletion of a meeting.
85         /*!
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"
90          */
91         void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
92         //! Signals modifications of a meeting.
93         /*!
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"
98          */
99         void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
100
101         //! Signals
102         /*!
103          * Signal is emited when settings button is clicked.
104          */
105         void settingsButtonClicked();
106         
107         //! Signal. Emitted if the shown week has been changed.
108         /*!
109          * Signal. Emitted if the shown week has been changed.
110          * \param aDate The first date of the shown week.
111          */
112         void shownWeekChanged( QDate aDate );
113
114 public slots:
115         //! Sets the date and time
116         /*!
117          * Sets the current date and time
118          * \param aCurrentDateTime Date and time to be displayd.
119          */
120         void setCurrentDateTime( QDateTime aCurrentDateTime );
121         //! Handle resizing
122         /*!
123          * Handle possible resize changes after the view is resized
124          * to match the window managers client area.
125          */
126         void viewResized(const QSize &newSize, const QSize &oldSize) { }
127
128         void connectionEstablished();
129
130         void connectionLost();
131
132 private:
133         //! Displays the selectable meeting rooms.
134         MeetingRoomCombo *iRoomsCombo;
135         //! Displays the time.
136         BorderedBarWidget *iTimeDisplay;
137         //! Displays the status.
138         BorderedBarWidget *iStatusBar;
139         //! Displays the calendar.
140         ScheduleWidget *iSchedule;
141         //! Displays the date.
142         QLabel *iCurrentDayLabel;
143         //! Displays the week number.
144         QLabel *iCurrentWeekLabel;
145         //! Button used to display previous week's calendar.
146         QPushButton *iPreviousWeekButton;
147         //! Button used to display current week's calendar.
148         QPushButton *iCurrentWeekButton;
149         //! Button used to display next week's calendar.
150         QPushButton *iNextWeekButton;
151         //! Settings button. TODO : Correct widget is needed!!
152         QPushButton *iSettingsButton;
153         //! About button. TODO : Correct widget is needed!!
154         QPushButton *iAboutButton;
155         /* !
156          * Pointer to configuration object.
157          * Contains configurable data and IS NOT OWNED by the widget.
158          */
159         Configuration *iConfiguration;
160 };
161
162 #endif /*WEEKLYVIEWWIDGET_H_*/