May represent not just an action, but also a folder within item tree of a module. May also represent action-folder: an action with nested actions. Each action inModuleID is unique within a tree of assets. More...
#include <SUIT_ShortcutMgr.h>

Public Member Functions | |
| ~SUIT_ShortcutItemAssets ()=default | |
| int | depth () const |
| SUIT_ShortcutAssets::Type | type () const |
| void | merge (const SUIT_ShortcutItemAssets &theOther, bool theOverride) |
| virtual void | merge (SUIT_ShortcutItemAssets &&theOther, bool theOverride) |
| const QString & | bestName (const QString &theLang=QString()) const |
| const QString & | bestPath (const QString theLang=QString()) const |
| Composed as <depth_1_item.bestName>/...<depth_N_item.bestName>.../<this->bestName>. Module name is not included. More... | |
| QString | description () const |
| bool | isAction () const |
| bool | isFolder () const |
| std::shared_ptr< SUIT_ShortcutAssets > | parent () const |
| std::shared_ptr< SUIT_ShortcutModuleAssets > | module () const |
| QString | actionID () const |
| Even if SUIT_ShortcutItemAssets is not action, its ID is composed in the same way. More... | |
| const QIcon & | icon () const |
Public Member Functions inherited from SUIT_ShortcutAssets | |
| virtual | ~SUIT_ShortcutAssets ()=0 |
| const std::map< QString, std::shared_ptr< SUIT_ShortcutItemAssets > > & | children () const |
| std::shared_ptr< SUIT_ShortcutItemAssets > | findDescendantItem (const QString &theRelativeID) const |
| std::shared_ptr< SUIT_ShortcutItemAssets > | descendantItem (const QString &theRelativeID, bool theIsAction=true) |
| bool | fromJSON (const QJsonObject &theJsonObject, bool theParseDescendants=true, const std::set< QString > &theLangs={}) |
| bool | fromJSON (const QJsonObject &theJsonObject, const QString &theRelativeID, const std::set< QString > &theLangs={}) |
| Parses only the branch of descdendants, which leads to the item with theRelativeID. More... | |
| void | toJSON (QJsonObject &oJsonObject) const |
| virtual void | merge (const SUIT_ShortcutAssets &theOther, bool theOverride) |
| virtual void | merge (SUIT_ShortcutAssets &&theOther, bool theOverride) |
| void | loadIcon (bool theReload=false) |
| void | forEachDescendant (const std::function< void(SUIT_ShortcutItemAssets &)> &theFunc) const |
| Iterates all descendants. *this is not iterated. More... | |
| void | forEachDescendant (const std::function< void(const SUIT_ShortcutItemAssets &)> &theFunc) const |
| Iterates all descendants. *this is not iterated. More... | |
| void | forEachDescendant (const std::function< void(std::shared_ptr< SUIT_ShortcutItemAssets >)> &theFunc) const |
| Iterates all descendants. *this is not iterated. More... | |
| void | forEachDescendant (const std::function< void(std::shared_ptr< const SUIT_ShortcutItemAssets >)> &theFunc) const |
| Iterates all descendants. *this is not iterated. More... | |
| QString | toString () const |
| QStringList | getLangs () const |
| void | clearAllLangsExcept (const QString &theLang) |
| const LangDependentAssets * | bestLangDependentAssets (QString theLang=QString()) const |
| virtual const QString & | bestToolTip (const QString &theLang=QString()) const |
Static Public Member Functions | |
| static void | loadDefaultIcons () |
Public Attributes | |
| const QString | myIDLastToken |
| const QString | myInModuleID |
Public Attributes inherited from SUIT_ShortcutAssets | |
| const QString | myModuleID |
| std::map< QString, LangDependentAssets > | myLangDependentAssets |
| QString | myIconPath |
| QIcon | myIcon |
Static Public Attributes | |
| static const QString | PROP_ID_IS_ACTION = "isAction" |
Static Public Attributes inherited from SUIT_ShortcutAssets | |
| static const QString | PROP_ID_LANG_DEPENDENT_ASSETS = "langDependentAssets" |
| static const QString | PROP_ID_ICON_PATH = "iconPath" |
| static const QString | PROP_ID_CHILDREN = "children" |
Private Member Functions | |
| SUIT_ShortcutItemAssets (std::shared_ptr< SUIT_ShortcutModuleAssets > theModule, const QString &theIDLastToken, bool theIsAction=true) | |
| Creates root item of module. More... | |
| SUIT_ShortcutItemAssets (std::shared_ptr< SUIT_ShortcutItemAssets > theParentItem, const QString &theIDLastToken, bool theIsAction=true) | |
| Creates nested item within item tree of module. More... | |
| SUIT_ShortcutItemAssets (const SUIT_ShortcutItemAssets &)=delete | |
| SUIT_ShortcutItemAssets & | operator= (const SUIT_ShortcutItemAssets &)=delete |
| bool | fromJSONOtherProps (const QJsonObject &theJsonObject) |
| Parses properties of SUIT_ShortcutAssets subclasses. More... | |
| void | toJSONVirtual (QJsonObject &oJsonObject) const |
Static Private Member Functions | |
| static std::shared_ptr< SUIT_ShortcutItemAssets > | create (std::shared_ptr< SUIT_ShortcutAssets > theParentItemOrModule, const QString &theIDLastToken, bool theIsAction=true) |
Private Attributes | |
| std::weak_ptr< SUIT_ShortcutAssets > | myParent |
| bool | myIsAction |
| const int | myDepth |
| std::map< QString, QString > | myBestPaths |
| {lang, bestPath}[] More... | |
Static Private Attributes | |
| static QIcon | DEFAUT_ICON_ACTION = QIcon() |
| static QIcon | DEFAUT_ICON_FOLDER = QIcon() |
| static QIcon | DEFAUT_ICON_FOLDER_ACTION = QIcon() |
Friends | |
| class | SUIT_ShortcutAssets |
Additional Inherited Members | |
Public Types inherited from SUIT_ShortcutAssets | |
| enum class | Type { Module , Item } |
Protected Member Functions inherited from SUIT_ShortcutAssets | |
| SUIT_ShortcutAssets (const QString &theModuleID) | |
May represent not just an action, but also a folder within item tree of a module. May also represent action-folder: an action with nested actions. Each action inModuleID is unique within a tree of assets.
|
private |
Creates root item of module.
| theModule | must not be nullptr. |
| theIDLastToken | is also a inModuleID. |
|
private |
Creates nested item within item tree of module.
| theParent | must not be nullptr. |
|
privatedelete |
|
default |
| QString SUIT_ShortcutItemAssets::actionID | ( | ) | const |
Even if SUIT_ShortcutItemAssets is not action, its ID is composed in the same way.
References myInModuleID, SUIT_ShortcutAssets::myModuleID, and TOKEN_SEPARATOR.
|
virtual |
| theLang | If empty, current language is requested. |
Implements SUIT_ShortcutAssets.
References SUIT_ShortcutAssets::bestLangDependentAssets(), and myIDLastToken.
| const QString & SUIT_ShortcutItemAssets::bestPath | ( | const QString | theLang = QString() | ) | const |
Composed as <depth_1_item.bestName>/...<depth_N_item.bestName>.../<this->bestName>. Module name is not included.
References actionID(), bestName(), SUIT_ShortcutMgr::currentLang(), depth(), SUIT_ShortcutAssets::Item, myBestPaths, myInModuleID, parent(), SUIT_ShortcutMgr::splitIntoTokens(), TOKEN_SEPARATOR, and Warning().
|
staticprivate |
|
virtual |
Implements SUIT_ShortcutAssets.
References myDepth.
|
virtual |
Implements SUIT_ShortcutAssets.
References actionID(), and myIsAction.
|
privatevirtual |
Parses properties of SUIT_ShortcutAssets subclasses.
Reimplemented from SUIT_ShortcutAssets.
References myIsAction, and PROP_ID_IS_ACTION.
| const QIcon & SUIT_ShortcutItemAssets::icon | ( | ) | const |
References SUIT_ShortcutAssets::children(), DEFAUT_ICON_ACTION, DEFAUT_ICON_FOLDER, DEFAUT_ICON_FOLDER_ACTION, SUIT_ShortcutAssets::myIcon, and myIsAction.
| bool SUIT_ShortcutItemAssets::isAction | ( | ) | const |
References myIsAction.
| bool SUIT_ShortcutItemAssets::isFolder | ( | ) | const |
References SUIT_ShortcutAssets::children(), and myIsAction.
|
static |
References DEFAUT_ICON_ACTION, DEFAUT_ICON_FOLDER, and DEFAUT_ICON_FOLDER_ACTION.
| void SUIT_ShortcutItemAssets::merge | ( | const SUIT_ShortcutItemAssets & | theOther, |
| bool | theOverride | ||
| ) |
| theOverride | If true, values of theOther override conflicting values of this. |
References SUIT_ShortcutAssets::merge(), myInModuleID, myIsAction, SUIT_ShortcutAssets::myModuleID, TOKEN_SEPARATOR, and Warning().
|
virtual |
| theOverride | If true, values of theOther override conflicting values of this. |
References SUIT_ShortcutAssets::merge(), myInModuleID, myIsAction, SUIT_ShortcutAssets::myModuleID, TOKEN_SEPARATOR, and Warning().
| std::shared_ptr< SUIT_ShortcutModuleAssets > SUIT_ShortcutItemAssets::module | ( | ) | const |
References SUIT_ShortcutAssets::Item, SUIT_ShortcutAssets::Module, parent(), and Warning().
|
privatedelete |
| std::shared_ptr< SUIT_ShortcutAssets > SUIT_ShortcutItemAssets::parent | ( | ) | const |
References myParent.
|
privatevirtual |
Reimplemented from SUIT_ShortcutAssets.
References myIsAction, and PROP_ID_IS_ACTION.
|
inlinevirtual |
Implements SUIT_ShortcutAssets.
References SUIT_ShortcutAssets::Item.
|
friend |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
mutableprivate |
{lang, bestPath}[]
|
private |
| const QString SUIT_ShortcutItemAssets::myIDLastToken |
| const QString SUIT_ShortcutItemAssets::myInModuleID |
|
private |
|
private |
|
static |