X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FBusinessLogic%2FEngine.h;h=99992dd71e78c51df2ffd2fa3689edaa03a2f0df;hb=bd153701307613c96e7bdf070cf32b0cbc6ae834;hp=14d27409f6e333d1e10eb4e482c181f57ea3504c;hpb=a0695f697226de46323a2d19cfad4e25d3e6de14;p=qtmeetings diff --git a/src/BusinessLogic/Engine.h b/src/BusinessLogic/Engine.h index 14d2740..99992dd 100644 --- a/src/BusinessLogic/Engine.h +++ b/src/BusinessLogic/Engine.h @@ -5,13 +5,15 @@ #include #include "Room.h" #include "WindowManager.h" +#include "DeviceManager.h" +#include "PasswordDialog.h" class QTimer; class Clock; class Configuration; class CommunicationManager; class Meeting; -class DeviceManager; +class UIManager; //! BusinessLogic class. Contains all the business logic of the application. /*! @@ -39,8 +41,6 @@ public: signals: - void meetingDetailsFetched( Meeting *aDetailedMeeting ); - private slots: //! Slot. Closes the application. /*! @@ -53,17 +53,6 @@ private slots: * \param aRoom The room which availability information is needed. */ void roomStatusInfoNeeded( Room *aRoom ); - //! Slot. Indicates that some user event has happened. - /*! - * Slot. Indicates that some user event has happened. - */ - void observedEventDetected(); - //! Slot. Asks the communication to fetch new meeting data. - /*! - * Slot. Asks the communication to fetch new meeting data. - * \param aCurrentRoom The current room. - */ - void currentRoomChanged( Room *aCurrentRoom ); //! Slot. Asks the communication to fetch new meeting data. /*! * Slot. Asks the communication to fetch new meeting data. @@ -83,7 +72,7 @@ private slots: * Slot. Fetches meetings from the server. Parameters are hard coded: the meetings of the default * room from current and +/- 2 weeks are fetched. */ - void fetchMeetings(); +// void fetchMeetings(); //! Slot. Saves fetched meetings to the current instance's local storage. /*! * Slot. Saves fetched meetings to the current instance's local storage. Meetings are soted in a @@ -92,34 +81,12 @@ private slots: * \param aMeetings The list of freshly fetched meetings. */ void meetingsFetched( const QList& ); - - void meetingDetailsFetched( Meeting &aDetailedMeeting ); - //! Slot. Checks the availability of all the rooms. /*! * Slot. Checks the availability of all the rooms by iterating through the current object's local * 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 failure event of operation mode changing. /*! * Slot. Receives the failure event of operation mode changing. @@ -129,9 +96,38 @@ private slots: /*! * Receives the cancel event of the progress bar when meeting details requested. */ - void fetchMeetingDetailsCancelled(); + void fetchMeetingDetails( Meeting *aMeeting ); + void cancelFetchMeetingDetails(); + + void handleViewEvent(); + void previousViewRestored(); + + //! Slot for dialog activation signal. + /*! + * This slot is used to inform that dialog is activated. It stops + * the idle time counter so screensaver is not activated while the + * dialog is displayed. + */ + void dialogActivated(); + //! Slot for dialog deactivation signal. + /*! + * This slot is used to inform that dialog is deactivated. It restarts + * the idle time counter so that the screensaver is being activated again + * as needed. + */ + void dialogDeactivated(); + + void stopIdleTimeCounter(); + void startIdleTimeCounter(); + void changeDeviceMode( bool aChange ); + + void currentRoomChanged( Room *aRoom ); + private: + // Make the UIManager as friendly class so it can connect to private slots. + friend class UIManager; + //! Provides the index of the Meeting instance which is at the specified time. /*! * Provides the index of the Meeting instance which is at the specified time. If there are @@ -158,20 +154,58 @@ private: * \param aIn The room which meetings need to be fetched. */ void fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn ); + //! Initialize configuration package. + /*! + * This method initializes configuration classes and + * connects signals from and to the engine. + */ + void initConfiguration(); + //! Initialize device package. + /*! + * This method initializes device manager and + * connects signals from and to the engine. + */ + void initDevice(); + //! Initialize communication package. + /*! + * This method initializes the communication manager and + * connects signals from and to the engine. + */ + void initCommunication(); + //! Initialize user interface package. + /*! + * This method initializes the user interface and + * connects signals from and to the engine. This method + * makes the window manager visible and shows weekly + * view as the first view. + */ + void initUserInterface(); + //! Connects signal between objects. + /*! + * Signals that could not be connected while initializing different + * packages are connected here. + */ + void connectSignals(); + bool isMeetingInList(const QList &aList, const Meeting *aMeeting); + private: static QTime endOfTheDay; WindowManager *iWindowManager; + QTimer *iIdleTimeCounter; Clock *iClock; Configuration *iConfiguration; CommunicationManager *iCommunication; DeviceManager *iDevice; + UIManager *iUIManager; QTimer *iAutoRefresh; QList iMeetings; + + Room *iCurrentRoom; }; #endif /*ENGINE_H_*/