Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::IContributionManager Struct Referenceabstract

#include <berryIContributionManager.h>

Inheritance diagram for berry::IContributionManager:
Collaboration diagram for berry::IContributionManager:

Public Member Functions

 berryObjectMacro (berry::IContributionManager) virtual void Add(QAction *action
 
virtual void Add (const SmartPointer< IContributionItem > &item)=0
 
virtual void AppendToGroup (const QString &groupName, QAction *action, const QString &id)=0
 
virtual void AppendToGroup (const QString &groupName, const SmartPointer< IContributionItem > &item)=0
 
virtual SmartPointer< IContributionItemFind (const QString &id) const =0
 
virtual QList< SmartPointer< IContributionItem > > GetItems () const =0
 
virtual SmartPointer< IContributionManagerOverridesGetOverrides ()=0
 
virtual void InsertAfter (const QString &id, const SmartPointer< IContributionItem > &item)=0
 
virtual void InsertBefore (const QString &id, const SmartPointer< IContributionItem > &item)=0
 
virtual bool IsDirty () const =0
 
virtual bool IsEmpty () const =0
 
virtual void MarkDirty ()=0
 
virtual void PrependToGroup (const QString &groupName, const SmartPointer< IContributionItem > &item)=0
 
virtual SmartPointer< IContributionItemRemove (const QString &id)=0
 
virtual SmartPointer< IContributionItemRemove (const SmartPointer< IContributionItem > &item)=0
 
virtual void RemoveAll ()=0
 
virtual void Update (bool force)=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
 

Public Attributes

const QString & id
 

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

A contribution manager organizes contributions to such UI components as menus, toolbars and status lines.

A contribution manager keeps track of a list of contribution items. Each contribution item may has an optional identifier, which can be used to retrieve items from a manager, and for positioning items relative to each other. The list of contribution items can be subdivided into named groups using special contribution items that serve as group markers.

The IContributionManager interface provides general protocol for adding, removing, and retrieving contribution items. It also provides convenience methods that make it convenient to contribute actions. This interface should be implemented by all objects that wish to manage contributions.

There are several implementions of this interface in this package, including ones for menus (MenuManager), tool bars (ToolBarManager), and status lines (StatusLineManager).

Definition at line 55 of file berryIContributionManager.h.

Member Function Documentation

virtual void berry::IContributionManager::Add ( const SmartPointer< IContributionItem > &  item)
pure virtual

Adds a contribution item to this manager.

Parameters
itemthe contribution item, this cannot be null

Implemented in berry::ContributionManager.

Referenced by QmitkExtActionBarAdvisor::FillMenuBar().

virtual void berry::IContributionManager::AppendToGroup ( const QString &  groupName,
QAction *  action,
const QString &  id 
)
pure virtual

Adds a contribution item for the given action at the end of the group with the given name. Equivalent to AppendToGroup(groupName,IContributionItem::Pointer(new QActionContributionItem(action, id))).

Parameters
groupNamethe name of the group
actionthe action
idthe unique action id
Exceptions
ctkInvalidArgumentExceptionif there is no group with the given name

Implemented in berry::ContributionManager.

virtual void berry::IContributionManager::AppendToGroup ( const QString &  groupName,
const SmartPointer< IContributionItem > &  item 
)
pure virtual

Adds a contribution item to this manager at the end of the group with the given name.

Parameters
groupNamethe name of the group
itemthe contribution item
Exceptions
ctkInvalidArgumentExceptionif there is no group with the given name

Implemented in berry::ContributionManager.

berry::IContributionManager::berryObjectMacro ( berry::IContributionManager  )

Adds an action as a contribution item to this manager. Equivalent to Add(IContributionItem::Pointer(new QActionContributionItem(action, id))).

Parameters
actionthe action, this cannot be null
idthe unique action id
virtual SmartPointer<IContributionItem> berry::IContributionManager::Find ( const QString &  id) const
pure virtual

Finds the contribution item with the given id.

Parameters
idthe contribution item id
Returns
the contribution item, or null if no item with the given id can be found

Implemented in berry::ContributionManager.

virtual QList<SmartPointer<IContributionItem> > berry::IContributionManager::GetItems ( ) const
pure virtual

Returns all contribution items known to this manager.

Returns
a list of contribution items

Implemented in berry::ContributionManager.

virtual SmartPointer<IContributionManagerOverrides> berry::IContributionManager::GetOverrides ( )
pure virtual

Returns the overrides for the items of this manager.

Returns
the overrides for the items of this manager

Implemented in berry::MenuManager, and berry::ContributionManager.

Referenced by berry::QActionContributionItem::IsEnabledAllowed().

virtual void berry::IContributionManager::InsertAfter ( const QString &  id,
const SmartPointer< IContributionItem > &  item 
)
pure virtual

Inserts a contribution item after the item with the given id.

Parameters
idthe contribution item id
itemthe contribution item to insert
Exceptions
IllegalArgumentExceptionif there is no item with the given id

Implemented in berry::ContributionManager.

virtual void berry::IContributionManager::InsertBefore ( const QString &  id,
const SmartPointer< IContributionItem > &  item 
)
pure virtual

Inserts a contribution item before the item with the given id.

Parameters
idthe contribution item id
itemthe contribution item to insert
Exceptions
IllegalArgumentExceptionif there is no item with the given id

Implemented in berry::ContributionManager.

virtual bool berry::IContributionManager::IsDirty ( ) const
pure virtual

Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.

Returns
true if this manager is dirty, and false if it is up-to-date

Implemented in berry::ContributionManager, and berry::MenuManager.

virtual bool berry::IContributionManager::IsEmpty ( ) const
pure virtual

Returns whether this manager has any contribution items.

Returns
true if there are no items, and false otherwise

Implemented in berry::ContributionManager.

virtual void berry::IContributionManager::MarkDirty ( )
pure virtual

Marks this contribution manager as dirty.

Implemented in berry::MenuManager, and berry::ContributionManager.

Referenced by berry::MenuManager::MarkDirty().

virtual void berry::IContributionManager::PrependToGroup ( const QString &  groupName,
const SmartPointer< IContributionItem > &  item 
)
pure virtual

Adds a contribution item to this manager at the beginning of the group with the given name.

Parameters
groupNamethe name of the group
itemthe contribution item
Exceptions
IllegalArgumentExceptionif there is no group with the given name

Implemented in berry::ContributionManager.

virtual SmartPointer<IContributionItem> berry::IContributionManager::Remove ( const QString &  id)
pure virtual

Removes and returns the contribution item with the given id from this manager. Returns null if this manager has no contribution items with the given id.

Parameters
idthe contribution item id
Returns
the item that was found and removed, or null if none

Implemented in berry::ContributionManager.

virtual SmartPointer<IContributionItem> berry::IContributionManager::Remove ( const SmartPointer< IContributionItem > &  item)
pure virtual

Removes the given contribution item from the contribution items known to this manager.

Parameters
itemthe contribution item
Returns
the item parameter if the item was removed, and null if it was not found

Implemented in berry::ContributionManager.

virtual void berry::IContributionManager::RemoveAll ( )
pure virtual

Removes all contribution items from this manager.

Implemented in berry::ContributionManager.

virtual void berry::IContributionManager::Update ( bool  force)
pure virtual

Updates this manager's underlying widget(s) with any changes which have been made to it or its items. Normally changes to a contribution manager merely mark it as dirty, without updating the underlying widgets. This brings the underlying widgets up to date with any changes.

Parameters
forcetrue means update even if not dirty, and false for normal incremental updating

Implemented in berry::MenuManager.

Referenced by berry::CommandContributionItem::UpdateCommandPropertiesInUI().

Member Data Documentation

const QString& berry::IContributionManager::id

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