A class representing an entry in the menu.
| NaturalDocs:: | A class representing an entry in the menu. |
| Implementation | |
| Members | The object is implemented as a blessed arrayref with the indexes below. |
| Functions | |
| New | Creates and returns a new object. |
| Type | Returns the MenuEntryType. |
| Title | Returns the title of the entry. |
| SetTitle | Replaces the entry’s title. |
| Target | Returns the target of the entry, if applicable. |
| SetTarget | Replaces the entry’s target. |
| Flags | Returns the Menu Entry Flags. |
| SetFlags | Replaces the Menu Entry Flags. |
| Group Functions | All of these functions assume the type is MENU_GROUP. |
| GroupContent | Returns an arrayref of NaturalDocs::Menu::Entry objects representing the contents of the group, or undef otherwise. |
| GroupIsEmpty | If the type is MENU_GROUP, returns whether the group is empty. |
| PushToGroup | Pushes the entry to the end of the group content. |
| DeleteFromGroup | Deletes an entry from the group content by index. |
| MarkEndOfOriginal | If the group doesn’t already have one, adds a MENU_ENDOFORIGINAL entry to the end and sets the MENU_GROUP_HASENDOFORIGINAL flag. |
The object is implemented as a blessed arrayref with the indexes below.
| TYPE | The MenuEntryType |
| TITLE | The title of the entry. |
| TARGET | The target of the entry. If the type is MENU_FILE, it will be the source FileName. If the type is MENU_LINK, it will be the URL. If the type is MENU_GROUP, it will be an arrayref of NaturalDocs::Menu::Entry objects representing the group’s content. If the type is MENU_INDEX, it will be a TopicType. |
| FLAGS | Any Menu Entry Flags that apply. |
sub New #( type, title, target, flags )
Creates and returns a new object.
| type | The MenuEntryType. |
| title | The title of the entry. |
| target | The target of the entry, if applicable. If the type is MENU_FILE, use the source FileName. If the type is MENU_LINK, use the URL. If the type is MENU_INDEX, use the TopicType. Otherwise set it to undef. |
| flags | Any Menu Entry Flags that apply. |
sub Type
Returns the MenuEntryType.
sub Target
Returns the target of the entry, if applicable. If the type is MENU_FILE, it returns the source FileName. If the type is MENU_LINK, it returns the URL. If the type is MENU_INDEX, it returns the TopicType. Otherwise it returns undef.
sub Flags
Returns the Menu Entry Flags.
sub SetFlags #( flags )
Replaces the Menu Entry Flags.
All of these functions assume the type is MENU_GROUP. Do not call any of these without checking Type() first.
sub GroupContent
Returns an arrayref of NaturalDocs::Menu::Entry objects representing the contents of the group, or undef otherwise. This arrayref will always exist for MENU_GROUP’s and can be changed.
sub GroupIsEmpty
If the type is MENU_GROUP, returns whether the group is empty.
sub MarkEndOfOriginal
If the group doesn’t already have one, adds a MENU_ENDOFORIGINAL entry to the end and sets the MENU_GROUP_HASENDOFORIGINAL flag.
Creates and returns a new object.
sub New #( type, title, target, flags )
Returns the MenuEntryType.
sub Type
Returns the title of the entry.
sub Title
Replaces the entry’s title.
sub SetTitle #( title )
Returns the target of the entry, if applicable.
sub Target
Replaces the entry’s target.
sub SetTarget #( target )
Returns the Menu Entry Flags.
sub Flags
Replaces the Menu Entry Flags.
sub SetFlags #( flags )
Returns an arrayref of NaturalDocs::Menu::Entry objects representing the contents of the group, or undef otherwise.
sub GroupContent
If the type is MENU_GROUP, returns whether the group is empty.
sub GroupIsEmpty
Pushes the entry to the end of the group content.
sub PushToGroup #( entry )
Deletes an entry from the group content by index.
sub DeleteFromGroup #( index )
If the group doesn’t already have one, adds a MENU_ENDOFORIGINAL entry to the end and sets the MENU_GROUP_HASENDOFORIGINAL flag.
sub MarkEndOfOriginal