#include <SessionManager.h>

Public Types | |
| enum | SerializationStatusEnum { SUCCESS, PARTIAL_SUCCESS, LOCKED, FAILURE } |
| typedef EnumWrapper < SerializationStatusEnum > | SerializationStatus |
Public Member Functions | |
| virtual std::string | getName () const =0 |
| virtual std::pair < SerializationStatus, std::vector< std::pair < SessionItem *, std::string > > > | serialize (const std::string &filename, Progress *pProgress)=0 |
| virtual SessionItem * | getSessionItem (const std::string &id)=0 |
| virtual bool | isSessionSaving () const =0 |
| virtual bool | isSessionLoading () const =0 |
| virtual bool | isSessionSaveLocked () const =0 |
Static Public Member Functions | |
| static SessionSaveType | getSettingQueryForSave () |
| static bool | hasSettingQueryForSave () |
| static void | setSettingQueryForSave (SessionSaveType newValue, bool setIfSame=false) |
| static std::string | getSettingQueryForSaveKey () |
| static bool | getSettingAutoSaveEnabled () |
| static bool | hasSettingAutoSaveEnabled () |
| static void | setSettingAutoSaveEnabled (bool newValue, bool setIfSame=false) |
| static std::string | getSettingAutoSaveEnabledKey () |
| static unsigned int | getSettingAutoSaveInterval () |
| static bool | hasSettingAutoSaveInterval () |
| static void | setSettingAutoSaveInterval (unsigned int newValue, bool setIfSame=false) |
| static std::string | getSettingAutoSaveIntervalKey () |
| static const std::string & | signalAboutToSaveSession () |
| static const std::string & | signalAboutToRestore () |
| static const std::string & | signalSessionRestored () |
| static const std::string & | signalSessionSaved () |
| static const std::string & | signalClosed () |
Protected Member Functions | |
| virtual | ~SessionManager () |
| virtual void | lockSessionSave ()=0 |
| virtual void | unlockSessionSave ()=0 |
The session-save process is as follows: 1) The session manager retrieves a pointer to each SessionItem, including: a) Data Elements b) Windows c) Views d) Layers e) PlotSets f) Plot Widgets g) Animation Controllers i) Animations j) Modules k) PlugIn Descriptors l) PlugIn instances 2) The session directory is created, if necessary 3) The session directory is cleared of obsolete SessionItem files 4) For each SessionItem, it creates a SessionItemSerializer and calls SessionItem::serialize() 5) The Session index file is written.
This subclass of Subject will notify upon the following conditions:
Definition at line 54 of file SessionManager.h.
| typedef EnumWrapper<SerializationStatusEnum> SessionManager::SerializationStatus |
The EnumWrapper contains a given enum value and provides a isValid() method which returns true if the contained enum value is valid.
Please see How To Use EnumWrapper for more information. The wrapped enum values are SessionManager::SerializationStatusEnum.
Definition at line 71 of file SessionManager.h.
Specifies the success of an attempt to serialize the session.
Definition at line 60 of file SessionManager.h.
| virtual SessionManager::~SessionManager | ( | ) | [protected, virtual] |
This will be cleaned up during application close.
Plug-ins do not need to destroy it.
Definition at line 300 of file SessionManager.h.
| static SessionSaveType SessionManager::getSettingQueryForSave | ( | ) | [static] |
Returns the current value for this setting.
If this setting does not exist in ConfigurationSettings, a verification error will be logged to the message log and potentially a verification error message box will be displayed to the user.
Please see Settings Macros for more details
Definition at line 83 of file SessionManager.h.
| static bool SessionManager::hasSettingQueryForSave | ( | ) | [static] |
Returns true if this setting exists and has a value in ConfigurationSettings.
Please see Settings Macros for more details
true if this setting exists, false otherwise. Definition at line 90 of file SessionManager.h.
| static void SessionManager::setSettingQueryForSave | ( | SessionSaveType | newValue, | |
| bool | setIfSame = false | |||
| ) | [static] |
Changes the current value of this setting to the new value.
Please see Settings Macros for more details
| newValue | the new value for this setting. | |
| setIfSame | If true, the value will be set into ConfigurationSettings even if the newValue and existing value are the same. This has the side-effect of making the value a per-user setting and stored in the user's configuration file. If false, this value will only be set if the newValue and existing value are different. Therefore the value will only be stored in the user's configuration file if the newValue is unique to the user. |
Definition at line 106 of file SessionManager.h.
| static std::string SessionManager::getSettingQueryForSaveKey | ( | ) | [static] |
Returns the key for this setting that could be passed to ConfigurationSettings::getSetting() or ConfigurationSettings::setSetting().
Please see Settings Macros for more details
Definition at line 114 of file SessionManager.h.
| static bool SessionManager::getSettingAutoSaveEnabled | ( | ) | [static] |
Returns the current value for this setting.
If this setting does not exist in ConfigurationSettings, a verification error will be logged to the message log and potentially a verification error message box will be displayed to the user.
Please see Settings Macros for more details
Definition at line 125 of file SessionManager.h.
| static bool SessionManager::hasSettingAutoSaveEnabled | ( | ) | [static] |
Returns true if this setting exists and has a value in ConfigurationSettings.
Please see Settings Macros for more details
true if this setting exists, false otherwise. Definition at line 132 of file SessionManager.h.
| static void SessionManager::setSettingAutoSaveEnabled | ( | bool | newValue, | |
| bool | setIfSame = false | |||
| ) | [static] |
Changes the current value of this setting to the new value.
Please see Settings Macros for more details
| newValue | the new value for this setting. | |
| setIfSame | If true, the value will be set into ConfigurationSettings even if the newValue and existing value are the same. This has the side-effect of making the value a per-user setting and stored in the user's configuration file. If false, this value will only be set if the newValue and existing value are different. Therefore the value will only be stored in the user's configuration file if the newValue is unique to the user. |
Definition at line 148 of file SessionManager.h.
| static std::string SessionManager::getSettingAutoSaveEnabledKey | ( | ) | [static] |
Returns the key for this setting that could be passed to ConfigurationSettings::getSetting() or ConfigurationSettings::setSetting().
Please see Settings Macros for more details
Definition at line 156 of file SessionManager.h.
| static unsigned int SessionManager::getSettingAutoSaveInterval | ( | ) | [static] |
Returns the current value for this setting.
If this setting does not exist in ConfigurationSettings, a verification error will be logged to the message log and potentially a verification error message box will be displayed to the user.
Please see Settings Macros for more details
Definition at line 167 of file SessionManager.h.
| static bool SessionManager::hasSettingAutoSaveInterval | ( | ) | [static] |
Returns true if this setting exists and has a value in ConfigurationSettings.
Please see Settings Macros for more details
true if this setting exists, false otherwise. Definition at line 174 of file SessionManager.h.
| static void SessionManager::setSettingAutoSaveInterval | ( | unsigned int | newValue, | |
| bool | setIfSame = false | |||
| ) | [static] |
Changes the current value of this setting to the new value.
Please see Settings Macros for more details
| newValue | the new value for this setting. | |
| setIfSame | If true, the value will be set into ConfigurationSettings even if the newValue and existing value are the same. This has the side-effect of making the value a per-user setting and stored in the user's configuration file. If false, this value will only be set if the newValue and existing value are different. Therefore the value will only be stored in the user's configuration file if the newValue is unique to the user. |
Definition at line 190 of file SessionManager.h.
| static std::string SessionManager::getSettingAutoSaveIntervalKey | ( | ) | [static] |
Returns the key for this setting that could be passed to ConfigurationSettings::getSetting() or ConfigurationSettings::setSetting().
Please see Settings Macros for more details
Definition at line 198 of file SessionManager.h.
| static const std::string& SessionManager::signalAboutToSaveSession | ( | ) | [static] |
Emitted with a null boost::any just prior to saving a session.
Definition at line 203 of file SessionManager.h.
| static const std::string& SessionManager::signalAboutToRestore | ( | ) | [static] |
Emitted with a null boost::any just prior to restoring a session.
Definition at line 208 of file SessionManager.h.
| static const std::string& SessionManager::signalSessionRestored | ( | ) | [static] |
Emitted with a null boost::any when the session has finished restoring itself.
Definition at line 213 of file SessionManager.h.
| static const std::string& SessionManager::signalSessionSaved | ( | ) | [static] |
Emitted after the session save has finished with a boost::any<std::pair<SerializationStatus, std::string>> containing the status of the serialization and the filename of the saved session.
If the status is FAILURE, the filename string will be empty.
Definition at line 220 of file SessionManager.h.
| static const std::string& SessionManager::signalClosed | ( | ) | [static] |
Emitted when a session is closed.
The session is still fully created when this signal is emitted.
Definition at line 227 of file SessionManager.h.
| virtual std::string SessionManager::getName | ( | ) | const [pure virtual] |
Gets the name of the current session.
This method returns the unique name given to the session when it was created. This will be in the form of a UUID.
| virtual std::pair<SerializationStatus,std::vector<std::pair<SessionItem*, std::string> > > SessionManager::serialize | ( | const std::string & | filename, | |
| Progress * | pProgress | |||
| ) | [pure virtual] |
Saves the current session.
This method saves all data, windows, layers, animations and active plug-ins to disk so they can be restored to the same state later.
| filename | The full pathname of the file the session is to be saved in. | |
| pProgress | If not NULL, progress during session save will be reported to the supplied Progress object. |
| virtual SessionItem* SessionManager::getSessionItem | ( | const std::string & | id | ) | [pure virtual] |
Retrieves a SessionItem during session restore based on its id.
This method retrieves a specified session item during restore. It is only guaranteed to work during session restore.
| id | The session id of the SessionItem to retrieve |
NULL otherwise. | virtual bool SessionManager::isSessionSaving | ( | ) | const [pure virtual] |
Is the session currently saving?
| virtual bool SessionManager::isSessionLoading | ( | ) | const [pure virtual] |
Is the session currently loading?
| virtual bool SessionManager::isSessionSaveLocked | ( | ) | const [pure virtual] |
Is session save locked?
If this returns true, calls to serialize() will fail.
| virtual void SessionManager::lockSessionSave | ( | ) | [protected, pure virtual] |
Prevent the session from saving.
Locking session save will cause calls to serialize() to fail.
| virtual void SessionManager::unlockSessionSave | ( | ) | [protected, pure virtual] |
Unlock session saving.
This reverses a previous call to lockSessionSave(). If multiple calls to lockSessionSave() have been made, this unlocks one of those calls.