4 * Created on: Feb 4, 2015
8 #ifndef MODULEBASE_ACTIONINFO_H_
9 #define MODULEBASE_ACTIONINFO_H_
11 #include <ModuleBase.h>
12 #include <Config_FeatureMessage.h>
16 #include <QKeySequence>
22 * Structure to pass info about QActions, AppElements_Commands, etc.
24 struct MODULEBASE_EXPORT ModuleBase_ActionInfo
28 bool checkable; //!< action's checkable state
29 bool checked; //!< action's checked state
30 bool enabled; //!< action's enabled state
31 bool visible; //!< action's visibility state
32 QIcon icon; //!< action's icon
33 QString text; //!< action's text
34 QString iconText; //!< action's descriptive icon text
35 QString iconFile; //!< path to icon's file. Can not be initialized from QAction
36 QString toolTip; //!< action's tooltip
39 QKeySequence shortcut; //!< action's primary shortcut key
40 QFont font; //!< action's text font
43 //! Default constructor, \sa initDefault
44 ModuleBase_ActionInfo();
45 //! Initializes structure with default values, except text
46 ModuleBase_ActionInfo(const QString &text);
47 //! Initializes structure with default values, except icon and text
48 ModuleBase_ActionInfo(const QIcon &icon, const QString &text);
49 virtual ~ModuleBase_ActionInfo();
51 //! Fills itself with info from given \param theAction
52 void initFrom(QAction* theAction);
53 //! Fills itself with info from given \param theFeatureMessage
54 void initFrom(std::shared_ptr<Config_FeatureMessage> theFeatureMessage);
55 //! Creates new QAction with given parent and data initialized from this structure
56 //! \param theParent - parent of created action
57 QAction* makeAction(QObject* theParent = 0);
60 //! Initializes structure with default values, like QAction()
64 typedef ModuleBase_ActionInfo ActionInfo;
66 #endif /* XGUI_ACTIONINFO_H_ */