All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions
Qtilities::CoreGui::Interfaces::IActionProvider Class Reference

An interface through which objects can provide actions to other objects. More...

#include <IActionProvider.h>

Inheritance diagram for Qtilities::CoreGui::Interfaces::IActionProvider:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ActionFilter { NoFilter = 0, FilterDisabled = 1, FilterHidden = 2 }
 Action Filter Flag. More...

Public Member Functions

virtual QList< QtilitiesCategoryactionCategories () const =0
 A list of all action categories provided through this interface.
virtual QList< QtilitiesCategoryactionGroupCategories () const =0
 A list of all action group categories provided through this interface.
virtual QMap< QActionGroup
*, QtilitiesCategory
actionGroupMap (QActionGroup *action_group=0) const =0
 A map with the actions and action categories of all the action groups provided through the interface.
virtual QList< QActionGroup * > actionGroups () const =0
 A list of all the action groups provided through the interface.
virtual QMap< QAction
*, QtilitiesCategory
actionMap (IActionProvider::ActionFilterFlags action_filter, const QtilitiesCategory &category_filter=QtilitiesCategory()) const =0
 A map with the action and action category of all the actions provided through the interface.
virtual QList< QAction * > actions (ActionFilterFlags action_filter=NoFilter, const QtilitiesCategory &category_filter=QtilitiesCategory("Hello World!")) const =0
 A list of all the actions provided through the interface.
virtual QAction * addAction (QAction *action, const QtilitiesCategory &category=QtilitiesCategory())=0
 Adds an action to the object implementing this interface and returns it if added successfully. Returns 0 otherwise.
virtual QActionGroup * addActionGroup (QActionGroup *action_group, const QtilitiesCategory &category=QtilitiesCategory())=0
 Adds an action group to the object implementing this interface and returns it if added successfully. Returns 0 otherwise.
virtual void addActions (QList< QAction * > actions, const QtilitiesCategory &category=QtilitiesCategory())=0
 Adds an list of actions to the object implementing this interface.
virtual void disableAllActions ()=0
 Disables all actions registered in this action provider.
virtual void enableAllActions ()=0
 Enables all actions registered in this action provider.
virtual QList< QAction * > findActionsByObjectName (const QString &object_name, Qt::MatchFlags match_flags=Qt::MatchFixedString)=0
 Finds an action with the specified objectName() and returns a reference to it, otherwise return 0 if it was not found.
virtual QList< QAction * > findActionsByText (const QString &match_string, Qt::MatchFlags match_flags=Qt::MatchFixedString)=0
 Finds an action that has the specified text and returns a reference to it, otherwise return 0 if it was not found.
virtual void removeAction (QAction *action)=0
 Removes an action from the action provider. Does not delete the action.
virtual void removeActionCategory (const QtilitiesCategory &category)=0
 Removes a complete category from the action provider. Does not delete the actions.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
virtual QObject * objectBase ()=0
 Returns the QObject* base of the interface.
virtual const QObject * objectBase () const =0
 Returns a const QObject* base of the interface.
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.

Detailed Description

An interface through which objects can provide actions to other objects.

For more information see ActionProvider.


Member Enumeration Documentation

Action Filter Flag.

The action filter flag is used to filter actions returned by the actions() function.

See also:
actions()
Enumerator:
NoFilter 

No filter. All actions in the action provider will be returned.

FilterDisabled 

Filter disabled actions, thus only enabled actions will be returned.

FilterHidden 

Filter hidden actions, thus only visible actions will be returned.


Member Function Documentation

virtual QMap<QActionGroup*, QtilitiesCategory> Qtilities::CoreGui::Interfaces::IActionProvider::actionGroupMap ( QActionGroup *  action_group = 0) const
pure virtual

A map with the actions and action categories of all the action groups provided through the interface.

This function can be used to visualize the actions provided through this interface.

Parameters:
action_groupThe action group for which the map is required. If no group is specified, all actions in all action groups are returned in the map.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual QMap<QAction*, QtilitiesCategory> Qtilities::CoreGui::Interfaces::IActionProvider::actionMap ( IActionProvider::ActionFilterFlags  action_filter,
const QtilitiesCategory category_filter = QtilitiesCategory() 
) const
pure virtual

A map with the action and action category of all the actions provided through the interface.

This function can be used to visualize the actions provided through this interface.

Parameters:
action_filterThe action filter flags to be used to filter returned actions.
category_filterOnly actions which have a category which appears in the category filter will be part of the returned list.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual QList<QAction *> Qtilities::CoreGui::Interfaces::IActionProvider::actions ( ActionFilterFlags  action_filter = NoFilter,
const QtilitiesCategory category_filter = QtilitiesCategory("Hello World!") 
) const
pure virtual

A list of all the actions provided through the interface.

Parameters:
action_filterThe action filter flags to be used to filter returned actions.
category_filterOnly actions which have a category which appears in the category filter will be part of the returned list.
virtual QAction* Qtilities::CoreGui::Interfaces::IActionProvider::addAction ( QAction *  action,
const QtilitiesCategory category = QtilitiesCategory() 
)
pure virtual

Adds an action to the object implementing this interface and returns it if added successfully. Returns 0 otherwise.

Parameters:
actionThe action to be added.
categoryThe category under which the action should be added. By default no category is assigned. The first level of hierarchy in the category is defined by the first item in the list, and the last level of hierarchy by the last item in the list.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual QActionGroup* Qtilities::CoreGui::Interfaces::IActionProvider::addActionGroup ( QActionGroup *  action_group,
const QtilitiesCategory category = QtilitiesCategory() 
)
pure virtual

Adds an action group to the object implementing this interface and returns it if added successfully. Returns 0 otherwise.

Parameters:
action_groupThe action group to be added.
categoryThe category under which the actions in the action group should be added. By default no category is assigned. The first level of hierarchy in the category is defined by the first item in the list, and the last level of hierarchy by the last item in the list.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual void Qtilities::CoreGui::Interfaces::IActionProvider::addActions ( QList< QAction * >  actions,
const QtilitiesCategory category = QtilitiesCategory() 
)
pure virtual

Adds an list of actions to the object implementing this interface.

Parameters:
actionsThe actions to be added.
categoryThe category under which the actions should be added. By default no category is assigned. The first level of hierarchy in the category is defined by the first item in the list, and the last level of hierarchy by the last item in the list.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual QList<QAction*> Qtilities::CoreGui::Interfaces::IActionProvider::findActionsByObjectName ( const QString &  object_name,
Qt::MatchFlags  match_flags = Qt::MatchFixedString 
)
pure virtual

Finds an action with the specified objectName() and returns a reference to it, otherwise return 0 if it was not found.

Parameters:
match_stringThe match string to match.
match_flagsThe match flags to use during matching. At present Qt::MatchExactly, Qt::MatchFixedString, Qt::MatchContains, Qt::MatchStartsWith, Qt::MatchEndsWith, Qt::MatchCaseSensitive is supported.
Returns:
All actions matching the match conditions. An empty list if no action matches the match conditions.

Implemented in Qtilities::CoreGui::ActionProvider.

virtual QList<QAction*> Qtilities::CoreGui::Interfaces::IActionProvider::findActionsByText ( const QString &  match_string,
Qt::MatchFlags  match_flags = Qt::MatchFixedString 
)
pure virtual

Finds an action that has the specified text and returns a reference to it, otherwise return 0 if it was not found.

Parameters:
match_stringThe match string to match.
match_flagsThe match flags to use during matching. All match flags except Qt::MatchRecursive and Qt::MatchWrap can be used.
Returns:
All actions matching the match conditions. An empty list if no action matches the match conditions.

Implemented in Qtilities::CoreGui::ActionProvider.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé