Lomse library. API documentation  0.30.0
AObject Class Reference
Inheritance diagram for AObject:
ADynamic AInstrGroup AInstrument ALink AList AMidiInfo AParagraph AScore ASoundInfo ATextItem IChildren ISiblings

Detailed Description

Abstract base class for all objects composing the document

Warning
This documentation is incomplete. The user API for the document internal model is currently being defined and, thus, for this class, only some methods have been defined.

Public Member Functions

 AObject ()
 
bool is_valid () const
 
ImoObj * internal_object () const
 
Object properties
ImoId object_id () const
 
const std::string & object_name () const
 
ADocument owner_document () const
 
Downcast objects

All API classes derive from base class AObject. These downcasting methods convert the AObject to the derived class referenced by it.

ADynamic downcast_to_dynamic () const
 
AInstrument downcast_to_instrument () const
 
AInstrGroup downcast_to_instr_group () const
 
ALink downcast_to_link () const
 
AList downcast_to_list () const
 
AParagraph downcast_to_paragraph () const
 
AScore downcast_to_score () const
 
ATextItem downcast_to_text_item () const
 
Check referenced object type

All API classes derive from base class AObject. These testing methods allow to check the type of derived object referenced by this AObject.

bool is_anonymous_block () const
 
bool is_button () const
 
bool is_content () const
 
bool is_control () const
 
bool is_dynamic () const
 
bool is_heading () const
 
bool is_image () const
 
bool is_inline_wrapper () const
 
bool is_instrument () const
 
bool is_instr_group () const
 
bool is_link () const
 
bool is_list () const
 
bool is_list_item () const
 
bool is_midi_info () const
 
bool is_multicolumn () const
 
bool is_music_data () const
 
bool is_paragraph () const
 
bool is_score () const
 
bool is_sound_info () const
 
bool is_table () const
 
bool is_table_cell () const
 
bool is_table_body () const
 
bool is_table_head () const
 
bool is_table_row () const
 
bool is_text_item () const
 

Constructor & Destructor Documentation

◆ AObject()

AObject ( )

Default constructor. Creates an empty (invalid) AObject. Useful for methods that returns an AObject when a valid object cannot be returned.

Member Function Documentation

◆ downcast_to_dynamic()

ADynamic downcast_to_dynamic ( ) const

Downcasts this AObject to an ADynamic. That is, if this AObject references an ADynamic object, this method returns the referenced ADynamic object. Otherwise, it returns an invalid (nullptr) ADynamic.

◆ downcast_to_instr_group()

AInstrGroup downcast_to_instr_group ( ) const

Downcasts this AObject to an AInstrument. That is, if this AObject references an AInstrument object, this method returns the referenced AInstrument object. Otherwise, it returns an invalid (nullptr) AInstrument.

◆ downcast_to_instrument()

AInstrument downcast_to_instrument ( ) const

Downcasts this AObject to an AInstrument. That is, if this AObject references an AInstrument object, this method returns the referenced AInstrument object. Otherwise, it returns an invalid (nullptr) AInstrument.

◆ downcast_to_link()

ALink downcast_to_link ( ) const

Downcasts this AObject to an ALink. That is, if this AObject references an ALink object, this method returns the referenced ALink object. Otherwise, it returns an invalid (nullptr) ALink.

◆ downcast_to_list()

AList downcast_to_list ( ) const

Downcasts this AObject to an AList. That is, if this AObject references an AList object, this method returns the referenced AList object. Otherwise, it returns an invalid (nullptr) AList.

◆ downcast_to_paragraph()

AParagraph downcast_to_paragraph ( ) const

Downcasts this AObject to an AParagraph. That is, if this AObject references an AParagraph object, this method returns the referenced AParagraph object. Otherwise, it returns an invalid (nullptr) AParagraph.

◆ downcast_to_score()

AScore downcast_to_score ( ) const

Downcasts this AObject to an AScore. That is, if this AObject references an AScore object, this method returns the referenced AScore object. Otherwise, it returns an invalid (nullptr) AScore.

◆ downcast_to_text_item()

ATextItem downcast_to_text_item ( ) const

Downcasts this AObject to a ATextItem. That is, if this AObject references an ATextItem object, this method returns the referenced ATextItem object. Otherwise, it returns an invalid (nullptr) ATextItem.

◆ internal_object()

ImoObj * internal_object ( ) const

Transitional, to facilitate migration to the new public API. Notice that this method will be removed in future so, please, if you need to use this method open an issue at https://github.com/lenmus/lomse/issues explaining the need, so that the public API could be fixed and your app. would not be affected in future when this method is removed.

◆ is_anonymous_block()

bool is_anonymous_block ( ) const

Returns true if the object referenced by this AObject is an anonymous block (AAnonymousBlock class)

◆ is_button()

bool is_button ( ) const

Returns true if the object referenced by this AObject is an button control (AButton class)

◆ is_content()

bool is_content ( ) const

Returns true if the object referenced by this AObject is an content block (a <div> block), represented by the AContent class.

◆ is_control()

bool is_control ( ) const

Returns true if the object referenced by this AObject is an control object (AControl class)

◆ is_dynamic()

bool is_dynamic ( ) const

Returns true if the object referenced by this AObject is a dynamically generated content block (ADynamic class)

◆ is_heading()

bool is_heading ( ) const

Returns true if the object referenced by this AObject is a heading (AHeading class)

◆ is_image()

bool is_image ( ) const

Returns true if the object referenced by this AObject is an image (AImage class)

◆ is_inline_wrapper()

bool is_inline_wrapper ( ) const

Returns true if the object referenced by this AObject is an generic inline-box container (similar to the <spam> html element) represented by the AInlineWrapper class.

◆ is_instr_group()

bool is_instr_group ( ) const

Returns true if the object referenced by this AObject is an score instruments group (AInstrGroup class)

◆ is_instrument()

bool is_instrument ( ) const

Returns true if the object referenced by this AObject is an score instrument (AInstrument class)

◆ is_link()

bool is_link ( ) const

Returns true if the object referenced by this AObject is an hyperlink (ALink class)

◆ is_list()

bool is_list ( ) const

Returns true if the object referenced by this AObject is a list (AList class)

◆ is_list_item()

bool is_list_item ( ) const

Returns true if the object referenced by this AObject is a list item (AListItem class)

◆ is_midi_info()

bool is_midi_info ( ) const

Returns true if the object referenced by this AObject is a MIDI properties object (AMidiInfo class)

◆ is_multicolumn()

bool is_multicolumn ( ) const

Returns true if the object referenced by this AObject is a multi-column container object (IMultiColumn class)

◆ is_music_data()

bool is_music_data ( ) const

Returns true if the object referenced by this AObject is a container describing the musical content for an instrument (IMusicData class)

◆ is_paragraph()

bool is_paragraph ( ) const

Returns true if the object referenced by this AObject is a paragraph (AParagraph class)

◆ is_score()

bool is_score ( ) const

Returns true if the object referenced by this AObject is a music score (AScore class)

◆ is_sound_info()

bool is_sound_info ( ) const

Returns true if the object referenced by this AObject is a sound properties object (ASoundInfo class)

◆ is_table()

bool is_table ( ) const

Returns true if the object referenced by this AObject is a table (ATable class)

◆ is_table_body()

bool is_table_body ( ) const

Returns true if the object referenced by this AObject is the body for a table (ATableBody class)

◆ is_table_cell()

bool is_table_cell ( ) const

Returns true if the object referenced by this AObject is a cell for a table (ATableCell class)

◆ is_table_head()

bool is_table_head ( ) const

Returns true if the object referenced by this AObject is the head for a table (ATableHead class)

◆ is_table_row()

bool is_table_row ( ) const

Returns true if the object referenced by this AObject is a row for a table (ATableRow class)

◆ is_text_item()

bool is_text_item ( ) const

Returns true if the object referenced by this AObject is a chunk of text (ATextItem class)

◆ is_valid()

bool is_valid ( ) const

Returns false when the object is not in a usable state. It is the equivalent to checking if a pointer contains value nullptr.

What happens if you tries to use it? The same than if you tries to use a nullptr pointer: a crash!

◆ object_id()

ImoId object_id ( ) const

Returns the internal unique identifier (ID) for this object. It could be required by some methods in the libray.

◆ object_name()

const std::string & object_name ( ) const

Returns the name of this object class. It is an string.

◆ owner_document()

ADocument owner_document ( ) const

Returns the ADocument owning this object.