1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
5 * Created on: Feb 4, 2015
9 #ifndef MODULEBASE_ACTIONINFO_H_
10 #define MODULEBASE_ACTIONINFO_H_
12 #include <ModuleBase.h>
13 #include <Config_FeatureMessage.h>
17 #include <QKeySequence>
23 * Structure to pass info about QActions, AppElements_Commands, etc.
25 struct MODULEBASE_EXPORT ModuleBase_ActionInfo
27 QString id; //!< action's (command) id
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
33 //! = true if the acton is a modal dialog box else property panel (==false by default)
35 QIcon icon; //!< action's icon
36 QString text; //!< action's text
37 QString iconText; //!< action's descriptive icon text
38 QString iconFile; //!< path to icon's file. Can not be initialized from QAction
39 QString toolTip; //!< action's tooltip
42 QKeySequence shortcut; //!< action's primary shortcut key
43 QFont font; //!< action's text font
46 //! Default constructor, \sa initDefault
47 ModuleBase_ActionInfo();
48 //! Initializes structure with default values, except text
49 ModuleBase_ActionInfo(const QString &text);
50 //! Initializes structure with default values, except icon and text
51 ModuleBase_ActionInfo(const QIcon &icon, const QString &text);
52 virtual ~ModuleBase_ActionInfo();
54 //! Fills itself with info from given \param theAction
55 void initFrom(QAction* theAction);
56 //! Fills itself with info from given \param theFeatureMessage
57 void initFrom(std::shared_ptr<Config_FeatureMessage> theFeatureMessage);
60 //! Initializes structure with default values, like QAction()
64 typedef ModuleBase_ActionInfo ActionInfo;
66 #endif /* XGUI_ACTIONINFO_H_ */