libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
libscratchcpp::Comment Class Reference

The Comment class represents a comment in the code area. More...

#include <scratchcpp/comment.h>

Inheritance diagram for libscratchcpp::Comment:
Collaboration diagram for libscratchcpp::Comment:

Public Member Functions

 Comment (const std::string &id, double x=0, double y=0)
 
 Comment (const Comment &)=delete
 
const std::string & blockId () const
 
void setBlockId (const std::string id)
 
Blockblock () const
 
void setBlock (Block *block)
 
double x () const
 
void setX (double x)
 
double y () const
 
void setY (double y)
 
double width () const
 
void setWidth (double width)
 
double height () const
 
void setHeight (double height)
 
bool minimized () const
 
void setMinimized (bool minimized)
 
const std::string & text () const
 
void setText (const std::string &text)
 
const std::string & id () const
 
void setId (const std::string &newId)
 

Detailed Description

The Comment class represents a comment in the code area.

Constructor & Destructor Documentation

◆ Comment() [1/2]

Comment::Comment ( const std::string & id,
double x = 0,
double y = 0 )

Constructs Comment at the given position in the code area.

◆ Comment() [2/2]

libscratchcpp::Comment::Comment ( const Comment & )
delete

Member Function Documentation

◆ block()

Block * Comment::block ( ) const

Returns the block the comment is attached to.

◆ blockId()

const std::string & Comment::blockId ( ) const

Returns the ID of the block the comment is attached to.

◆ height()

double Comment::height ( ) const

Returns the height.

◆ id()

const std::string & Entity::id ( ) const
inherited

Returns the ID.

◆ minimized()

bool Comment::minimized ( ) const

Returns true if the comment is collapsed and false otherwise.

◆ setBlock()

void Comment::setBlock ( Block * block)

Sets the block the comment is attached to.

◆ setBlockId()

void Comment::setBlockId ( const std::string id)

Sets the ID of the block the comment is attached to.

◆ setHeight()

void Comment::setHeight ( double height)

Sets the height.

◆ setId()

void Entity::setId ( const std::string & newId)
inherited

Sets the ID.

◆ setMinimized()

void Comment::setMinimized ( bool minimized)

Sets whether the comment is collapsed.

◆ setText()

void Comment::setText ( const std::string & text)

Sets the text.

◆ setWidth()

void Comment::setWidth ( double width)

Sets the width.

◆ setX()

void Comment::setX ( double x)

Sets the x-coordinate of the comment in the code area.

◆ setY()

void Comment::setY ( double y)

Sets the x-coordinate of the comment in the code area.

◆ text()

const std::string & Comment::text ( ) const

Returns the text.

◆ width()

double Comment::width ( ) const

Returns the width.

◆ x()

double Comment::x ( ) const

Returns the x-coordinate of the comment in the code area.

◆ y()

double Comment::y ( ) const

Returns the y-coordinate of the comment in the code area.


The documentation for this class was generated from the following files: