Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
berry::ISaveablesSource Struct Referenceabstract

#include <berryISaveablesSource.h>

Inheritance diagram for berry::ISaveablesSource:
Collaboration diagram for berry::ISaveablesSource:

Public Member Functions

 berryObjectMacro (berry::ISaveablesSource)
 
 ~ISaveablesSource () override
 
virtual QList< Saveable::PointerGetSaveables ()=0
 
virtual QList< Saveable::PointerGetActiveSaveables ()=0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

Represents a source of Saveable objects (units of saveability). Workbench parts that show more than one unit of saveability, or whose units of saveability change over time, should implement this interface in order to provide better integration with workbench facilities like the Save command, prompts to save on part close or shutdown, etc.

IMPORTANT: As of 3.2, implementers of ISaveablesSource must satisfy the following conditions:

If any of these conditions are not met, it is undefined whether the Workbench will prompt to save dirty Saveables when closing parts or the Workbench.

These conditions may be relaxed in future releases.

Since
3.2

Definition at line 62 of file berryISaveablesSource.h.

Constructor & Destructor Documentation

◆ ~ISaveablesSource()

berry::ISaveablesSource::~ISaveablesSource ( )
override

Member Function Documentation

◆ berryObjectMacro()

berry::ISaveablesSource::berryObjectMacro ( berry::ISaveablesSource  )

◆ GetActiveSaveables()

virtual QList<Saveable::Pointer> berry::ISaveablesSource::GetActiveSaveables ( )
pure virtual

Returns the saveables currently active in the workbench part.

Certain workbench actions, such as Save, target only the active saveables in the active part. For example, the active saveables could be determined based on the current selection in the part.

Returns
the saveables currently active in the workbench part

◆ GetSaveables()

virtual QList<Saveable::Pointer> berry::ISaveablesSource::GetSaveables ( )
pure virtual

Returns the saveables presented by the workbench part. If the return value of this method changes during the lifetime of this part (i.e. after initialization and control creation but before disposal) the part must notify an implicit listener using ISaveablesLifecycleListener#HandleLifecycleEvent.

Additions of saveables to the list of saveables of this part are announced using an event of type SaveablesLifecycleEvent#POST_OPEN. Removals are announced in a two-stage process, first using an event of type SaveablesLifecycleEvent#PRE_CLOSE followed by an event of type SaveablesLifecycleEvent#POST_CLOSE. Since firing the PRE_CLOSE event may trigger prompts to save dirty saveables, the cancellation status of the event must be checked by the part after the notification. When removing only non-dirty saveables, POST_CLOSE notification is sufficient.

The listener is obtained from the part site by calling partSite.getService(ISaveablesLifecycleListener.class).

The part must not notify from its initialization methods (e.g. init or createPartControl), or from its dispose method. Parts that implement IReusableEditor must notify when their input is changed through IReusableEditor#SetInput.

Returns
the saveables presented by the workbench part
See also
ISaveablesLifecycleListener

The documentation for this struct was generated from the following file: