NaturalDocs::Menu::Entry

A class representing an entry in the menu.

Summary
NaturalDocs::Menu::EntryA class representing an entry in the menu.
Implementation
MembersThe object is implemented as a blessed arrayref with the indexes below.
Functions
NewCreates and returns a new object.
TypeReturns the MenuEntryType.
TitleReturns the title of the entry.
SetTitleReplaces the entry’s title.
TargetReturns the target of the entry, if applicable.
SetTargetReplaces the entry’s target.
FlagsReturns the Menu Entry Flags.
SetFlagsReplaces the Menu Entry Flags.
Group FunctionsAll of these functions assume the type is MENU_GROUP.
GroupContentReturns an arrayref of NaturalDocs::Menu::Entry objects representing the contents of the group, or undef otherwise.
GroupIsEmptyIf the type is MENU_GROUP, returns whether the group is empty.
PushToGroupPushes the entry to the end of the group content.
DeleteFromGroupDeletes an entry from the group content by index.
MarkEndOfOriginalIf the group doesn’t already have one, adds a MENU_ENDOFORIGINAL entry to the end and sets the MENU_GROUP_HASENDOFORIGINAL flag.

Implementation

Members

The object is implemented as a blessed arrayref with the indexes below.

TYPEThe MenuEntryType
TITLEThe title of the entry.
TARGETThe 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.
FLAGSAny Menu Entry Flags that apply.

Functions

New

sub New #(type,
title,
target,
flags)

Creates and returns a new object.

Parameters

typeThe MenuEntryType.
titleThe title of the entry.
targetThe 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.
flagsAny Menu Entry Flags that apply.

Type

sub Type

Returns the MenuEntryType.

Title

sub Title

Returns the title of the entry.

SetTitle

sub SetTitle #(title)

Replaces the entry’s title.

Target

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.

SetTarget

sub SetTarget #(target)

Replaces the entry’s target.

Flags

sub Flags

Returns the Menu Entry Flags.

SetFlags

sub SetFlags #(flags)

Replaces the Menu Entry Flags.

Group Functions

All of these functions assume the type is MENU_GROUP.  Do not call any of these without checking Type() first.

GroupContent

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.

GroupIsEmpty

sub GroupIsEmpty

If the type is MENU_GROUP, returns whether the group is empty.

PushToGroup

sub PushToGroup #(entry)

Pushes the entry to the end of the group content.

DeleteFromGroup

sub DeleteFromGroup #(index)

Deletes an entry from the group content by index.

MarkEndOfOriginal

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.

sub New #(type,
title,
target,
flags)
Creates and returns a new object.
sub Type
Returns the MenuEntryType.
The types of entries that can appear in the menu.
sub Title
Returns the title of the entry.
sub SetTitle #(title)
Replaces the entry’s title.
sub Target
Returns the target of the entry, if applicable.
sub SetTarget #(target)
Replaces the entry’s target.
sub Flags
Returns the Menu Entry Flags.
The various flags that can apply to a menu entry.
sub SetFlags #(flags)
Replaces the Menu Entry Flags.
A group.
sub GroupContent
Returns an arrayref of NaturalDocs::Menu::Entry objects representing the contents of the group, or undef otherwise.
A class representing an entry in the menu.
sub GroupIsEmpty
If the type is MENU_GROUP, returns whether the group is empty.
sub PushToGroup #(entry)
Pushes the entry to the end of the group content.
sub DeleteFromGroup #(index)
Deletes an entry from the group content by index.
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.
A dummy entry that marks where the original group content ends.
Whether the group contains a dummy MENU_ENDOFORIGINAL entry.
A source file, relative to the source directory.
A string representing the absolute, platform-dependent path to a file.
A web link.
An index.
A string representing a topic type as defined in Topics.txt.
Close