| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "imodule.h" |
| 4 |
#include "ui/imenu.h" |
| 5 |
|
| 6 |
namespace ui |
| 7 |
{ |
| 8 |
|
| 9 |
class IOrthoContextMenu : |
| 10 |
public RegisterableModule |
| 11 |
{ |
| 12 |
public: |
| 13 |
// The section enum specifies where menu item should be listed under |
| 14 |
// It's possible to add new sections > SECTION_USER |
| 15 |
enum Section |
| 16 |
{ |
| 17 |
SECTION_CREATE, // Create Entity, Create Speaker, etc. |
| 18 |
SECTION_ACTION, // Make Visportals |
| 19 |
SECTION_SELECTION_GROUPS, // Selection Groups |
| 20 |
SECTION_FILTER, // Filter selectors |
| 21 |
SECTION_LAYER, // Layer operations |
| 22 |
SECTION_USER = 100, |
| 23 |
}; |
| 24 |
|
| 25 |
/** |
| 26 |
* Adds a new ortho context menu item in the given section. |
| 27 |
* |
| 28 |
* @section: an integer value referring to the Section enum above. |
| 29 |
* It's possible to specify new sections by passing values > SECTION_USER. |
| 30 |
* Sections are visually separated by horizontal lines in the menu. |
| 31 |
*/ |
| 32 |
virtual void addItem(const IMenuItemPtr& item, int section) = 0; |
| 33 |
|
| 34 |
/** |
| 35 |
* Removes a certain item from the menus. |
| 36 |
*/ |
| 37 |
virtual void removeItem(const IMenuItemPtr& item) = 0; |
| 38 |
}; |
| 39 |
|
| 40 |
} // namespace |
| 41 |
|
| 42 |
const char* const MODULE_ORTHOCONTEXTMENU = "OrthoContextMenu"; |
| 43 |
|
| 44 |
inline ui::IOrthoContextMenu& GlobalOrthoContextMenu() |
| 45 |
{ |
| 46 |
static module::InstanceReference<ui::IOrthoContextMenu> _reference(MODULE_ORTHOCONTEXTMENU); |
| 47 |
return _reference; |
| 48 |
} |