QtxActionMgr Class Reference

#include <QtxActionMgr.h>

Inheritance diagram for QtxActionMgr:

Inheritance graph

Public Member Functions

 QtxActionMgr (QObject *parent)
virtual ~QtxActionMgr ()
virtual int registerAction (QAction *, const int=-1)
virtual void unRegisterAction (const int)
QActionaction (const int) const
int actionId (const QAction *) const
bool contains (const int) const
int count () const
bool isEmpty () const
void idList (QIntList &) const
bool isUpdatesEnabled () const
virtual void setUpdatesEnabled (const bool)
virtual bool isVisible (const int, const int) const
virtual void setVisible (const int, const int, const bool)
void update ()
virtual bool isEnabled (const int) const
virtual void setEnabled (const int, const bool)

Static Public Member Functions

static QActionseparator (const bool=false)

Protected Member Functions

virtual void internalUpdate ()
int generateId () const

Private Types

typedef QGuardedPtr< QActionActionPtr
typedef QMap< int, ActionPtrActionMap

Private Attributes

bool myUpdate
ActionMap myActions

Data Structures

class  Creator
class  Reader
class  SeparatorAction
class  XMLReader

Detailed Description

Contains set of actions accessible by id. Base class for menu, popup creators and other action containers.


Member Typedef Documentation

typedef QGuardedPtr<QAction> QtxActionMgr.ActionPtr [private]
 

typedef QMap<int, ActionPtr> QtxActionMgr.ActionMap [private]
 


Constructor & Destructor Documentation

QtxActionMgr::QtxActionMgr QObject parent  ) 
 

Constructor

QtxActionMgr::~QtxActionMgr  )  [virtual]
 

Destructor


Member Function Documentation

int QtxActionMgr::registerAction QAction a,
const   int = -1
[virtual]
 

Stores action in internal map If action with such id is registered already, then it will be unregistered

Parameters:
a - action to be registered
userId - proposed id (if it is less than 0, then id will be generated automatically)

void QtxActionMgr::unRegisterAction const   int  )  [virtual]
 

Removes action from internal map

Parameters:
id - action id

Reimplemented in QtxPopupMgr.

QAction * QtxActionMgr::action const   int  )  const
 

Returns:
action by id
Parameters:
id - action id

int QtxActionMgr::actionId const QAction a  )  const
 

Returns:
id by action
Parameters:
a - action

bool QtxActionMgr::contains const   int  )  const
 

Returns:
true if internal map contains such id
Parameters:
id - action id

int QtxActionMgr::count  )  const
 

Returns:
count of actions in internal map

bool QtxActionMgr::isEmpty  )  const
 

Returns:
true if internal map is empty

void QtxActionMgr::idList QIntList lst  )  const
 

Fills list with ids of registered actions

bool QtxActionMgr::isUpdatesEnabled  )  const
 

Returns:
true if updates are enabled

void QtxActionMgr::setUpdatesEnabled const   bool  )  [virtual]
 

Enables/disables updates

Parameters:
upd - new state

bool QtxActionMgr::isVisible const   int,
const   int
const [virtual]
 

Returns:
true if action is visible (by default

always true)

Reimplemented in QtxActionMenuMgr, QtxActionToolMgr, and QtxPopupMgr.

void QtxActionMgr::setVisible const   int,
const   int,
const   bool
[virtual]
 

Sets visibility of action (by default, empty implementation)

Reimplemented in QtxActionMenuMgr, and QtxActionToolMgr.

void QtxActionMgr::update  ) 
 

Updates actions, check isUpdatesEnabled() and call internalUpdate()

See also:
isUpdatesEnabled(), internalUpdate()

bool QtxActionMgr::isEnabled const   int  )  const [virtual]
 

Returns:
true if action is enabled
Parameters:
id - action id

void QtxActionMgr::setEnabled const   int,
const   bool
[virtual]
 

Enables/disables action

Parameters:
id - action id
en - new state

QAction * QtxActionMgr::separator const   bool = false  )  [static]
 

Returns:
action for separator If this action doesn't exist, then it will be created
Parameters:
individual - if it is false, then action will be shared, otherwise it will be created on every call

void QtxActionMgr::internalUpdate  )  [protected, virtual]
 

Real update (to be redefined in successors)

Reimplemented in QtxActionMenuMgr, and QtxActionToolMgr.

int QtxActionMgr::generateId  )  const [protected]
 

Returns:
global free id


Field Documentation

bool QtxActionMgr.myUpdate [private]
 

ActionMap QtxActionMgr.myActions [private]