#include <QObject>
#include <QDateTime>
#include "Room.h"
+#include "WindowManager.h"
class QTimer;
class Clock;
Engine();
//! Destructor.
virtual ~Engine();
-
- //! Gets the clock instance used by the object to get up-to-date date and time info.
- /*!
- * Gets the clock instance used by the object to get up-to-date date and time info.
- * \return Pointer to the Clock instance.
- */
- Clock* clock();
- //! Gets the application's configuration.
- /*!
- * Gets the application's configuration.
- * \return Pointer to the Configuration instance.
- */
- Configuration* configuration();
//! Gets default room of the application.
/*!
* Gets default room of the application.
* \return Pointer to the default Room instance.
*/
Room* defaultRoom();
- //! Gets the deviceManager instance
- /*!
- * Gets the deviceManager instance.
- * \return Pointer to the deviceManager instance.
- */
- DeviceManager* deviceManager();
signals:
- //! Signal. Emitted if initialization of the current instance failed.
- /*!
- * Signal. Emitted if initialization of the current instance failed, if reading of the configuration
- * was not successful. It's purpose to inform the userinterface that the Engine is not ready for
- * controlling the application, application must be shut down.
- */
- void initializationFailed();
- //! Signal. Emitted if the availability information of the specified room changed.
- /*!
- * Signal. Emitted if the availability information of the specified room changed.
- * \param aRoom The Room instance which availability changed.
- * \param aStatus The status of the room.
- * \param aUntil Time until the spacified status is valid.
- */
- void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aUntil );
- //! Signal. Emitted if new meeting was found on the server.
- /*!
- * Signal. Emitted if new meeting was found on the server.
- * \param aMeeting The new meeting which was added.
- */
- void meetingAdded( Meeting *aMeeting );
- //! Signal. Emitted if meeting was deleted on the server.
- /*!
- * Signal. Emitted if meeting was deleted on the server.
- * \param aMeeting The meeting which was deleted.
- */
- void meetingDeleted( Meeting *aMeeting );
- //! Signal. Emitted error occured and error message must be shown on UI.
- /*!
- * Signal. Emitted error occured and error message must be shown on UI.
- * \param aErrorMessage The message.
- */
- void error( const QString &aErrorMessage );
- void meetingDetailsFetched( Meeting *aDetailedMeeting );
+ void meetingDetailsFetched( Meeting *aDetailedMeeting );
-public slots:
+private slots:
+ //! Slot. Closes the application.
+ /*!
+ * Slot. Closes the application.
+ */
+ void closeApplication();
//! Slot. Checks actual availability information of the specified room.
/*!
* Slot. Checks actual availability information of the specified room.
* \param aRoom The room which availability information is needed.
*/
void roomStatusInfoNeeded( Room *aRoom );
- //! Slot. Fetches meetings from the server.
+ //! Slot. Indicates that some user event has happened.
/*!
- * Slot. Fetches meetings from the server, exact parameters are specified in the parameter list.
- * \param aFrom Time from when the meetings need to be fetched.
- * \param aUntil Time until when the meetings need to be fetched.
- * \param aIn The room which meetings need to be fetched.
+ * Slot. Indicates that some user event has happened.
*/
- void fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, Room *aIn );
-
- void fetchMeetingDetails( Meeting * );
-
+ void observedEventDetected();
+ //! Slot. Asks the communication to fetch new meeting data.
/*!
- * Slot. Sets the current meeting room iCurrentRoom.
- * \param aCurrentRoom
+ * Slot. Asks the communication to fetch new meeting data.
+ * \param aCurrentRoom The current room.
*/
void currentRoomChanged( Room *aCurrentRoom );
-
-private slots:
+ //! Slot. Asks the communication to fetch new meeting data.
+ /*!
+ * Slot. Asks the communication to fetch new meeting data.
+ * \param aCurrentRoom The current room.
+ */
+ void shownWeekChanged( QDate aDate );
//! Slot. Handles errors.
/*!
* Slot. Handles errors and informs the UI by emitting the error() signal with the message in
* room storage and calling the roomStatusInfoNeeded() separately on each of them.
*/
void checkStatusOfAllRooms();
-
+ //! Slot for popping up the confirmation dialog to change the current operation mode
+ /*!
+ * Slot. Asks Window manager to pop up a confirmation dialog.
+ * \param aMode The operation mode to be changed to
+ */
+ void changeModeOrdered( DeviceManager::OperationMode aMode );
+ //! Slot. Fetches meeting details from the server.
+ /*!
+ * Slot. Fetches meeting details from the server.
+ * \param aMeeting The meeting.
+ */
+ void fetchMeetingDetails( Meeting *aMeeting );
+ //! Slot for receiving the status of the entered password
+ /*!
+ * Slot. Receives the status of the entered password and makes the DeviceManager to change the
+ * operation mode if the password is correct.
+ * \param aPasswordStatus The status of the password.
+ */
+ void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
+ //! Slot for receiving the cancel event of the progress bar.
+ /*!
+ * Slot. Receives the cancel event of the progress bar.
+ */
+ void progressBarCancelled();
+ //! Slot for receiving the cancel event of the progress bar.
+ /*!
+ * Receives the cancel event of the progress bar when meeting details requested.
+ */
+ void fetchMeetingDetailsCancelled();
+
private:
//! Provides the index of the Meeting instance which is at the specified time.
/*!
* \return True if contains; otherwise, false.
*/
static bool isMeetingInList( const QList<Meeting*> &aList, const Meeting *aMeeting );
+ //! Slot. Fetches meetings from the server.
+ /*!
+ * Slot. Fetches meetings from the server, exact parameters are specified in the parameter list.
+ * \param aFrom Time from when the meetings need to be fetched.
+ * \param aUntil Time until when the meetings need to be fetched.
+ * \param aIn The room which meetings need to be fetched.
+ */
+ void fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn );
private:
static QTime endOfTheDay;
+ WindowManager *iWindowManager;
+ QTimer *iIdleTimeCounter;
Clock *iClock;
Configuration *iConfiguration;
CommunicationManager *iCommunication;
QTimer *iAutoRefresh;
QList<Meeting*> iMeetings;
-
- Room *iCurrentRoom; /*! Not owned */
};
#endif /*ENGINE_H_*/