SessionItem Class Reference

The base class for all objects in a session. More...

#include <SessionItem.h>

Inheritance diagram for SessionItem:

Inheritance graph

List of all members.

Public Member Functions

virtual const std::string & getId () const =0
virtual const QIcon & getIcon () const =0
virtual const std::string & getName () const =0
virtual const std::string & getDisplayName (bool fullName=false) const =0
virtual const std::string & getDisplayText () const =0
virtual std::list
< ContextMenuAction
getContextMenuActions () const =0
virtual bool hasFilenameDisplay () const =0
virtual std::vector< std::string > getPropertiesPages () const =0
virtual bool isValidSessionSaveItem () const =0
virtual bool serialize (SessionItemSerializer &serializer) const =0
virtual bool deserialize (SessionItemDeserializer &deserializer)=0

Protected Member Functions

virtual ~SessionItem ()


Detailed Description

The base class for all objects in a session.

The SessionItem class is a base class for all objects that are included in a session.

Definition at line 29 of file SessionItem.h.


Constructor & Destructor Documentation

virtual SessionItem::~SessionItem (  )  [protected, virtual]

The session item should be destroyed by calling one of the destruction methods to destroy the specific subclass instance.

Definition at line 183 of file SessionItem.h.


Member Function Documentation

virtual const std::string& SessionItem::getId (  )  const [pure virtual]

Returns a unique ID for the session item.

The session item ID is automatically assigned when the item is created. It is unique for all session items in the current session.

Returns:
The unique ID for the session item as a text string. The string has the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} where 'x' is a hexidecimal digit.

Implemented in PlugInShell.

virtual const QIcon& SessionItem::getIcon (  )  const [pure virtual]

Returns the icon associated with the session item.

Returns:
The item icon.

Implemented in PlugInShell.

virtual const std::string& SessionItem::getName (  )  const [pure virtual]

Returns the session item name.

The session item name is the full name of the session item. This can be a longer name that is used to help uniquely identify the item. To get the name that is displayed to the user, call getDisplayName() instead.

Returns:
The session item name.

Implemented in PlugInShell.

virtual const std::string& SessionItem::getDisplayName ( bool  fullName = false  )  const [pure virtual]

Returns the session item name that should be displayed to the user.

The display name can be used to present a shorter name to the user such as a filename that does not include the full path. To get the full name of the session item, call getName() instead.

Parameters:
fullName If set to true and no display name has been set, then the full session item name is returned instead.
Returns:
The session item display name. If no display name has been set and the fullName parameter is set to true, then the full item name is returned, which is equivalent to calling getName().

Implemented in PlugInShell.

virtual const std::string& SessionItem::getDisplayText (  )  const [pure virtual]

Returns the additional text about the session item that can be displayed to the user.

Returns:
The text string containing additional information about this session item that can be displayed to the user.

Implemented in PlugInShell.

virtual std::list<ContextMenuAction> SessionItem::getContextMenuActions (  )  const [pure virtual]

Returns the context menu actions available for this session item.

Returns:
The list of context menu actions that should be displayed when the user right-clicks on a widget displaying or containing the session item.
See also:
ContextMenuAction

Implemented in PlugInShell, CartesianPlot, DockWindow, HistogramPlot, Layer, PlotWidget, PolarPlot, RasterLayer, SessionExplorer, and SpatialDataView.

virtual bool SessionItem::hasFilenameDisplay (  )  const [pure virtual]

Returns whether the display name and display text are automatically updated when a filename is set as the item name.

If this method returns true and the item name is updated to a filename, the display name is automatically set to the base filename and extension without the full path. The display text is automatically set to the full path and filename, which is the same value as the item name returned by getName().

If this method returns true and the item name is updated to a name that is not a filename, the display name and display text are set to empty text.

If this method returns false, the display name and display text are not affected when the item name is updated.

Returns:
Returns true if the display name and display text are automatically updated when a filename is set as the item name; otherwise returns false. By default, this method returns true when a SessionItem is first created.
See also:
getDisplayName(), getDisplayText()

Implemented in PlugInShell.

virtual std::vector<std::string> SessionItem::getPropertiesPages (  )  const [pure virtual]

Returns the Properties plug-in names whose widgets should comprise the available tabs of the properties dialog for this session item.

Returns:
Returns the Properties plug-in names for this session item.

Implemented in PlugInShell.

virtual bool SessionItem::isValidSessionSaveItem (  )  const [pure virtual]

Retrieves session save validity.

Method returns whether or not the item will be included when saving a session.

Returns:
Returns true if the item will be saved in a session, or false otherwise.

Implemented in PlugInShell.

virtual bool SessionItem::serialize ( SessionItemSerializer serializer  )  const [pure virtual]

Saves the SessionItem as part of a full session save.

This method will normally only be called by the SessionManager during a session save. Every concrete type that inherits from SessionItem should provide its own implementation for this method. If a SessionItem needs to be recreated on session load, but does not have any state information that it needs to save, it should call serialize(NULL,0) on the serializer. If a SessionItem does not need to be created on session load, it should simply return true from this method. This method will only be called on session items that exist at the time of session serialization.

Parameters:
serializer The object to use to save the item as part of the current session.
Returns:
True if the item was successfully saved and false otherwise.

Implemented in DockWindowShell, PlugInShell, and RasterPagerShell.

virtual bool SessionItem::deserialize ( SessionItemDeserializer deserializer  )  [pure virtual]

Restores the SessionItem from a saved session.

This method will normally only be called by the SessionManager during a session restore operation. Every concrete type that inherits from SessionItem should provide its own implementation for this method.

Parameters:
deserializer The object to use to restore the item from a saved session
Returns:
True if the item was successfully restored and false otherwise.

Implemented in DockWindowShell, and PlugInShell.


Software Development Kit - Opticks 4.9.0 Build 16218