Popup menu actions creator. More...

Public Member Functions | |
| PopupCreator (QtxActionMgr::Reader *, QtxPopupMgr *) | |
| Constructor. | |
| virtual | ~PopupCreator () |
| Destructor. | |
| virtual int | append (const QString &, const bool, const ItemAttributes &, const int) |
| Create and append new action to the action manager. | |
| virtual QString | rule (const ItemAttributes &, const QtxPopupMgr::RuleType=VisibleRule) const |
| Get the rule for the menu item. | |
| Reader * | reader () const |
| Get actions reader. | |
| virtual void | connect (QAction *) const |
| Connect action to some specific slot(s). | |
| virtual bool | loadPixmap (const QString &, QPixmap &) const |
| Load pixmap from the file. | |
Static Protected Member Functions | |
| static int | intValue (const ItemAttributes &, const QString &, const int) |
| Get integer attribute value from the attribute map. | |
| static QString | strValue (const ItemAttributes &, const QString &, const QString &=QString()) |
| Get string attribute value from the attribute map. | |
Private Attributes | |
| QtxPopupMgr * | myMgr |
Used by Reader to create actions by reading descriptions from the file and fill in the action manager with the actions.
| QtxPopupMgr.PopupCreator::PopupCreator | ( | QtxActionMgr::Reader * | r, |
| QtxPopupMgr * | mgr | ||
| ) |
| r | menu action reader |
| mgr | popup menu manager |
| QtxPopupMgr.PopupCreator::~PopupCreator | ( | ) | [virtual] |
| int QtxPopupMgr.PopupCreator::append | ( | const QString & | tag, |
| const bool | subMenu, | ||
| const ItemAttributes & | attr, | ||
| const int | pId | ||
| ) | [virtual] |
| tag | item tag name |
| subMenu | true if this item is submenu |
| attr | attributes map |
| pId | parent action ID |
Implements QtxActionMgr.Creator.
References QtxPopupMgr.EnableRule, QtxActionMenuMgr.insert(), QtxActionMgr.registerAction(), QtxPopupMgr.rule(), QtxActionMgr.separator(), QtxPopupMgr.ToggleRule, and QtxPopupMgr.VisibleRule.
| QString QtxPopupMgr.PopupCreator::rule | ( | const ItemAttributes & | , |
| const QtxPopupMgr::RuleType | = VisibleRule |
||
| ) | const [virtual] |
Default implementation returns empty rule.
| attr | attributes map |
| ruleType | rule type (QtxPopupMgr.RuleType) |
| QtxActionMgr::Reader * QtxActionMgr.Creator::reader | ( | ) | const [inherited] |
| void QtxActionMgr.Creator::connect | ( | QAction * | ) | const [virtual, inherited] |
This method can be redefined in subclasses. Base implementation does nothing.
| a | action |
| bool QtxActionMgr.Creator::loadPixmap | ( | const QString & | fname, |
| QPixmap & | pix | ||
| ) | const [virtual, inherited] |
| fname | file name |
| pix | used to return pixmap |
true if pixmap is loaded successfully and false in case of error References Qtx.addSlash().
| int QtxActionMgr.Creator::intValue | ( | const ItemAttributes & | attrs, |
| const QString & | name, | ||
| const int | def | ||
| ) | [static, protected, inherited] |
Returns default value (def) if the attribute is not found.
| attrs | attributes map |
| name | attribute name |
| def | default attribute value |
| QString QtxActionMgr.Creator::strValue | ( | const ItemAttributes & | attrs, |
| const QString & | name, | ||
| const QString & | def = QString() |
||
| ) | [static, protected, inherited] |
Returns default value (def) if the attribute is not found.
| attrs | attributes map |
| name | attribute name |
| def | default attribute value |
QtxPopupMgr* QtxPopupMgr.PopupCreator.myMgr [private] |