57 lines
863 B
C
57 lines
863 B
C
|
|
#ifndef LMAINMENU_H
|
|||
|
|
#define LMAINMENU_H
|
|||
|
|
|
|||
|
|
#include <QString>
|
|||
|
|
#include <vector>
|
|||
|
|
|
|||
|
|
class QAction;
|
|||
|
|
|
|||
|
|
class LMenuGroupItem {
|
|||
|
|
public:
|
|||
|
|
LMenuGroupItem(QAction *action, int position)
|
|||
|
|
: m_menuAction(action)
|
|||
|
|
, m_position(position)
|
|||
|
|
{}
|
|||
|
|
|
|||
|
|
int position() const { return m_position; }
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
QAction *m_menuAction;
|
|||
|
|
int m_position;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// Menu's are divided into logical groups,
|
|||
|
|
// these groups form only a single level they are NOT submenu's
|
|||
|
|
class LMenuGroup {
|
|||
|
|
public:
|
|||
|
|
|
|||
|
|
explicit LMenuGroup(QString group_id);
|
|||
|
|
QString groupId() const;
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
QString m_groupId;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class LMenu {
|
|||
|
|
public:
|
|||
|
|
QString menuId() const;
|
|||
|
|
|
|||
|
|
void addGroup(const LMenuGroup &group)
|
|||
|
|
{
|
|||
|
|
m_groups.push_back(group);
|
|||
|
|
}
|
|||
|
|
private:
|
|||
|
|
using Groups = std::vector<LMenuGroup>;
|
|||
|
|
|
|||
|
|
QString m_caption;
|
|||
|
|
Groups m_groups;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
class LMainMenu: public LMenu {
|
|||
|
|
public:
|
|||
|
|
LMainMenu();
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#endif // LMAINMENU_H
|