MuseScore  3.4
Music composition and notation
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Ms::PalettePanel Class Reference

#include <palettetree.h>

Public Types

enum  Type {
  Type::Unknown = 0, Type::Clef, Type::KeySig, Type::TimeSig,
  Type::Bracket, Type::Accidental, Type::Articulation, Type::Ornament,
  Type::Breath, Type::GraceNote, Type::NoteHead, Type::Line,
  Type::BarLine, Type::Arpeggio, Type::Tremolo, Type::Text,
  Type::Tempo, Type::Dynamic, Type::Fingering, Type::Repeat,
  Type::FretboardDiagram, Type::Accordion, Type::BagpipeEmbellishment, Type::Break,
  Type::Frame, Type::Beam, Type::Custom
}
 

Public Member Functions

 PalettePanel (Type t=Type::Custom)
 
PaletteCellinsert (int idx, Element *e, const QString &name, QString tag=QString(), qreal mag=1.0)
 
PaletteCellappend (Element *e, const QString &name, QString tag=QString(), qreal mag=1.0)
 
const QString & name () const
 
void setName (const QString &str)
 
QString translatedName () const
 
QSize gridSize () const
 
void setGrid (QSize s)
 
void setGrid (int w, int h)
 
qreal mag () const
 
void setMag (qreal val)
 
bool drawGrid () const
 
void setDrawGrid (bool val)
 
qreal yOffset () const
 
void setYOffset (qreal val)
 
bool moreElements () const
 
void setMoreElements (bool val)
 
bool visible () const
 
void setVisible (bool val)
 
bool custom () const
 
void write (XmlWriter &) const
 
bool read (XmlReader &)
 
QByteArray mimeData () const
 
bool readFromFile (const QString &path)
 
bool writeToFile (const QString &path) const
 write as compressed zip file and include images as needed More...
 
int ncells () const
 
bool empty () const
 
PaletteCellPtr cell (int idx)
 
PaletteCellConstPtr cell (int idx) const
 
std::vector< PaletteCellPtrtakeCells (int idx, int count)
 
bool insertCells (int idx, std::vector< PaletteCellPtr > cells)
 
bool insertCell (int idx, PaletteCellPtr cell)
 
int findPaletteCell (const PaletteCell &cell, bool matchName=true) const
 
bool expanded () const
 
void setExpanded (bool val)
 
bool editable () const
 
void setEditable (bool val)
 
Type type () const
 
void setType (Type t)
 
Type contentType () const
 Returns palette type if it is defined or deduces it from the palette content for custom palettes. More...
 
void retranslate ()
 

Static Public Member Functions

static std::unique_ptr< PalettePanelreadMimeData (const QByteArray &data)
 

Static Public Attributes

static constexpr const char * mimeDataFormat = "application/musescore/palette/panel"
 

Private Member Functions

Type guessType () const
 

Private Attributes

QString _name
 
Type _type
 
std::vector< PaletteCellPtrcells
 
QSize _gridSize = QSize(64, 64)
 
qreal _mag = 1.0
 
bool _drawGrid = false
 
bool _editable = true
 
qreal _yOffset = 0.0
 
bool _moreElements = false
 
bool _visible = true
 
bool _expanded = false
 

Member Enumeration Documentation

◆ Type

Enumerator
Unknown 
Clef 
KeySig 
TimeSig 
Bracket 
Accidental 
Articulation 
Ornament 
Breath 
GraceNote 
NoteHead 
Line 
BarLine 
Arpeggio 
Tremolo 
Text 
Tempo 
Dynamic 
Fingering 
Repeat 
FretboardDiagram 
Accordion 
BagpipeEmbellishment 
Break 
Frame 
Beam 
Custom 

Constructor & Destructor Documentation

◆ PalettePanel()

Ms::PalettePanel::PalettePanel ( Type  t = Type::Custom)
inline

Member Function Documentation

◆ append()

PaletteCell * Ms::PalettePanel::append ( Element e,
const QString &  name,
QString  tag = QString(),
qreal  mag = 1.0 
)

◆ cell() [1/2]

PaletteCellPtr Ms::PalettePanel::cell ( int  idx)
inline

◆ cell() [2/2]

PaletteCellConstPtr Ms::PalettePanel::cell ( int  idx) const
inline

◆ contentType()

PalettePanel::Type Ms::PalettePanel::contentType ( ) const

Returns palette type if it is defined or deduces it from the palette content for custom palettes.

◆ custom()

bool Ms::PalettePanel::custom ( ) const
inline

◆ drawGrid()

bool Ms::PalettePanel::drawGrid ( ) const
inline

◆ editable()

bool Ms::PalettePanel::editable ( ) const
inline

◆ empty()

bool Ms::PalettePanel::empty ( ) const
inline

◆ expanded()

bool Ms::PalettePanel::expanded ( ) const
inline

◆ findPaletteCell()

int Ms::PalettePanel::findPaletteCell ( const PaletteCell cell,
bool  matchName = true 
) const

◆ gridSize()

QSize Ms::PalettePanel::gridSize ( ) const
inline

◆ guessType()

PalettePanel::Type Ms::PalettePanel::guessType ( ) const
private

◆ insert()

PaletteCell * Ms::PalettePanel::insert ( int  idx,
Element e,
const QString &  name,
QString  tag = QString(),
qreal  mag = 1.0 
)

◆ insertCell()

bool Ms::PalettePanel::insertCell ( int  idx,
PaletteCellPtr  cell 
)

◆ insertCells()

bool Ms::PalettePanel::insertCells ( int  idx,
std::vector< PaletteCellPtr cells 
)

◆ mag()

qreal Ms::PalettePanel::mag ( ) const
inline

◆ mimeData()

QByteArray Ms::PalettePanel::mimeData ( ) const

◆ moreElements()

bool Ms::PalettePanel::moreElements ( ) const
inline

◆ name()

const QString& Ms::PalettePanel::name ( ) const
inline

◆ ncells()

int Ms::PalettePanel::ncells ( ) const
inline

◆ read()

bool Ms::PalettePanel::read ( XmlReader e)

◆ readFromFile()

bool Ms::PalettePanel::readFromFile ( const QString &  path)

◆ readMimeData()

std::unique_ptr< PalettePanel > Ms::PalettePanel::readMimeData ( const QByteArray &  data)
static

◆ retranslate()

void Ms::PalettePanel::retranslate ( )

◆ setDrawGrid()

void Ms::PalettePanel::setDrawGrid ( bool  val)
inline

◆ setEditable()

void Ms::PalettePanel::setEditable ( bool  val)
inline

◆ setExpanded()

void Ms::PalettePanel::setExpanded ( bool  val)
inline

◆ setGrid() [1/2]

void Ms::PalettePanel::setGrid ( QSize  s)
inline

◆ setGrid() [2/2]

void Ms::PalettePanel::setGrid ( int  w,
int  h 
)
inline

◆ setMag()

void Ms::PalettePanel::setMag ( qreal  val)
inline

◆ setMoreElements()

void Ms::PalettePanel::setMoreElements ( bool  val)
inline

◆ setName()

void Ms::PalettePanel::setName ( const QString &  str)
inline

◆ setType()

void Ms::PalettePanel::setType ( Type  t)
inline

◆ setVisible()

void Ms::PalettePanel::setVisible ( bool  val)
inline

◆ setYOffset()

void Ms::PalettePanel::setYOffset ( qreal  val)
inline

◆ takeCells()

std::vector< PaletteCellPtr > Ms::PalettePanel::takeCells ( int  idx,
int  count 
)

◆ translatedName()

QString Ms::PalettePanel::translatedName ( ) const
inline

◆ type()

Type Ms::PalettePanel::type ( ) const
inline

◆ visible()

bool Ms::PalettePanel::visible ( ) const
inline

◆ write()

void Ms::PalettePanel::write ( XmlWriter xml) const

◆ writeToFile()

bool Ms::PalettePanel::writeToFile ( const QString &  path) const

write as compressed zip file and include images as needed

◆ yOffset()

qreal Ms::PalettePanel::yOffset ( ) const
inline

Member Data Documentation

◆ _drawGrid

bool Ms::PalettePanel::_drawGrid = false
private

◆ _editable

bool Ms::PalettePanel::_editable = true
private

◆ _expanded

bool Ms::PalettePanel::_expanded = false
private

◆ _gridSize

QSize Ms::PalettePanel::_gridSize = QSize(64, 64)
private

◆ _mag

qreal Ms::PalettePanel::_mag = 1.0
private

◆ _moreElements

bool Ms::PalettePanel::_moreElements = false
private

◆ _name

QString Ms::PalettePanel::_name
private

◆ _type

Type Ms::PalettePanel::_type
private

◆ _visible

bool Ms::PalettePanel::_visible = true
private

◆ _yOffset

qreal Ms::PalettePanel::_yOffset = 0.0
private

◆ cells

std::vector<PaletteCellPtr> Ms::PalettePanel::cells
private

◆ mimeDataFormat

constexpr const char* Ms::PalettePanel::mimeDataFormat = "application/musescore/palette/panel"
static

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